lib/pesapal/oauth.rb in pesapal-1.2.0 vs lib/pesapal/oauth.rb in pesapal-1.2.1
- old
+ new
@@ -23,11 +23,11 @@
params.each do |k,v| queries.push "#{self.parameter_encode(k.to_s)}=#{self.parameter_encode(v.to_s)}" end
# parameters are sorted by name, using lexicographical byte value
# ordering
queries.sort!
-
+
queries.join('&')
end
# generate oauth nonce
def Oauth.generate_nonce(length)
@@ -55,11 +55,11 @@
# base64 encoded to produce the signature string.
# for pesapal flow we don't have a token secret to we will set as
# nil and the appropriate action will be taken as per the oauth
# spec. see notes in the method that creates signing keys
-
+
# prepare the values we need
digest = OpenSSL::Digest::Digest.new('sha1')
signature_base_string = self.generate_signature_base_string(http_method, absolute_url, params)
signing_key = self.generate_signing_key(consumer_secret, token_secret)
@@ -142,10 +142,10 @@
# the service provider should document the form of url used in the
# signature base string to avoid ambiguity due to url normalization.
# unless specified, url scheme and authority must be lowercase and
# include the port number; http default port 80 and https default
# port 443 must be excluded.
-
+
u = URI.parse(absolute_url)
scheme = u.scheme.downcase
host = u.host.downcase
path = u.path
\ No newline at end of file