| Class | ActiveMerchant::Billing::ViaklixGateway |
| In: |
lib/active_merchant/billing/gateways/viaklix.rb
|
| Parent: | Gateway |
| TEST_URL | = | 'https://demo.viaklix.com/process.asp' |
| LIVE_URL | = | 'https://www.viaklix.com/process.asp' |
| APPROVED | = | '0' |
Initialize the Gateway
The gateway requires that a valid login and password be passed in the options hash.
# File lib/active_merchant/billing/gateways/viaklix.rb, line 25
25: def initialize(options = {})
26: requires!(options, :login, :password)
27: @options = options
28: super
29: end
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
# File lib/active_merchant/billing/gateways/viaklix.rb, line 43
43: def credit(money, creditcard, options = {})
44: if creditcard.is_a?(String)
45: raise ArgumentError, "Reference credits are not supported. Please supply the original credit card"
46: end
47:
48: form = {}
49: add_invoice(form, options)
50: add_creditcard(form, creditcard)
51: add_address(form, options)
52: add_customer_data(form, options)
53: commit('CREDIT', money, form)
54: end
Make a purchase
# File lib/active_merchant/billing/gateways/viaklix.rb, line 32
32: def purchase(money, creditcard, options = {})
33: form = {}
34: add_invoice(form, options)
35: add_creditcard(form, creditcard)
36: add_address(form, options)
37: add_customer_data(form, options)
38: commit('SALE', money, form)
39: end