Html 在 IFRAME 中嵌入 PayPal

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9464173/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 22:48:58  来源:igfitidea点击:

Embed PayPal in an IFRAME

htmliframepaypal

提问by Wesley Skeen

Is it possible to embed paypal in an IFRAME. I have tried to do this but it just came back a blank page as if there was nothing on it. I dont want to use adaptive payments. Is this possible?

是否可以在 IFRAME 中嵌入 paypal。我试过这样做,但它只是返回一个空白页,好像上面什么都没有。我不想使用自适应支付。这可能吗?

Thanks

谢谢

回答by Pekka

They are probablyprohibiting it by setting the X-FRAME-OPTIONSheader. It's a security measure and there is no way to work around it.

他们可能通过设置X-FRAME-OPTIONS标题来禁止它。这是一种安全措施,没有办法解决它。

If you have a payment running through PayPal, you can provide a "back to site" link - that's all you can do.

如果您通过 PayPal 进行付款,则可以提供“返回站点”链接 - 这就是您所能做的。

回答by SgtPooki

You can host PayPal in an iframe only with Adaptive Payments for Digital Goods / Express Checkout for Digital Goods (kind of), Hosted Solution (hosted Website Payments Pro, not currently available in the US), Payflow Pro, and Payflow Link.

您只能在 iframe 中托管 PayPal,其中包括数字商品的自适应支付/数字商品的快速结账(某种)、托管解决方案(托管的网站支付专业版,目前在美国不可用)、Payflow Pro 和 Payflow Link。

You cannot host Website Payments Standard checkout pages in iframes. As Pekka stated, PayPal does set the X-FRAME-OPTIONS header.

您不能在 iframe 中托管网站支付标准结帐页面。正如 Pekka 所说,PayPal 确实设置了 X-FRAME-OPTIONS 标头。

回答by Brian

No way to get around the same origin policy.

无法绕过同源策略。

A way around this is to create an anchor tag in the iframe:

解决这个问题的一种方法是在 iframe 中创建一个锚标记:

<a href="<?=$paypal_redirect?>" target="_blank">Continue Checking out</a>
or
<a href="<?=$paypal_redirect?>" target="_top">Continue Checking out</a>

The above will only allow the continuation of the checkout process in another tab/window; it will not process the checkout within your iframe.

以上仅允许在另一个选项卡/窗口中继续结帐过程;它不会在您的 iframe 中处理结帐。