Module: GpWebpay::Payment

Extended by:
ActiveSupport::Concern
Defined in:
lib/gp_webpay/payment.rb

Instance Method Summary collapse

Instance Method Details

#deposit_flagObject



9
10
11
# File 'lib/gp_webpay/payment.rb', line 9

def deposit_flag
  1
end

#merchant_numberObject



21
22
23
# File 'lib/gp_webpay/payment.rb', line 21

def merchant_number
  config.merchant_number
end

#operationObject



25
26
27
# File 'lib/gp_webpay/payment.rb', line 25

def operation
  "CREATE_ORDER"
end

#pay_url(options = {}) ⇒ Object



29
30
31
32
33
34
35
36
# 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_typeObject



17
18
19
# File 'lib/gp_webpay/payment.rb', line 17

def payment_type
  super || "default"
end

#success?(params) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/gp_webpay/payment.rb', line 38

def success?(params)
  pay_verification.verified_response?(params) &&
    params["PRCODE"] == "0" && params["SRCODE"] == "0"
end

#user_paramObject



13
14
15
# File 'lib/gp_webpay/payment.rb', line 13

def user_param
  "R"
end