Paynow Not Posting Results to Server


#1

Is it just me or @paynow site runs into an error when transaction is cancelled and fails to post results to result_url.


#2

Care to share more details ie how was the request generated and how/why it was cancelled. Could you provide enough details so I can attempt to replicate the error (Kind reminder dont provide integration keys I will use my own to test)


#3

I am getting a similar error on development server upon confirming payment. …https://www.paynow.co.zw/Home/Error?aspxerrorpath=/Payment/ConfirmPayment/http:/radch.example.com:8001/payment/done/. I notice the second forward slash is missing from the error path. The test payment is however successful since i recieve an email status message. the result url is printed coorectly on the console ie http://radch.example.com:8001/payment/done


#4

Can you send a direct message with just your integration ID no keys please


#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