Paynow Not Posting Results to Server


#5

Which Paynow SDK are you using ? You are sending an email address as your “return url” , the error is Paynow saying it cant find the ULR to redirect the user to


#6

I am using python sdk. Not sure how paynow is picking up email when i have set return url and it is being printed correctly in the console


#7

That is not an email address but a subdomain url. As extracted by paynow, it however doesnt include the port and this may be the source of the problem as i need to usethe port on the development server.The result_url printed to my console includes the port number


#8

Hi

I am back with this error. The return url as depicted in the address bar on the image attached is correct. I receive emails from paynow for successful test payment but get the error depicted. If i strip the error url of everything which is paynow generated ie up just before http and try to return to my site it works which suggests there is nothing wrong with my implementation


#9

When you make a request to Paynow you are sending your “resulturl” and “returnurl” with url encoding. Paynow does not url decode and what you send is read as is

For the “resulturl” Paynow will attempt to do an Http POST to the url provided an since its url encoded it will fail

For the “returnurl” Paynow will attempt to redirect using the link provided , since the url is encoded when Paynow attempts to parse it reads it as an internal reference triggering the error.

url encoded link
https%3A%2F%2Fforums.paynow.co.zw%2F

normal link
https://forums.paynow.co.zw/


#10

Hi @Gondayi , it seems @Harvey is right, the urls are encoded when payment is initiated. The problem is the SDK itself not @paynow server as the SDK was urlencoding all values. However, I have managed to come up with a solution for this and I have created a pull request for the fix. The PR is here https://github.com/paynow/Paynow-Python-SDK/pull/12


Redirecting User after payment
#11

Thanks guys for the response. However, what I am using is not the official python sdk but the django example by charle k on github . Not sure if you can help with this.


#12

That project depends on the official paynow python SDK so it is affected by this issue


#13

Thanks guys for this. update url is working now. Just dealing with csrf induced failure on return url but all should be ok now


#14

You switched to the branch mentioned in the PR?


#15

Yes I did by editing the _init _ file to reflect your changes


#16

Hi guys. My django example is working as far as updating the payment status. It does this through both the paynow_return function and the paynow_update function. However the user is never returned to the return url in the browser when the paynow_return function returns. It looks like both functions run at the same time and all i get is the httpresponse ok when the paynow_update function returns. Could the python sdk be causing this.


#17

Please view this Pull Request https://github.com/paynow/Paynow-Python-SDK/pull/12

Still awaiting @paynow to merge the request


#18

i understand. In the meantime I have manually edited my paynow installation as per you suggestion when encoding was happening. everything works fine except that there seems to be a race between the return url and update resulting in the user only being returned to the update url with ok status


#19

did paynow merge yet?


#20

It’s still open. I’m sure @paynow can give more information


#21

Paynow server is not posting back to result_url. return_url works ok.


#22

How did you manage to do this


#23

was there any fix for this im still getting the same error


#25

Hie. Please help. I’m still having the same issue. I’m using django and the init.py file in the Paynow folder is showing the changes suggested by root above