Linda
Linda

Reputation: 109

User not being redirected to return url after payfast payment

I have added functionality to asp.net application such that the user can make payments for purchases. I have integrated my app with payfast , so the user gets redirected to payfast once they confirm their purchases on the checkout page. The problem I am having is that the user is not redirected to a success page once they are done on the payfast side. From what I understand the redirect is supposed to happen automatically from the payfast side. My notify page however is being hit and I am able to collect info on the transaction.

I am sending through the following parameters :

OpMode  =Test
amount  = 100.00
cancel_url= http://xxx.co.za/Checkout-Failure.aspx
confirmation_address    [email protected]
custom_int1 = 4569
custom_str1 = Payfast
email_address   [email protected]
email_confirmation  1
item_description    description
item_name   item name
m_payment_id    123456
merchant_id 113246546
merchant_key    1235dfg56v4
notify_url  http://xxx.co.za/Checkout-Notify.aspx
return_url= http://xxx.co.za/Checkout-Success.aspx

and in my notify page I am sending an http OK status code back to payfast

    Response.Clear()
    Response.StatusCode = HttpStatusCode.OK
    Response.End()

Please help, I am not sure what I am doing wrong everything seem to work except the user is not redirected to the return_url instead they are sent to this page https://sandbox.payfast.co.za/ . Thank you.

Upvotes: 0

Views: 2036

Answers (1)

SmartDev
SmartDev

Reputation: 2862

Remove this:

Response.Clear()
Response.StatusCode = HttpStatusCode.OK
Response.End()

There is no need to explicitly set the status code. If the notification page has no errors, then the default response code is: OK - status 200.

I suggest you use Fiddler and test the notification page.

Upvotes: 1

Related Questions