Class: ActiveMerchant::Billing::ViaklixGateway
- Defined in:
- lib/active_merchant/billing/gateways/viaklix.rb
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?, #test?
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 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 33 def initialize( = {}) requires!(, :login, :password) 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 63 |
# 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, ) add_test_mode(form, ) commit(:credit, money, form) end |
#purchase(money, creditcard, options = {}) ⇒ Object
Make a purchase
39 40 41 42 43 44 45 46 47 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 39 def purchase(money, creditcard, = {}) form = {} add_invoice(form, ) add_creditcard(form, creditcard) add_address(form, ) add_customer_data(form, ) add_test_mode(form, ) commit(:purchase, money, form) end |