lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/cardknox.rb in activemerchant-1.116.0

- old
+ new

@@ -25,32 +25,32 @@ void: 'check:void', save: 'check:save' } } - def initialize(options={}) + def initialize(options = {}) requires!(options, :api_key) super end # There are three sources for doing a purchase transation: # - credit card # - check # - cardknox token, which is returned in the the authorization string "ref_num;token;command" - def purchase(amount, source, options={}) + def purchase(amount, source, options = {}) post = {} add_amount(post, amount, options) add_invoice(post, options) add_source(post, source) add_address(post, source, options) add_customer_data(post, options) add_custom_fields(post, options) commit(:purchase, source_type(source), post) end - def authorize(amount, source, options={}) + def authorize(amount, source, options = {}) post = {} add_amount(post, amount) add_invoice(post, options) add_source(post, source) add_address(post, source, options) @@ -64,11 +64,11 @@ add_reference(post, authorization) add_amount(post, amount) commit(:capture, source_type(authorization), post) end - def refund(amount, authorization, options={}) + def refund(amount, authorization, options = {}) post = {} add_reference(post, authorization) add_amount(post, amount) commit(:refund, source_type(authorization), post) end @@ -77,11 +77,11 @@ post = {} add_reference(post, authorization) commit(:void, source_type(authorization), post) end - def verify(credit_card, options={}) + def verify(credit_card, options = {}) MultiResponse.run(:use_first_response) do |r| r.process { authorize(100, credit_card, options) } r.process(:ignore_result) { void(r.authorization, options) } end end @@ -274,11 +274,11 @@ cvv_result_code: fields['xCvvResultCode'], remaining_balance: fields['xRemainingBalance'], amount: fields['xAuthAmount'], masked_card_num: fields['xMaskedCardNumber'], masked_account_number: fields['MaskedAccountNumber'] - }.delete_if { |k, v| v.nil? } + }.delete_if { |_k, v| v.nil? } end def commit(action, source_type, parameters) response = parse(ssl_post(live_url, post_data(COMMANDS[source_type][action], parameters))) @@ -318,10 +318,10 @@ 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