| Class | ActiveMerchant::Billing::ProtxGateway |
| In: |
lib/active_merchant/billing/gateways/protx.rb
|
| Parent: | Gateway |
| TEST_URL | = | 'https://ukvpstest.protx.com/vspgateway/service' |
| LIVE_URL | = | 'https://ukvps.protx.com/vspgateway/service' |
| SIMULATOR_URL | = | 'https://ukvpstest.protx.com/VSPSimulator' |
| APPROVED | = | 'OK' |
| TRANSACTIONS | = | { :purchase => 'PAYMENT', :credit => 'REFUND', :authorization => 'DEFERRED', :capture => 'RELEASE', :void => 'VOID' |
| CREDIT_CARDS | = | { :visa => "VISA", :master => "MC", :delta => "DELTA", :solo => "SOLO", :switch => "MAESTRO", :maestro => "MAESTRO", :american_express => "AMEX", :electron => "UKE", :diners_club => "DC", :jcb => "JCB" |
| ELECTRON | = | /^(424519|42496[23]|450875|48440[6-8]|4844[1-5][1-5]|4917[3-5][0-9]|491880)\d{10}(\d{3})?$/ |
| AVS_CVV_CODE | = | { "NOTPROVIDED" => nil, "NOTCHECKED" => 'X', "MATCHED" => 'Y', "NOTMATCHED" => 'N' |
# File lib/active_merchant/billing/gateways/protx.rb, line 50
50: def initialize(options = {})
51: requires!(options, :login)
52: @options = options
53: super
54: end
# File lib/active_merchant/billing/gateways/protx.rb, line 74
74: def authorize(money, credit_card, options = {})
75: requires!(options, :order_id)
76:
77: post = {}
78:
79: add_amount(post, money, options)
80: add_invoice(post, options)
81: add_credit_card(post, credit_card)
82: add_address(post, options)
83: add_customer_data(post, options)
84:
85: commit(:authorization, post)
86: end
You can only capture a transaction once, even if you didn‘t capture the full amount the first time.
# File lib/active_merchant/billing/gateways/protx.rb, line 89
89: def capture(money, identification, options = {})
90: post = {}
91:
92: add_reference(post, identification)
93: add_release_amount(post, money, options)
94:
95: commit(:capture, post)
96: end
Crediting requires a new order_id to passed in, as well as a description
# File lib/active_merchant/billing/gateways/protx.rb, line 106
106: def credit(money, identification, options = {})
107: requires!(options, :order_id, :description)
108:
109: post = {}
110:
111: add_credit_reference(post, identification)
112: add_amount(post, money, options)
113: add_invoice(post, options)
114:
115: commit(:credit, post)
116: end
# File lib/active_merchant/billing/gateways/protx.rb, line 60
60: def purchase(money, credit_card, options = {})
61: requires!(options, :order_id)
62:
63: post = {}
64:
65: add_amount(post, money, options)
66: add_invoice(post, options)
67: add_credit_card(post, credit_card)
68: add_address(post, options)
69: add_customer_data(post, options)
70:
71: commit(:purchase, post)
72: end
# File lib/active_merchant/billing/gateways/protx.rb, line 56
56: def test?
57: @options[:test] || super
58: end