module GpWebpay::Payment
Public Instance Methods
deposit_flag()
click to toggle source
# File lib/gp_webpay/payment.rb, line 9 def deposit_flag 1 end
merchant_number()
click to toggle source
# File lib/gp_webpay/payment.rb, line 21 def merchant_number config.merchant_number end
operation()
click to toggle source
# File lib/gp_webpay/payment.rb, line 25 def operation "CREATE_ORDER" end
pay_url(options = {})
click to toggle source
# File lib/gp_webpay/payment.rb, line 29 def pay_url(options = {}) self.redirect_url ||= options[:redirect_url] GpWebpay.logger.info "Attributes user for URL generation: #{pay_verification.payment_attributes_with_digest}" generated_url = "#{config.pay_url}?#{pay_verification.payment_attributes_with_digest.to_param}" GpWebpay.logger.info "Produced URL: #{generated_url}" generated_url end
payment_type()
click to toggle source
Calls superclass method
# File lib/gp_webpay/payment.rb, line 17 def payment_type super || "default" end
success?(params)
click to toggle source
# File lib/gp_webpay/payment.rb, line 38 def success?(params) pay_verification.verified_response?(params) && params["PRCODE"] == "0" && params["SRCODE"] == "0" end
user_param()
click to toggle source
# File lib/gp_webpay/payment.rb, line 13 def user_param "R" end
Private Instance Methods
config()
click to toggle source
# File lib/gp_webpay/payment.rb, line 53 def config GpWebpay.config end
pay_attributes()
click to toggle source
# File lib/gp_webpay/payment.rb, line 49 def pay_attributes @pay_attributes ||= PaymentAttributes.new(self).to_h end
pay_verification()
click to toggle source
# File lib/gp_webpay/payment.rb, line 57 def pay_verification ::GpWebpay::Verification.new(pay_attributes, pay_verification_attrs) end
pay_verification_attrs()
click to toggle source
# File lib/gp_webpay/payment.rb, line 45 def pay_verification_attrs %i(OPERATION ORDERNUMBER PRCODE SRCODE RESULTTEXT) end