You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PayPal JavaScript SDK信用卡/借记卡支付按钮在iOS 12.5.7系统无法加载的问题求助

PayPal JavaScript SDK信用卡/借记卡支付按钮在iOS 12.5.7系统无法加载的问题求助

我做了一个基础的PayPal测试框架,主要用来加载两个支付选项按钮:PayPal支付和信用卡/借记卡支付。目前在绝大多数测试设备上都能正常工作,唯独在运行iOS 12.5.7的iPad Air上出现异常(这是该设备能安装的最新系统版本),而搭载iOS 18的新款iPhone则完全没问题。

具体问题表现:

  • 点击「信用卡/借记卡支付」按钮时,会先显示加载的转圈 spinner,但随后加载失败
  • 控制台日志抛出两个错误:Unexpected token "?" 和 Reference error cannot find variable Zombo
  • 点击「PayPal支付」按钮则完全正常,仅信用卡/借记卡选项失效

补充测试情况:

  • MacBook上的Safari浏览器测试正常
  • Windows系统下的各类浏览器(Chrome、Edge等)也都能正常运行

我翻遍了相关资料都没找到对应的解决方案,自己也尝试了不少方法,但都没有效果。想问问有没有可行的绕过方案?

以下是我的测试代码:

<!-- PayPal SDK with 'components' parameter to show Credit/Debit option -->
<script src='https://www.paypal.com/sdk/js?client-id=12345&components=buttons&currency=CAD'></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

<!-- Container for PayPal button -->
<div id="paypal_container"></div>

<script type="text/javascript"> 
$(function() {
    // Define the PayPal button with integrated Credit/Debit card option
    paypal.Buttons({
        style: {
            shape: 'rect',
            color: 'gold',
            layout: 'vertical',
            label: 'pay', // This label will be shown on the button
        },
        createOrder: function (data, actions) {
            // Set up the order details here (amount, currency, etc.)
            return actions.order.create({
                intent: "CAPTURE",
                purchase_units: [{
                    amount: {
                        currency_code: "CAD",
                        value: "100.00" // Replace with your actual value
                    }
                }]
            });
        },
        onApprove: function (data, actions) {
            // Capture the payment when the user approves it
            return actions.order.capture().then(function (details) {
                alert("Payment successful! Thank you, " + details.payer.name.given_name);
            });
        },
        onError: function (err) {
            // Handle any errors during the payment process
            console.error("Payment error:", err);
            alert("There was an issue processing your payment.");
        }
    }).render('#paypal_container'); // Render the button inside the container div
});
</script>

备注:内容来源于stack exchange,提问作者Paul Flahr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 03:18:00