Class: ActiveMerchant::Billing::BankFrickGateway

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

Overview

For more information visit Bank Frick Acquiring Services

Written by Piers Chambers (Varyonic.com)

Constant Summary collapse

SUPPORTED_TRANSACTIONS =

The set of supported transactions for this gateway. More operations are supported by the gateway itself, but are not supported in this library.

{
  'sale'      => 'CC.DB',
  'authonly'  => 'CC.PA',
  'capture'   => 'CC.CP',
  'refund'    => 'CC.RF',
  'void'      => 'CC.RV'
}

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #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

Constructor Details

#initialize(options = {}) ⇒ BankFrickGateway

Returns a new instance of BankFrickGateway.



30
31
32
33
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 30

def initialize(options = {})
  requires!(options, :sender, :channel, :userid, :userpwd)
  super
end

Instance Method Details

#authorize(money, payment, options = {}) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 45

def authorize(money, payment, options = {})
  post = {}
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, payment, options)
  add_customer_data(post, options)

  commit('authonly', post)
end

#capture(money, authorization, options = {}) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 55

def capture(money, authorization, options = {})
  post = {}
  post[:authorization] = authorization
  add_invoice(post, money, options)

  commit('capture', post)
end

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



35
36
37
38
39
40
41
42
43
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 35

def purchase(money, payment, options = {})
  post = {}
  add_invoice(post, money, options)
  add_payment(post, payment)
  add_address(post, payment, options)
  add_customer_data(post, options)

  commit('sale', post)
end

#refund(money, authorization, options = {}) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 63

def refund(money, authorization, options = {})
  post = {}
  post[:authorization] = authorization
  add_invoice(post, money, options)

  commit('refund', post)
end

#verify(credit_card, options = {}) ⇒ Object



78
79
80
81
82
83
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 78

def verify(credit_card, options = {})
  MultiResponse.run(:use_first_response) do |r|
    r.process { authorize(100, credit_card, options) }
    r.process(:ignore_result) { void(r.authorization, options) }
  end
end

#void(authorization, options = {}) ⇒ Object



71
72
73
74
75
76
# File 'lib/active_merchant/billing/gateways/bank_frick.rb', line 71

def void(authorization, options = {})
  post = {}
  post[:authorization] = authorization

  commit('void', post)
end