我正在我们的商店中实施PayPal智能按钮SDK。 通过javascript发送到https://www.sandbox.paypal.com/v2/checkout/orders的有效载荷如下:
{
"reference_id":"XYZ",
"description":"Fonts bought from hobo typefaces",
"custom_id":"XYZ",
"soft_descriptor":"Soft",
"redirect_urls":{
"return_url":"https://dev.hobo-typefaces.com/checkout",
"cancel_url":"https://dev.hobo-typefaces.com/cancel"
},
"amount":{
"currency_code":"EUR",
"total":"378.00",
"shipping":0,
"value":"360.00",
"tax":"18.00",
"breakdown":{
"item_total":{
"currency_code":"EUR",
"subtotal":"360.00",
"value":"360.00",
"total":"378.00",
"shipping":0,
"tax":"18.00"
}
}
},
"items":[
{
"name":"Rosart Regular",
"sku":"Rosart Regular",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart RegularItalic",
"sku":"Rosart RegularItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart MediumItalic",
"sku":"Rosart MediumItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart Medium",
"sku":"Rosart Medium",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart Semibold",
"sku":"Rosart Semibold",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart SemiboldItalic",
"sku":"Rosart SemiboldItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
}
]
}
当结帐流程正常运行时,税收被忽略,而贝宝计算出360欧元。不幸的是,我无法使用贝宝(Paypal)文档解决此问题。我不确定的地方是amount.value
,amount.total
和breakdown
数组中的那个。
我很感激能否帮助我忽略我的税收。
答案 0 :(得分:0)
您没有在purchase_units数组及其项目数组中传递有效的税收对象。
请参见此处的示例:https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/
有关API参考,请参见此处:https://developer.paypal.com/docs/api/orders/v2/#orders_create