Class: ActiveMerchant::Billing::CardStreamGateway
- Defined in:
- lib/active_merchant/billing/gateways/card_stream.rb
Constant Summary collapse
- 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' }
- CVV_CODE =
{ '0' => 'U', '1' => 'P', '2' => 'M', '4' => 'N' }
- AVS_POSTAL_MATCH =
0 - No additional information available. 1 - Postcode not checked. 2 - Postcode matched. 4 - Postcode not matched. 8 - Postcode partially matched.
{ "0" => nil, "1" => nil, "2" => "Y", "4" => "N", "8" => "N" }
- AVS_STREET_MATCH =
0 - No additional information available. 1 - Address numeric not checked. 2 - Address numeric matched. 4 - Address numeric not matched. 8 - Address numeric partially matched.
{ "0" => nil, "1" => nil, "2" => "Y", "4" => "N", "8" => "N" }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ CardStreamGateway
constructor
A new instance of CardStreamGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, supported_countries, #supported_countries, supported_countries=, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ CardStreamGateway
Returns a new instance of CardStreamGateway.
62 63 64 65 66 67 68 69 70 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 62 def initialize( = {}) requires!(, :login, :shared_secret) if ([:threeDSRequired]) @threeDSRequired = [:threeDSRequired] else @threeDSRequired = 'N' end super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 72 def (money, creditcard, = {}) post = {} add_amount(post, money, ) add_invoice(post, creditcard, money, ) add_creditcard(post, creditcard) add_address(post, creditcard, ) add_customer_data(post, ) commit('PREAUTH', post) end |
#capture(money, authorization, options = {}) ⇒ Object
92 93 94 95 96 97 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 92 def capture(money, , = {}) post = {} add_pair(post, :xref, ) add_amount(post, money, ) commit('SALE', post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 82 def purchase(money, creditcard, = {}) post = {} add_amount(post, money, ) add_invoice(post, creditcard, money, ) add_creditcard(post, creditcard) add_address(post, creditcard, ) add_customer_data(post, ) commit('SALE', post) end |
#refund(money, authorization, options = {}) ⇒ Object
99 100 101 102 103 104 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 99 def refund(money, , = {}) post = {} add_pair(post, :xref, ) add_amount(post, money, ) commit('REFUND', post) end |
#void(authorization, options = {}) ⇒ Object
106 107 108 109 110 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 106 def void(, = {}) post = {} add_pair(post, :xref, ) commit('REFUND', post) end |