Imad
Imad

Reputation: 7490

Paypal website payment standard not returning to return url from Sandbox test account

I am using Paypal Website Standard integration with Asp.Net and my problem is even after payment is successful, paypal is not returning me to my thank-you.aspx page. I have already set return-url in code as

sbForm.Append("<input type=\"hidden\" name=\"return\" value=\"" + successUrl + "\">");

means, I have created form mark-up using Code-Behind. Success url is absolute reachable (I can copy url and paste in browser, it works). I have my sand-box settings as below:

  1. Profile -> Selling Tools
  2. Under Selling Online -> Website Payment Preferences
  3. Auto Return: On
  4. Return URL: http://mywebsite/thank-you.aspx
  5. Payment Data Transfer: Off
  6. PayPal Account Optional:On
  7. Contact Telephone:Off (PayPal recommends this option)
  8. Support giropay and bank transfer payments:No

However it return to cancel page without fail if I cancel payment.

Edit Taking reference if this, I set PayPal Account Optional:Off but no luck.

Edit When I click the link after payment success message on Paypal's success page, I can go back and debug but it not returning any QueryString with the key name tx which results always Fail\n response.

Upvotes: 1

Views: 1539

Answers (2)

Imad
Imad

Reputation: 7490

Turned Payment Data Transfer On and get it worked

Upvotes: 0

Drew Angell
Drew Angell

Reputation: 26056

With Payments Standard, enabling auto-return with a return URL should redirect, but it can sometimes take up to 10 seconds or so for the redirection to happen. That's why there is no guarantee users will make it to your thank you page even when it's all configured and working well.

If you need to ensure users end up at your site and there's no chance they wouldn't reach your thank you page then you'll want to use the Express Checkout API instead of Payments Standard.

The Express Checkout flow doesn't get completed until the user is back at your site (where you make the final API call) so you can rest assured you'll always end up on your thank you page.

Even still, if you're trying to automate procedures like updating your database, sending email notifications, etc. you'll want to use Instant Payment Notification (IPN).

IPN's are triggered instantly, so you can automate procedures in real-time. It also allows you to handle things like pending payments that have cleared (which you wouldn't want to deliver or ship right away), disputes, refunds, etc.

Upvotes: 1

Related Questions