X-Frame-Options 禁止重定向到 PayPal

发布于 2024-12-02 18:03:29 字数 631 浏览 0 评论 0原文

我的支付系统不会重定向到 paypal,因为出现以下错误:“由于 X-Frame-Options 禁止显示,因此拒绝显示文档。”表单已发布并创建了正确的重定向 url,但 paypal 查询没有返回响应:

这会正确重定向到下一个查询: https://www.sandbox.paypal.com/webscr&cmd=_express-checkout& token=xxx

这显示没有响应: https://www.sandbox.paypal.com/ us/cgi-bin/webscr?cmd=_flow&SESSION=xxx&dispatch=xxx

如果我将第一个查询剪切并粘贴到浏览器中,它会在运行时重定向到 paypal然而,从应用程序(在 Chrome 中),我收到 X-Frame-Options 错误。 (或者在 Firefox 中,什么也没有)

I've got a payment system that won't redirect to paypal because of the error: "Refused to display document because display forbidden by X-Frame-Options." The form is posted and the proper redirect url is made, but there is no response returned from the paypal queries:

This redirects properly to the next query:
https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=xxx

This shows no response:
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=xxx&dispatch=xxx

If I cut and paste the first query into the browser, it redirects to paypal, when running from the application (in Chrome) however, I get the X-Frame-Options error. (or in Firefox, nothing)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

一梦浮鱼 2024-12-09 18:03:29

这意味着 Paypal 不允许您在 iframe 中使用 Paypal。您不应该在 iframe 中使用 Payapl。

This means that Paypal doesn't allow you to use Paypal in an iframe. You should not use Payapl in an iframe.

眸中客 2024-12-09 18:03:29

我在 Sandbox 中遇到了同样的问题,我发现在删除所有 *.paypal.com cookie 后它已修复。

I am getting the same issue with Sandbox and I found that it fixed after I remove all *.paypal.com cookies.

孤星 2024-12-09 18:03:29

只需添加: target="_blank" 即可

Just add: target="_blank" to form

暗恋未遂 2024-12-09 18:03:29

就我而言,环境名称 [sandbox/product] 与 clientId 不匹配

In my case, it was mismatching environment name [sandbox/production] with clientId

冷情 2024-12-09 18:03:29

如果您想在 iFrame 中运行快速结帐,请参阅用于快速结帐的数字商品:https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_IntroducingExpressCheckoutDG

您需要在沙盒中将其打开在您可以使用之前,请先由 PayPal 技术团队检查。

If you want to run Express Checkout in an iFrame, see Digital Goods for Express Checkout: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_IntroducingExpressCheckoutDG

You'll need to have it turned on in the sandbox by PayPal's Tech team before you can use it.

审判长 2024-12-09 18:03:29

我目前正在与贝宝合作。一开始你可能会想“嘿!好多医生!!耶!”,但实际上很糟糕。大量的文档假设您已经知道自己在寻找什么。尝试以下 JS 代码(您应该已经调用了 setExpressCheckout 方法并拥有令牌):

$(document).ready(function() {
    //asynchronously fetch paypal's javascript
    jQuery.getScript('https://www.paypalobjects.com/js/external/dg.js', function(){console.debug("javascript loaded");});
});

//the handler that opens the iframe should be the following. This code assumes token variable has already been initalized
var dg = new PAYPAL.apps.DGFlow({trigger:null, expType:"light"});
dg.startFlow('https://www.sandbox.paypal.com/incontext?token=' +token);

我这里唯一需要的是用于测试(沙箱环境)的 F***NG 正确 URL。

顺便说一下,在测试之前请确保您已登录沙盒帐户;)

I'm currently working with paypal. You could, at first, think "Hey! tons of doc!! yay!", but it actually SUCKS. Tons of doc that assume you already know what you're looking for. Try the following JS code (you should have already invoked setExpressCheckout method and have a token):

$(document).ready(function() {
    //asynchronously fetch paypal's javascript
    jQuery.getScript('https://www.paypalobjects.com/js/external/dg.js', function(){console.debug("javascript loaded");});
});

//the handler that opens the iframe should be the following. This code assumes token variable has already been initalized
var dg = new PAYPAL.apps.DGFlow({trigger:null, expType:"light"});
dg.startFlow('https://www.sandbox.paypal.com/incontext?token=' +token);

The only thing I needed here whas the F***NG correct URL to use for testing (sandbox environment).

By the way, make sure you are logged in into your sandbox account before testing ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文