【发布时间】:2021-05-18 10:06:42
【问题描述】:
我正在为我的付款页面使用最新版本的 PayPal JavaScript SDK(而不是已弃用的 checkout.js)以及 智能按钮。当 PayPal 在底部显示信用卡/借记卡数据输入表单时,我希望它显示 'Pay Now' 而不是 'Buy Now',我该怎么做那个?
我followed this example,但它只更改了'Pay with PayPal'和“信用卡/借记卡”按钮的主按钮,但蓝色的“立即购买”仍然显示在下方形式:
paypal.Buttons({
style: {
layout: 'vertical',
color: 'gold',
shape: 'rect',
label: 'pay' // I changed to 'pay' instead
}
}).render('#paypal-button-container');
我什至follow this guide 将commit=true 参数添加到SDK 但没有运气:
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&commit=true"></script>
以下是我的完整代码,以备不时之需:
paypal.Buttons({
style: {
layout: 'vertical',
color: 'gold',
shape: 'rect',
label: "pay"
},
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: {
currency_code: "MYR",
value: "1.00"
}
}],
application_context: {
shipping_preference: "NO_SHIPPING"
}
});
},
onApprove: function (data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture()
.then(function (details) {
// This function shows a transaction success message to your buyer.
alert('Transaction completed by ' + details.payer.name.given_name);
});
}
}).render('#gPayContainer');
//This function displays Smart Payment Buttons on your web page.
任何建议将不胜感激,谢谢!
【问题讨论】:
-
" 但表格下方仍显示蓝色的“立即购买”:" -- 你是什么意思?
-
我希望蓝色的“立即购买”按钮更改为“立即付款”。
-
哪个蓝色的“立即购买”按钮? .......
-
我已经在我的问题中解释过,就在信用卡数据输入表单的下方。
-
一切都说立即付款。但是,如果您说的是扩展借记卡或信用卡表单中的“立即付款”按钮,则无论如何都无法更改它。它总是会说任何语言环境翻译为立即付款的内容。
标签: javascript paypal