lib/pesapal/merchant/post.rb in pesapal-1.2.0 vs lib/pesapal/merchant/post.rb in pesapal-1.2.1

- old
+ new

@@ -2,11 +2,11 @@ module Post # build html encoded xml string for PostPesapalDirectOrderV4 def Post.generate_post_xml(details) - + # build xml with input data, the format is standard so no editing is # required post_xml = '' post_xml.concat '<?xml version="1.0" encoding="utf-8"?>' post_xml.concat '<PesapalDirectOrderInfo ' @@ -26,17 +26,17 @@ encoder = HTMLEntities.new(:xhtml1) post_xml = encoder.encode post_xml "#{post_xml}" end - + # set parameters required by the PostPesapalDirectOrderV4 call def Post.set_parameters(callback_url, consumer_key, post_xml) # parameters required by the PostPesapalDirectOrderV4 call (excludes # oauth_signature parameter as per the instructions here # http://developer.pesapal.com/how-to-integrate/api-reference#PostPesapalDirectOrderV4) - + timestamp = Time.now.to_i.to_s params = { :oauth_callback => callback_url, :oauth_consumer_key => consumer_key, :oauth_nonce => "#{timestamp}" + Pesapal::Oauth.generate_nonce(12), \ No newline at end of file