【发布时间】:2021-03-09 17:25:25
【问题描述】:
当用户单击我网站上的使用 Paypal 付款按钮时,结帐弹出窗口出现,除了总数之外没有其他信息。如果您单击顶部的购物车,那么您会看到交易的详细信息。许多用户不知道点击购物车。有没有办法默认显示此信息?
我在沙盒模式下使用 JavaScript SDK
示例代码:
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'pay',
},
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
var orderDescription = "TEST "
return actions.order.create({
intent: "CAPTURE",
purchase_units: [{
amount: {
currency_code: "CAD",
value: "150.00",
breakdown: {
item_total: {
currency_code: "CAD",
value: "150.00"
}
}
},
items: [
{
name: "Computer",
description: "The best item ever",
sku: "xyz-2654",
unit_amount: {
currency_code: "CAD",
value: "50.00"
},
quantity: "3"
},
]
}],
payee: {
email_address: "payee@gmail.com"
},
payee_display_metadata: {
brand_name: "name"
},
application_context: {
shipping_preference: "NO_SHIPPING",
business_name:"name",
"brand_name": "Name", // SHOWS ONLY on CANCEL AND RETURN TO brand_name
},
note_to_payer: "Contact us for any questions on your order.",
});
【问题讨论】:
标签: javascript paypal