Class: ActiveMerchant::Billing::FederatedCanadaGateway
- Defined in:
- lib/active_merchant/billing/gateways/federated_canada.rb
Constant Summary collapse
- URL =
Same URL for both test and live, testing is done by using the test username (demo) and password (password).
'https://secure.federatedgateway.com/api/transact.php'
Constants inherited from Gateway
Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#credit(money, identification, options = {}) ⇒ Object
also referred to as refund.
-
#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?
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ FederatedCanadaGateway
Returns a new instance of FederatedCanadaGateway.
23 24 25 26 27 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 23 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 38 def (money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) add_address(post, ) add_customer_data(post, ) commit('auth', money, post) end |
#capture(money, authorization, options = {}) ⇒ Object
47 48 49 50 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 47 def capture(money, , = {}) [:transactionid] = commit('capture', money, ) end |
#credit(money, identification, options = {}) ⇒ Object
also referred to as refund
52 53 54 55 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 52 def credit(money, identification, = {}) # also referred to as refund post = { :transactionid => identification} commit('refund', money, post) end |
#purchase(money, creditcard, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 29 def purchase(money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) add_address(post, ) add_customer_data(post, ) commit('sale', money, post) end |
#refund(money, authorization, options = {}) ⇒ Object
62 63 64 65 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 62 def refund(money, , = {}) [:transactionid] = commit('refund', money, ) end |
#void(authorization, options = {}) ⇒ Object
57 58 59 60 |
# File 'lib/active_merchant/billing/gateways/federated_canada.rb', line 57 def void(, = {}) [:transactionid] = commit('void', nil, ) end |