[英]Paypal Smart Buttons digital goods
I'm using the Paypal Smart Buttons for reciving money to integrate in my digital platform.我正在使用 Paypal 智能按钮收款以集成到我的数字平台中。 I'm not selling a phisical goods, but a Service/Digital Good.
我卖的不是实物商品,而是服务/数字商品。
I have followed the tutorial from the Paypal website and by looking the Paypal web documentation i have created this order :我遵循了 Paypal 网站上的教程,并通过查看 Paypal 网络文档创建了此订单:
order = actions.order.create({
application_context: {
locale : "ITA",
shipping_preference:"NO_SHIPPING"
},
purchase_units: [{
description:"BLA BLA",
items:[
{
name: "BLA BLA",
category:"DIGITAL_GOODS",
quantity:"1",
unit_amount :{
currency_code:"EUR",
value : "5.00"
}
}
],
amount: {
currency_code: "EUR",
value: 5.00
}
}]
});
When i try it, i recive this error ( By Google Chrome Dev Tool Console )当我尝试时,我收到此错误(通过 Google Chrome 开发工具控制台)
POST https://www.sandbox.paypal.com/v2/checkout/orders 422 (Unprocessable Entity)
I have tryed to remove the item
parameter, by doing that i do not have any problem by paying, but i'm not sure that is right for my case, that i'm selling a Service/Digital Good.我已尝试删除
item
参数,这样做我付款没有任何问题,但我不确定这是否适合我的情况,我正在销售服务/数字商品。
Which is the right way to do it?哪个是正确的方法?
You should click to read the body of the 422 response in Dev Tools;您应该点击阅读 Dev Tools 中 422 响应的正文; it contains a message with full information about the problem.
它包含一条消息,其中包含有关该问题的完整信息。
You are missing an amount breakdown with an item_total
, which is required when passing line items.您缺少带有
item_total
的金额明细,这是传递行项目时所必需的。
See the documentation about this required parameter: https://developer.paypal.com/docs/api/orders/v2/#definition-item请参阅有关此必需参数的文档: https : //developer.paypal.com/docs/api/orders/v2/#definition-item
amount: {
currency_code: "USD",
value: '5.00',
breakdown: {
item_total: {
currency_code: "USD",
value: '5.00',
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.