【问题标题】:How to customize PayPal button using script?如何使用脚本自定义 PayPal 按钮?
【发布时间】:2021-04-29 04:57:47
【问题描述】:

我是 PayPal 集成和设置的新手,并尝试在以下脚本中自定义 PayPal 按钮。

<script src="https://www.paypal.com/sdk/js?client-id=sb"> // Required. Replace SB_CLIENT_ID with your sandbox client ID.
</script>
<div id="paypal-button-container"></div>
<script>
    paypal.Buttons({
        style: {
            layout: 'horizontal',
            color: 'gold',
            shape: 'pill',
            label: 'paypal'
        },
        createOrder: function (data, actions) {
            // This function sets up the details of the transaction, including the amount and line item details.
            return actions.order.create({
                purchase_units: [{
                    amount: {
                        value: '0.01'
                    }
                }]
            });
        }
    }).render('#paypal-button-container');
</script>

在他们的文档中,在按钮中发短信之前有一个 PayPal 图标,我没有收到,所以请您指导我为什么没有收到它。

以上代码的输出

https://developer.paypal.com/docs/checkout/integration-features/customize-button/#layout

【问题讨论】:

标签: html paypal


【解决方案1】:

在他们的文档中,在按钮中发短信之前有一个 PayPal 图标,我没有收到,所以请您指导我为什么没有收到它。

文档已过期。几个月前,第一个按钮 (PayPal) 不再包含徽标。

您看到的是当前正确的行为。

【讨论】:

    猜你喜欢
    • 2017-11-14
    • 2017-04-23
    • 2018-06-18
    • 1970-01-01
    • 2018-03-09
    • 2013-05-30
    • 2014-08-03
    • 2011-10-13
    • 2016-08-05
    相关资源
    最近更新 更多