Class: ActiveMerchant::Billing::ViaklixGateway
- Defined in:
- lib/active_merchant/billing/gateways/viaklix.rb
Constant Summary collapse
- TEST_URL =
'https://demo.viaklix.com/process.asp'
- LIVE_URL =
'https://www.viaklix.com/process.asp'
- APPROVED =
'0'
Constants inherited from Gateway
Constants included from PostsData
PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT
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
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
included, #retry_exceptions, #ssl_post
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
25 26 27 28 29 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 25 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
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 43 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
32 33 34 35 36 37 38 39 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 32 def purchase(money, creditcard, = {}) form = {} add_invoice(form, ) add_creditcard(form, creditcard) add_address(form, ) add_customer_data(form, ) commit('SALE', money, form) end |