0
votes

What could be the problem that PayPal doesn't send me back to return URL after payment is completed? This stopped to work only on payments by credit card, everything is working with direct PP payment.

I use an iFrame and I get the completed payment message "Thank you for your payment", but the message is in iFrame and I want to refresh the whole page after the payment. So after the verification function:

$verified = $ipn->verifyIPN();

I am redirecting to another page using: header(); But it's not working on credit card payments.

Error:

Invalid 'X-Frame-Options' header encountered when loading 'https://www.paypal.com/hostedpaymentnodeweb/payWithCC': 'ALLOW' is not a recognized directive. The header will be ignored.

Also I tried this at the end of the PHP script:

echo '<script type="text/javascript">window.top.location.href = "https://www.test.com";</script>';
1
I'm confused. You're talking about returning to the return URL you provide, but that has nothing to do with IPN. IPN is server-to-server communication and it does not take place in the browser. If you're trying to send data back to your return URL you would need to be working with PDT. If that's what you're doing and you're working with an IPN script that could very well be the root of your issues. - Drew Angell
Well, yes, IPN doesn't do anything in the browser, but usually after the payment is completed, PayPal redirects to the redirect URL provided in the parameters, but now it does nothing. And it does the redirect perfectly if I use the PayPal transaction, problem occurs only on credit card payment. - The50
So you have PDT and Auto-Return enabled in the PayPal account profile? - Drew Angell
I would recommend you use the Express Checkout APIs instead of PayPal Standard. This way the user will always end up back at your site regardless of any auto-return settings or what type of payment method they choose during checkout. - Drew Angell
Yes, the way Express Checkout works the final payment call doesn't even until you're already back to your ReturnURL. - Drew Angell

1 Answers

3
votes

PayPal will redirect your buyer automatically to the URL that you have specify in your button code only when the payment made using PayPal account.

As mention from their site https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ2056&pmv=print&impressions=false&viewlocale=en_US , this feature available only for PayPal payment upon successful completion.

If you're using Website payment standard also known as PayPal payment standard, I suggest you to pass variable name 'cbt' to customize the text that appear on redirection link so that those buyers (who're using credit/debit card payment) aware of this link.

You may refer to this link for list of custom variable that you can attach in your button code : https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/