Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::BeanstreamCore

Public Class Methods

included(base) click to toggle source
# File lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb, line 40
def self.included(base)
  base.default_currency = 'CAD'

  # The countries the gateway supports merchants from as 2 digit ISO country codes
  base.supported_countries = ['CA']

  # The card types supported by the payment gateway
  base.supported_cardtypes = [:visa, :master, :american_express]

  # The homepage URL of the gateway
  base.homepage_url = 'http://www.beanstream.com/'

  # The name of the gateway
  base.display_name = 'Beanstream.com'
end
new(options = {}) click to toggle source

Only :login is required by default, which is the merchant’s merchant ID. If you’d like to perform void, capture or refund transactions then you’ll also need to add a username and password to your account under administration -> account settings -> order settings -> Use username/password validation

# File lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb, line 61
def initialize(options = {})
  requires!(options, :login)
  @options = options
  super
end

Public Instance Methods

capture(money, authorization, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb, line 67
def capture(money, authorization, options = {})
  reference, amount, type = split_auth(authorization)
  
  post = {}
  add_amount(post, money)
  add_reference(post, reference)
  add_transaction_type(post, :capture)
  commit(post)
end
credit(money, source, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb, line 86
def credit(money, source, options = {})
  deprecated Gateway::CREDIT_DEPRECATION_MESSAGE
  refund(money, source, options)
end
refund(money, source, options = {}) click to toggle source
# File lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb, line 77
def refund(money, source, options = {})
  post = {}
  reference, amount, type = split_auth(source)
  add_reference(post, reference)
  add_transaction_type(post, refund_action(type))
  add_amount(post, money)
  commit(post)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.