Class: ActiveMerchant::Billing::PayboxDirectGateway
- Defined in:
- lib/active_merchant/billing/gateways/paybox_direct.rb
Constant Summary collapse
- TEST_URL =
'https://ppps.paybox.com/PPPS.php'
- TEST_URL_BACKUP =
'https://ppps1.paybox.com/PPPS.php'
- LIVE_URL =
'https://ppps.paybox.com/PPPS.php'
- LIVE_URL_BACKUP =
'https://ppps1.paybox.com/PPPS.php'
- API_VERSION =
Payment API Version
'00104'
- TRANSACTIONS =
Transactions hash
{ :authorization => '00001', :capture => '00002', :purchase => '00003', :unreferenced_credit => '00004', :void => '00005', :refund => '00014' }
- CURRENCY_CODES =
{ "AUD"=> '036', "CAD"=> '124', "CZK"=> '203', "DKK"=> '208', "HKD"=> '344', "ICK"=> '352', "JPY"=> '392', "NOK"=> '578', "SGD"=> '702', "SEK"=> '752', "CHF"=> '756', "GBP"=> '826', "USD"=> '840', "EUR"=> '978' }
- SUCCESS_CODES =
['00000']
- UNAVAILABILITY_CODES =
['00001', '00097', '00098']
- FRAUD_CODES =
['00102','00104','00105','00134','00138','00141','00143','00156','00157','00159']
- SUCCESS_MESSAGE =
'The transaction was approved'
- FAILURE_MESSAGE =
'The transaction failed'
Constants inherited from Gateway
Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
- #credit(money, identification, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ PayboxDirectGateway
constructor
A new instance of PayboxDirectGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #test? ⇒ Boolean
- #void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ PayboxDirectGateway
Returns a new instance of PayboxDirectGateway.
63 64 65 66 67 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 63 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
69 70 71 72 73 74 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 69 def (money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) commit('authorization', money, post) end |
#capture(money, authorization, options = {}) ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 83 def capture(money, , = {}) requires!(, :order_id) post = {} add_invoice(post, ) post[:numappel] = [0,10] post[:numtrans] = [10,10] commit('capture', money, post) end |
#credit(money, identification, options = {}) ⇒ Object
102 103 104 105 106 107 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 102 def credit(money, identification, = {}) post = {} add_invoice(post, ) add_reference(post, identification) commit('refund', money, post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 76 def purchase(money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) commit('purchase', money, post) end |
#test? ⇒ Boolean
109 110 111 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 109 def test? @options[:test] || Base.gateway_mode == :test end |
#void(identification, options = {}) ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/active_merchant/billing/gateways/paybox_direct.rb', line 92 def void(identification, = {}) requires!(, :order_id, :amount) post ={} add_invoice(post, ) add_reference(post, identification) post[:porteur] = '000000000000000' post[:dateval] = '0000' commit('void', [:amount], post) end |