【发布时间】:2021-06-06 16:25:43
【问题描述】:
我是一名新的贝宝商家,并尝试在客户单击“使用贝宝付款”按钮后在结帐弹出窗口中显示一些信息。我在沙盒模式下使用 JavaScript SDK
这是一个数字购买,所以不需要运送——这在下面的代码中起作用
结帐弹出窗口中唯一显示的是总数、“Hi John”、Pay With 选项和 PAY NOW 按钮。
我希望它显示客户正在购买什么,以及我们的公司信息(姓名、电话号码)。
<script src="https://www.paypal.com/sdk/js?client-id=...">
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
var orderDescription = "ITEM YOU PURCHASED" // shows on payment history but not on payment pop-up
return actions.order.create({
intent: "CAPTURE",
purchase_units: [{
description: orderDescription,
amount: {
value: '0.26',
currency_code: "CAD"
}
}],
payee: {
email_address: "email"
},
payee_display_metadata: {
brand_name: "Company Name"
},
application_context: {
shipping_preference: "NO_SHIPPING",
business_name:"My Business Name",
},
note_to_payer: "Contact us at ... for any questions on your order.",
});
},
onApprove: function(data, actions) { .........
【问题讨论】:
-
点击购物车图标,上面写着 0.26 加元,查看购买详情。
-
不。单击或悬停在购物车上时没有详细信息。有效的项目是:价值、货币代码、应用程序上下文:品牌名称(在付款弹出窗口的底部显示“取消并返回...品牌名称...”),并且不发货。我删除了 orderDescription var 并将其替换为文本。还是什么都没有。
标签: paypal paypal-sandbox