| Module | ActiveMerchant::Billing::PayflowCommonAPI |
| In: |
lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb
|
| XMLNS | = | 'http://www.paypal.com/XMLPay' |
| TEST_URL | = | 'https://pilot-payflowpro.paypal.com' |
| LIVE_URL | = | 'https://payflowpro.paypal.com' |
| CARD_MAPPING | = | { :visa => 'Visa', :master => 'MasterCard', :discover => 'Discover', :american_express => 'Amex', :jcb => 'JCB', :diners_club => 'DinersClub', :switch => 'Switch', :solo => 'Solo' |
| TRANSACTIONS | = | { :purchase => "Sale", :authorization => "Authorization", :capture => "Capture", :void => "Void", :credit => "Credit" |
| CVV_CODE | = | { 'Match' => 'M', 'No Match' => 'N', 'Service Not Available' => 'U', 'Service not Requested' => 'P' |
# File lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb, line 4
4: def self.included(base)
5: base.default_currency = 'USD'
6:
7: # The certification id requirement has been removed by Payflow
8: # This is no longer being sent in the requests to the gateway
9: base.class_inheritable_accessor :certification_id
10:
11: base.class_inheritable_accessor :partner
12:
13: # Set the default partner to PayPal
14: base.partner = 'PayPal'
15:
16: base.supported_countries = ['US', 'CA', 'SG', 'AU']
17:
18: base.class_inheritable_accessor :timeout
19: base.timeout = 60
20:
21: # Enable safe retry of failed connections
22: # Payflow is safe to retry because retried transactions use the same
23: # X-VPS-Request-ID header. If a transaction is detected as a duplicate
24: # only the original transaction data will be used by Payflow, and the
25: # subsequent Responses will have a :duplicate parameter set in the params
26: # hash.
27: base.retry_safe = true
28: end
# File lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb, line 60
60: def initialize(options = {})
61: requires!(options, :login, :password)
62: @options = {
63: :certification_id => self.class.certification_id,
64: :partner => self.class.partner
65: }.update(options)
66:
67: super
68: end
# File lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb, line 74
74: def capture(money, authorization, options = {})
75: request = build_reference_request(:capture, money, authorization, options)
76: commit(request)
77: end
# File lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb, line 70
70: def test?
71: @options[:test] || super
72: end