Module: ActiveMerchant::Billing::PayflowCommonAPI
- Included in:
- PayflowExpressGateway, PayflowGateway
- Defined in:
- lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb
Constant Summary collapse
- 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' }
Class Method Summary collapse
Instance Method Summary collapse
- #capture(money, authorization, options = {}) ⇒ Object
- #initialize(options = {}) ⇒ Object
- #test? ⇒ Boolean
- #void(authorization, options = {}) ⇒ Object
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb', line 4 def self.included(base) base.default_currency = 'USD' base.class_inheritable_accessor :partner # Set the default partner to PayPal base.partner = 'PayPal' base.supported_countries = ['US', 'CA', 'SG', 'AU'] base.class_inheritable_accessor :timeout base.timeout = 60 # Enable safe retry of failed connections # Payflow is safe to retry because retried transactions use the same # X-VPS-Request-ID header. If a transaction is detected as a duplicate # only the original transaction data will be used by Payflow, and the # subsequent Responses will have a :duplicate parameter set in the params # hash. base.retry_safe = true end |
Instance Method Details
#capture(money, authorization, options = {}) ⇒ Object
68 69 70 71 |
# File 'lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb', line 68 def capture(money, , = {}) request = build_reference_request(:capture, money, , ) commit(request) end |
#initialize(options = {}) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb', line 56 def initialize( = {}) requires!(, :login, :password) @options = @options[:partner] = partner if @options[:partner].blank? super end |
#test? ⇒ Boolean
64 65 66 |
# File 'lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb', line 64 def test? @options[:test] || super end |
#void(authorization, options = {}) ⇒ Object
73 74 75 76 |
# File 'lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb', line 73 def void(, = {}) request = build_reference_request(:void, nil, , ) commit(request) end |