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

- old
+ new

@@ -37,16 +37,17 @@ # to the transaction after it's posted # # @return [Hash] parameters to be used in generating the oAuth 1.0 URL query parameters and the `oauth_signature` itself. def self.set_parameters(consumer_key, merchant_reference, transaction_tracking_id = nil) timestamp = Time.now.to_i.to_s - params = { oauth_consumer_key: consumer_key, - oauth_nonce: "#{timestamp}" + Pesapal::Oauth.generate_nonce(12), - oauth_signature_method: 'HMAC-SHA1', - oauth_timestamp: "#{timestamp}", - oauth_version: '1.0', - pesapal_merchant_reference: merchant_reference - } + params = { + oauth_consumer_key: consumer_key, + oauth_nonce: timestamp + Pesapal::Oauth.generate_nonce(12), + oauth_signature_method: 'HMAC-SHA1', + oauth_timestamp: timestamp, + oauth_version: '1.0', + pesapal_merchant_reference: merchant_reference + } params[:pesapal_transaction_tracking_id] = transaction_tracking_id unless transaction_tracking_id.nil? params end end end