Class: ActiveMerchant::Billing::BeanstreamInteracGateway

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

Constant Summary

Constants included from BeanstreamCore

ActiveMerchant::Billing::BeanstreamCore::AVS_CODES, ActiveMerchant::Billing::BeanstreamCore::CVD_CODES, ActiveMerchant::Billing::BeanstreamCore::PERIODICITIES, ActiveMerchant::Billing::BeanstreamCore::PERIODS, ActiveMerchant::Billing::BeanstreamCore::PROFILE_OPERATIONS, ActiveMerchant::Billing::BeanstreamCore::RECURRING_OPERATION, ActiveMerchant::Billing::BeanstreamCore::RECURRING_URL, ActiveMerchant::Billing::BeanstreamCore::SECURE_PROFILE_URL, ActiveMerchant::Billing::BeanstreamCore::SP_SERVICE_VERSION, ActiveMerchant::Billing::BeanstreamCore::TRANSACTIONS

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BeanstreamCore

#capture, #credit, included, #initialize, #refund

Methods inherited from Gateway

#card_brand, card_brand, #generate_unique_id, inherited, #initialize, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?

Methods included from CreditCardFormatting

#expdate, #format

Methods included from PostsData

included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request

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/active_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.



40
41
42
# File 'lib/active_merchant/billing/gateways/beanstream_interac.rb', line 40

def confirm(transaction)
  post(transaction)
end

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



25
26
27
28
29
30
31
32
33
# File 'lib/active_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

#success?(response) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/active_merchant/billing/gateways/beanstream_interac.rb', line 35

def success?(response)
  response[:responseType] == 'R' || response[:trnApproved] == '1' || response[:responseCode] == '1'
end