Class: ActiveMerchant::Billing::ViaklixGateway
- Defined in:
- lib/active_merchant/billing/gateways/viaklix.rb
Direct Known Subclasses
Constant Summary collapse
- APPROVED =
'0'
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#credit(money, creditcard, options = {}) ⇒ Object
Make a credit to a card (Void can only be done from the virtual terminal) Viaklix does not support credits by reference.
-
#initialize(options = {}) ⇒ ViaklixGateway
constructor
Initialize the Gateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
Make a purchase.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ ViaklixGateway
Initialize the Gateway
The gateway requires that a valid login and password be passed in the options
hash.
Options
-
:login
– Merchant ID -
:password
– PIN -
:user
– Specify a subuser of the account (optional) -
:test => true or false
– Force test transactions
33 34 35 36 37 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 33 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#credit(money, creditcard, options = {}) ⇒ Object
Make a credit to a card (Void can only be done from the virtual terminal) Viaklix does not support credits by reference. You must pass in the credit card
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 51 def credit(money, creditcard, = {}) if creditcard.is_a?(String) raise ArgumentError, "Reference credits are not supported. Please supply the original credit card" end form = {} add_invoice(form, ) add_creditcard(form, creditcard) add_address(form, ) add_customer_data(form, ) commit(:credit, money, form) end |
#purchase(money, creditcard, options = {}) ⇒ Object
Make a purchase
40 41 42 43 44 45 46 47 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 40 def purchase(money, creditcard, = {}) form = {} add_invoice(form, ) add_creditcard(form, creditcard) add_address(form, ) add_customer_data(form, ) commit(:purchase, money, form) end |