lib/active_merchant/billing/gateways/ct_payment.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/ct_payment.rb in activemerchant-1.87.0

- old
+ new

@@ -116,11 +116,11 @@ def verify(credit_card, options={}) requires!(options, :order_id) post = {} add_terminal_number(post, options) add_operator_id(post, options) - add_invoice(post,0, options) + add_invoice(post, 0, options) add_payment(post, credit_card) add_address(post, credit_card, options) add_customer_data(post, options) commit('verifyAccount', post) @@ -157,11 +157,11 @@ def add_terminal_number(post, options) post[:MerchantTerminalNumber] = options[:merchant_terminal_number] || ' ' * 5 end def add_money(post, money) - post[:Amount] = money.to_s.rjust(11,'0') + post[:Amount] = money.to_s.rjust(11, '0') end def add_operator_id(post, options) post[:OperatorID] = options[:operator_id] || '0' * 8 end @@ -177,21 +177,21 @@ end end def add_invoice(post, money, options) post[:CurrencyCode] = options[:currency] || (currency(money) if money) - post[:InvoiceNumber] = options[:order_id].rjust(12,'0') + post[:InvoiceNumber] = options[:order_id].rjust(12, '0') post[:InputType] = 'I' post[:LanguageCode] = 'E' end def add_payment(post, payment) if payment.is_a?(String) post[:Token] = split_authorization(payment)[3].strip else post[:CardType] = CARD_BRAND[payment.brand] || ' ' - post[:CardNumber] = payment.number.rjust(40,' ') + post[:CardNumber] = payment.number.rjust(40, ' ') post[:ExpirationDate] = expdate(payment) post[:Cvv2Cvc2Number] = payment.verification_value end end @@ -222,11 +222,11 @@ def commit(action, parameters) if action == 'void' commit_raw(action, parameters) else MultiResponse.run(true) do |r| - r.process { commit_raw(action, parameters)} + r.process { commit_raw(action, parameters) } r.process { split_auth = split_authorization(r.authorization) auth = (action.include?('recur')? split_auth[4] : split_auth[0]) action.include?('recur') ? commit_raw('recur/ack', {ID: auth}) : commit_raw('ack', {TransactionNumber: auth}) } @@ -252,10 +252,10 @@ def post_data(action, parameters = {}) parameters[:CompanyNumber] = @options[:company_number] parameters[:MerchantNumber] = @options[:merchant_number] parameters = parameters.collect do |key, value| - "#{key}=#{value}" unless (value.nil? || value.empty?) + "#{key}=#{value}" unless value.nil? || value.empty? end.join('&') payload = Base64.strict_encode64(parameters) "auth-api-key=#{@options[:api_key]}&payload=#{payload}".strip end