lib/active_merchant/billing/gateways/ogone.rb in activemerchant-1.101.0 vs lib/active_merchant/billing/gateways/ogone.rb in activemerchant-1.102.0

- old
+ new

@@ -289,11 +289,11 @@ add_pair post, 'HTTP_USER_AGENT', options[:http_user_agent] if options[:http_user_agent] add_pair post, 'ACCEPTURL', options[:accept_url] if options[:accept_url] add_pair post, 'DECLINEURL', options[:decline_url] if options[:decline_url] add_pair post, 'EXCEPTIONURL', options[:exception_url] if options[:exception_url] add_pair post, 'CANCELURL', options[:cancel_url] if options[:cancel_url] - add_pair post, 'PARAMVAR', options[:paramvar] if options[:paramvar] + add_pair post, 'PARAMVAR', options[:paramvar] if options[:paramvar] add_pair post, 'PARAMPLUS', options[:paramplus] if options[:paramplus] add_pair post, 'COMPLUS', options[:complus] if options[:complus] add_pair post, 'LANGUAGE', options[:language] if options[:language] end @@ -416,19 +416,20 @@ end def calculate_signature(signed_parameters, algorithm, secret) return legacy_calculate_signature(signed_parameters, secret) unless algorithm - sha_encryptor = case algorithm - when 'sha256' - Digest::SHA256 - when 'sha512' - Digest::SHA512 - when 'sha1' - Digest::SHA1 - else - raise "Unknown signature algorithm #{algorithm}" - end + sha_encryptor = + case algorithm + when 'sha256' + Digest::SHA256 + when 'sha512' + Digest::SHA512 + when 'sha1' + Digest::SHA1 + else + raise "Unknown signature algorithm #{algorithm}" + end 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('') ).upcase