lib/pesapal/helper/post.rb in pesapal-1.8.0 vs lib/pesapal/helper/post.rb in pesapal-2.0.0

- old
+ new

@@ -161,14 +161,16 @@ # @param post_xml [String] encoded XML formated order data. Generated by {generate_post_xml} # # @return [Hash] parameters to be used in generating the oAuth 1.0 URL query parameters and the `oauth_signature` itself. def self.set_parameters(callback_url, consumer_key, post_xml) timestamp = Time.now.to_i.to_s - { oauth_callback: callback_url, + + { + oauth_callback: callback_url, oauth_consumer_key: consumer_key, - oauth_nonce: "#{timestamp}" + Pesapal::Oauth.generate_nonce(12), + oauth_nonce: timestamp + Pesapal::Oauth.generate_nonce(12), oauth_signature_method: 'HMAC-SHA1', - oauth_timestamp: "#{timestamp}", + oauth_timestamp: timestamp, oauth_version: '1.0', pesapal_request_data: post_xml } end end