lib/active_merchant/billing/gateways/viaklix.rb in activemerchant-1.21.0 vs lib/active_merchant/billing/gateways/viaklix.rb in activemerchant-1.22.0

- old
+ new

@@ -41,10 +41,11 @@ form = {} add_invoice(form, options) add_creditcard(form, creditcard) add_address(form, options) add_customer_data(form, options) + add_test_mode(form, options) commit(:purchase, money, form) 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 @@ -56,14 +57,19 @@ form = {} add_invoice(form, options) add_creditcard(form, creditcard) add_address(form, options) add_customer_data(form, options) + add_test_mode(form, options) commit(:credit, money, form) end private + def add_test_mode(form, options) + form[:test_mode] = 'TRUE' if options[:test_mode] + end + def add_customer_data(form, options) form[:email] = options[:email].to_s.slice(0, 100) unless options[:email].blank? form[:customer_code] = options[:customer].to_s.slice(0, 10) unless options[:customer].blank? end @@ -127,11 +133,10 @@ def preamble result = { 'merchant_id' => @options[:login], 'pin' => @options[:password], 'show_form' => 'false', - 'test_mode' => test? ? 'TRUE' : 'FALSE', - 'result_format' => 'ASCII', + 'result_format' => 'ASCII' } result['user_id'] = @options[:user] unless @options[:user].blank? result end \ No newline at end of file