Class: MerbMerchant::Billing::BeanstreamInteracGateway

Inherits:
Gateway
  • Object
show all
Includes:
BeanstreamCore
Defined in:
lib/merb_merchant/billing/gateways/beanstream_interac.rb

Constant Summary

Constants included from BeanstreamCore

MerbMerchant::Billing::BeanstreamCore::AVS_CODES, MerbMerchant::Billing::BeanstreamCore::CVD_CODES, MerbMerchant::Billing::BeanstreamCore::TRANSACTIONS, MerbMerchant::Billing::BeanstreamCore::URL

Constants inherited from Gateway

Gateway::DEBIT_CARDS

Constants included from PostsData

PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT

Instance Attribute Summary

Attributes inherited from Gateway

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BeanstreamCore

#capture, #credit, included, #initialize

Methods inherited from Gateway

#card_brand, card_brand, inherited, #initialize, supports?, #test?

Methods included from Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #ssl_get, #ssl_post

Class Method Details

.confirm(transaction) ⇒ Object

Confirm a transaction posted back from the bank to Beanstream. Confirming a transaction does not require any credentials, and in an application with many merchants sharing a funded URL the application may not yet know which merchant the post back is for until the response of the confirmation is received, which contains the order number.



20
21
22
23
# File 'lib/merb_merchant/billing/gateways/beanstream_interac.rb', line 20

def self.confirm(transaction)
  gateway = new(:login => '')
  gateway.confirm(transaction)
end

Instance Method Details

#confirm(transaction) ⇒ Object

Confirm a transaction posted back from the bank to Beanstream.



36
37
38
# File 'lib/merb_merchant/billing/gateways/beanstream_interac.rb', line 36

def confirm(transaction)
  post(transaction)
end

#purchase(money, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/merb_merchant/billing/gateways/beanstream_interac.rb', line 25

def purchase(money, options = {})
  post = {}
  add_amount(post, money)
  add_invoice(post, options)
  add_address(post, options)
  add_interac_details(post, options)
  add_transaction_type(post, :purchase)
  commit(post)
end