|
Welcome,
Guest
|
|
|
I'm seeing this message when I try to make a request to either the sandbox or the live API.
Problem: signature_invalid | Advice: > |Here's an example of the URL I'm requesting: "https://demo.pesapal.com/api/PostPesapalDirectOrderV4?oauth_consumer_key=UJG8%2BrbTFnf2T9ZkP3Lb0Z3n4FQOXnrl&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1369151097&oauth_nonce=xMrjP6PrnZc1iP9sZbSdZUvrY1wJK9wE4GXqtMEuVo&oauth_version=1.0&oauth_signature=jywJjK6dd8q4fBpWp0CS89EOw6c%3D&oauth_callback=http://localhost:3000&pesapal_request_data=%3C?xml%20version=%221.0%22%20encoding=%22utf-8%22?%3E%0A%3CPesapalDirectOrderInfo%20xmlns:xsi=%22http://www.w3.org/2001/XMLSchemainstance%22%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema%22%20Amount=%2212.34%22%20Description=%22Bob%20Test%201%22%20Type=%22MERCHANT%22%20Reference=%22808%22%20FirstName=%22Bob%22%20LastName=%22Tester%22%20Email=%22b[email protected]%22%20xmlns=%22http://www.pesapal.com%22%20/%3E%0A"Can anyone see where I'm going wrong? This is driving me crazy! |
|
Last Edit: 12 years, 10 months ago by bodacious.
|
|
|
|
|
|
Hi,
The URL you have provided throws an error "Consumer key unknown". You are either using a consumer code for a demo merchant on the live API or vice versa. See these links on how to fix it: 1. developer.pesapal.com/forum/6-announceme...andbox-is-introduced 2. developer.pesapal.com/forum/2-pesapal-in...eyunknown--advice-g- Due to the above error, i was not able to replicate the "Problem: signature_invalid | Advice: > |" error. Would you provide a link to your application's form ? The URL generated by pesapal is timestamped hence giving the full URL as given before will result to errors. Generally, the Problem: signature_invalid | Advice: > |" error usually appears if your Oauth file generates an incorrect signature hence authentication fails. If possible try using a different Oauth version. Regards, Lazaro |
|
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it. |
|
Hi Lazro, thanks for your reply
I changed the comsumer key part of the URL I pasted in my question because I didn't want to expose it on an open Internet forum The rest of the URL is exactly the same though and, with the correct key I do get an invalid signature error. Does the URL format look valid to you? Which version of OAuth are you using? |
|
|
|
Hi Bodacious,
The URL format is correct. I have tested the URL on my PHP application and it has worked. We are using OAuth version 1.0 . Is it the same one that you are using? Regards, Lazaro |
|
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it. |
|
I'm using OAuth version 1.0
Here's a fresh URL generated by my code - I haven't changed anything this time. demo.pesapal.com/API/PostPesapalDirectOr...om%2522%2520%2F%253E You'll probably find that it's still returning the same error. Is there any way I can reset my consumer key and secret? Any other reasons you can think of that I might be generating the wrong signature code? |
|
|
|
Here are the default options for creating an OAuth Consumer with the Ruby lib that I'm using
Can I confirm that I should be using:
Thanks! |
|
|
|
Can you (or someone) please paste me an example of a valid URL so I can compare and make sure there are no issues?
Thanks |
|
|
|
I've fixed this problem now
The signature was invalid because the url params I was signing with were not all there. Here's my Ruby solution in case any other Ruby developers hit the same problem: |
|
Last Edit: 12 years, 10 months ago by bodacious.
|
|
Guys ... please have a look at this and even try it out if you have time.
https://gist.github.com/itsmrwave/6733866#file-readme-md |
|
|
|