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::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
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
#add_field_to_post_if_present, #add_fields_to_post_if_present, card_brand, #card_brand, #generate_unique_id, inherited, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
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 |
# File 'lib/active_merchant/billing/gateways/viaklix.rb', line 51 def credit(money, creditcard, = {}) raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card' if creditcard.is_a?(String) 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 |