Class ActiveMerchant::Billing::CardStreamGateway
In: lib/active_merchant/billing/gateways/card_stream.rb
Parent: Gateway

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

Methods

new   purchase  

Constants

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" => nil, "1" => nil, "2" => "Y", "4" => "N", "8" => "N"   0 - No additional information available. 1 - Postcode not checked. 2 - Postcode matched. 4 - Postcode not matched. 8 - Postcode partially matched.
AVS_STREET_MATCH = { "0" => nil, "1" => nil, "2" => "Y", "4" => "N", "8" => "N"   0 - No additional information available. 1 - Address numeric not checked. 2 - Address numeric matched. 4 - Address numeric not matched. 8 - Address numeric partially matched.

Public Class methods

[Source]

    # File lib/active_merchant/billing/gateways/card_stream.rb, line 88
88:       def initialize(options = {})
89:         requires!(options, :login, :password)
90:         @options = options
91:         super
92:       end

Public Instance methods

[Source]

     # File lib/active_merchant/billing/gateways/card_stream.rb, line 94
 94:       def purchase(money, credit_card, options = {})
 95:         requires!(options, :order_id)
 96:         
 97:         post = {}
 98:         
 99:         add_amount(post, money, options)
100:         add_invoice(post, money, credit_card, options)
101:         add_credit_card(post, credit_card)
102:         add_address(post, options)
103:         add_customer_data(post, options)
104: 
105:         commit(:purchase, post)
106:       end

[Validate]