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

- old
+ new

@@ -147,11 +147,11 @@ end # Verify and reserve the specified amount on the account, without actually doing the transaction. def authorize(money, payment_source, options = {}) post = {} - action = (payment_source.brand == 'mastercard') ? 'PAU' : 'RES' + action = payment_source.brand == 'mastercard' ? 'PAU' : 'RES' add_invoice(post, options) add_payment_source(post, payment_source, options) add_address(post, payment_source, options) add_customer_data(post, options) add_money(post, money, options) @@ -211,11 +211,11 @@ end end # Store a credit card by creating an Ogone Alias def store(payment_source, options = {}) - options.merge!(:alias_operation => 'BYPSP') unless(options.has_key?(:billing_id) || options.has_key?(:store)) + options[:alias_operation] = 'BYPSP' unless(options.has_key?(:billing_id) || options.has_key?(:store)) response = authorize(@options[:store_amount] || 1, payment_source, options) void(response.authorization) if response.success? response end @@ -299,12 +299,12 @@ def add_eci(post, eci) add_pair post, 'ECI', eci.to_s end - def add_alias(post, _alias, alias_operation = nil) - add_pair post, 'ALIAS', _alias + def add_alias(post, alias_name, alias_operation = nil) + add_pair post, 'ALIAS', alias_name add_pair post, 'ALIASOPERATION', alias_operation unless alias_operation.nil? end def add_authorization(post, authorization) add_pair post, 'PAYID', authorization @@ -427,13 +427,13 @@ Digest::SHA1 else raise "Unknown signature algorithm #{algorithm}" end - filtered_params = signed_parameters.select{|k,v| !v.blank?} + filtered_params = signed_parameters.select { |k, v| !v.blank? } sha_encryptor.hexdigest( - filtered_params.sort_by{|k,v| k.upcase}.map{|k, v| "#{k.upcase}=#{v}#{secret}"}.join('') + filtered_params.sort_by { |k, v| k.upcase }.map { |k, v| "#{k.upcase}=#{v}#{secret}" }.join('') ).upcase end def legacy_calculate_signature(parameters, secret) Digest::SHA1.hexdigest( @@ -444,10 +444,10 @@ currency CARDNO PSPID Operation ALIAS - ).map{|key| parameters[key]} + + ).map { |key| parameters[key] } + [secret] ).join('') ).upcase end