lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.80.0

- old
+ new

@@ -110,11 +110,11 @@ end private def split_authorization(authorization) - authorization.split(";") + authorization.split(';') end def add_reference(post, reference) reference, _, _ = split_authorization(reference) post[:Refnum] = reference @@ -132,11 +132,11 @@ end end def source_type_from(authorization) _, _, source_type = split_authorization(authorization) - (source_type || "credit_card").to_sym + (source_type || 'credit_card').to_sym end def add_source(post, source) if source.respond_to?(:brand) add_credit_card(post, source) @@ -292,14 +292,14 @@ cvv_result: response[:cvv_result_code] ) end def message_from(response) - if response[:status] == "Approved" - "Success" + if response[:status] == 'Approved' + 'Success' elsif response[:error].blank? - "Unspecified error" + 'Unspecified error' else response[:error] end end @@ -308,21 +308,21 @@ end def post_data(command, parameters = {}) initial_parameters = { Key: @options[:api_key], - Version: "4.5.4", + Version: '4.5.4', SoftwareName: 'Active Merchant', SoftwareVersion: "#{ActiveMerchant::VERSION}", Command: command, } seed = SecureRandom.hex(32).upcase hash = Digest::SHA1.hexdigest("#{initial_parameters[:command]}:#{@options[:pin]}:#{parameters[:amount]}:#{parameters[:invoice]}:#{seed}") initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank? parameters = initial_parameters.merge(parameters) - parameters.reject{|k, v| v.blank?}.collect{ |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join("&") + parameters.reject{|k, v| v.blank?}.collect{ |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&') end end end end