lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.116.0
- old
+ new
@@ -258,10 +258,10 @@
oauth_signature_base_string = [method.to_s.upcase, request_uri.to_s, oauth_parameters.to_param].map { |v| CGI.escape(v) }.join('&')
oauth_signing_key = [@options[:consumer_secret], @options[:token_secret]].map { |v| CGI.escape(v) }.join('&')
hmac_signature = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), oauth_signing_key, oauth_signature_base_string)
# append signature to required OAuth parameters
- oauth_parameters[:oauth_signature] = CGI.escape(Base64.encode64(hmac_signature).chomp.gsub(/\n/, ''))
+ oauth_parameters[:oauth_signature] = CGI.escape(Base64.encode64(hmac_signature).chomp.delete("\n"))
# prepare Authorization header string
oauth_parameters = Hash[oauth_parameters.sort_by { |k, _| k }]
oauth_headers = ["OAuth realm=\"#{@options[:realm]}\""]
oauth_headers += oauth_parameters.map { |k, v| "#{k}=\"#{v}\"" }