【发布时间】: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
【问题讨论】:
-
是的,因为他们删除了第一个按钮的图标,您可以查看示例站点。 developer.paypal.com/demo/checkout/#/pattern/client 如果您想更改图标或自定义更多内容,您可以使用 css。