php - PayPal 不再重定向到返回 URL

标签 php iframe paypal paypal-ipn

PayPal 支付完成后没有返回返回 URL 可能是什么问题?这仅适用于信用卡付款,一切都适用于直接 PP 付款。

我使用 iFrame 并收到已完成的付款消息“感谢您的付款”,但该消息位于 iFrame 中,我想在付款后刷新整个页面。所以在验证函数之后:

$verified = $ipn->verifyIPN();

我正在使用以下方法重定向到另一个页面: header (); 但它不适用于信用卡支付。

错误:

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.

我还在 PHP 脚本的末尾尝试了这个:

echo '<script type="text/javascript">window.top.location.href = "https://www.test.com";</script>';

最佳答案

仅当使用 PayPal 帐户付款时,PayPal 才会自动将您的买家重定向到您在按钮代码中指定的 URL。

正如他们网站上提到的 https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ2056&pmv=print&impressions=false&viewlocale=en_US , 此功能仅适用于成功完成后的 PayPal 支付。

如果您使用的是网站支付标准,也称为 PayPal 支付标准,我建议您传递变量名称“cbt”来自定义出现在重定向链接上的文本,以便那些使用信用卡/借记卡的买家付款)了解此链接。

您可以引用此链接以获取可以附加到按钮代码中的自定义变量列表:https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/

关于php - PayPal 不再重定向到返回 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43020950/

相关文章:

php - 在 Php 数组中搜索字符串并提取相邻文本

PHP/MySQL : how to display the words before and after the searched item

javascript - 将 css 应用于 google recaptcha 元素

javascript - 返回时 Internet Explorer 7 iframe 卸载

c# - 奇怪的 paypal api 问题

jquery - 删除文本框后,如何重新编号其余文本框的名称属性?

php - 防止复制使用 dompdf 创建的 pdf 中的内容

PHP/MySQL 获取表中每隔一行的问题/停止添加记录两次

javascript - 从 Iframe 获取值到 mainPage

php - 通过 PHP 的 PayPal API TransactionSearch