Class: ActiveMerchant::Billing::FederatedCanadaGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::FederatedCanadaGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/federated_canada.rb
Constant Summary
Constants inherited
from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
#options
Instance Method Summary
collapse
-
#authorize(money, creditcard, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
-
#credit(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ FederatedCanadaGateway
constructor
A new instance of FederatedCanadaGateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
-
#refund(money, authorization, options = {}) ⇒ Object
-
#void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
#format
Constructor Details
Returns a new instance of FederatedCanadaGateway.
23
24
25
26
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 23
def initialize(options = {})
requires!(options, :login, :password)
super
end
|
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
37
38
39
40
41
42
43
44
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 37
def authorize(money, creditcard, options = {})
post = {}
add_invoice(post, options)
add_creditcard(post, creditcard)
add_address(post, options)
add_customer_data(post, options)
commit('auth', money, post)
end
|
#capture(money, authorization, options = {}) ⇒ Object
46
47
48
49
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 46
def capture(money, authorization, options = {})
options[:transactionid] = authorization
commit('capture', money, options)
end
|
#credit(money, authorization, options = {}) ⇒ Object
60
61
62
63
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 60
def credit(money, authorization, options = {})
deprecated CREDIT_DEPRECATION_MESSAGE
refund(money, authorization, options)
end
|
#purchase(money, creditcard, options = {}) ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 28
def purchase(money, creditcard, options = {})
post = {}
add_invoice(post, options)
add_creditcard(post, creditcard)
add_address(post, options)
add_customer_data(post, options)
commit('sale', money, post)
end
|
#refund(money, authorization, options = {}) ⇒ Object
56
57
58
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 56
def refund(money, authorization, options = {})
commit('refund', money, options.merge(:transactionid => authorization))
end
|
#void(authorization, options = {}) ⇒ Object
51
52
53
54
|
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 51
def void(authorization, options = {})
options[:transactionid] = authorization
commit('void', nil, options)
end
|