Class: ActiveMerchant::Billing::ProtxGateway
- Defined in:
- lib/active_merchant/billing/gateways/protx.rb
Constant Summary collapse
- 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", :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' }
Constants inherited from Gateway
Constants included from PostsData
PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card, options = {}) ⇒ Object
-
#capture(money, identification, options = {}) ⇒ Object
Only supports capturing the original amount of the transaction.
-
#credit(money, identification, options = {}) ⇒ Object
Crediting requires a new order_id to passed in, as well as a description.
-
#initialize(options = {}) ⇒ ProtxGateway
constructor
A new instance of ProtxGateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
- #test? ⇒ Boolean
- #void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #retry_exceptions, #ssl_post
Constructor Details
#initialize(options = {}) ⇒ ProtxGateway
Returns a new instance of ProtxGateway.
49 50 51 52 53 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 49 def initialize( = {}) requires!(, :login) @options = super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 73 def (money, credit_card, = {}) requires!(, :order_id) post = {} add_amount(post, money, ) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, ) add_customer_data(post, ) commit(:authorization, post) end |
#capture(money, identification, options = {}) ⇒ Object
Only supports capturing the original amount of the transaction
88 89 90 91 92 93 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 88 def capture(money, identification, = {}) post = {} add_reference(post, identification) commit(:capture, post) end |
#credit(money, identification, options = {}) ⇒ Object
Crediting requires a new order_id to passed in, as well as a description
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 103 def credit(money, identification, = {}) requires!(, :order_id, :description) post = {} add_credit_reference(post, identification) add_amount(post, money, ) add_invoice(post, ) commit(:credit, post) end |
#purchase(money, credit_card, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 59 def purchase(money, credit_card, = {}) requires!(, :order_id) post = {} add_amount(post, money, ) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, ) add_customer_data(post, ) commit(:purchase, post) end |
#test? ⇒ Boolean
55 56 57 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 55 def test? @options[:test] || Base.gateway_mode == :test end |
#void(identification, options = {}) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/active_merchant/billing/gateways/protx.rb', line 95 def void(identification, = {}) post = {} add_reference(post, identification) commit(:void, post) end |