Class: ActiveMerchant::Billing::CardStreamGateway
- Defined in:
- lib/active_merchant/billing/gateways/card_stream.rb
Overview
CardStream supports the following credit cards, which are auto-detected by the gateway based on the card number used:
-
AM American Express
-
Diners Club
-
Electron
-
JCB
-
UK Maestro
-
Maestro International
-
Mastercard
-
Solo
-
Style
-
Switch
-
Visa Credit
-
Visa Debit
-
Visa Purchasing
Constant Summary collapse
- URL =
'https://gateway.cardstream.com/process.ashx'
- APPROVED =
'00'
- 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' }
- TRANSACTIONS =
{ :purchase => 'ESALE_KEYED', :refund => 'EREFUND_KEYED', :authorization => 'ESALE_KEYED' }
- 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
Constants included from PostsData
PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CardStreamGateway
constructor
A new instance of CardStreamGateway.
- #purchase(money, credit_card, 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, #retry_exceptions, #ssl_post
Constructor Details
#initialize(options = {}) ⇒ CardStreamGateway
Returns a new instance of CardStreamGateway.
88 89 90 91 92 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 88 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#purchase(money, credit_card, options = {}) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/active_merchant/billing/gateways/card_stream.rb', line 94 def purchase(money, credit_card, = {}) requires!(, :order_id) post = {} add_amount(post, money, ) add_invoice(post, money, credit_card, ) add_credit_card(post, credit_card) add_address(post, ) add_customer_data(post, ) commit(:purchase, post) end |