在一家美国电子商务网站上,我正在寻找关于如何解决Paypal Orders API问题的意见。
示例
不含税的每盏灯的价格是$1547
一位顾客在购物篮里加了两盏这样的灯。
第三方服务将计算出这两盏灯的税额为274.59美元
含税的2盏灯的总价是2*1547 + 274.59 =3368.59美元
在使用Paypal付款时,我们需要将不同的金额发送到Paypal Orders API。
这就是税收问题发生的地方。贝宝想要的是“公关单位”,意思是274.59 /2=137.295美元
但贝宝只接受2位数:-( )
以下是如果允许使用3位数字,应如何发送订单:
"purchase_units": [{
"amount": {
"currency_code": "USD",
"value": "3368.59",
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": "3094"
},
"tax_total": {
"currency_code": "USD",
"value": "274.59"
}
}
},
"items": [{
"name": "Oval lamp",
"tax": {
"currency_code": "USD",
"value": "137.295"
},
"unit_amount": {
"currency_code": "USD",
"value": "1547"
},
"quantity": "2"
}
]]这将给我一个错误:
"details": [
{
"field": "/purchase_units/0item/0/tax/value",
"value": "137.295",
"issue": "DECIMAL_PRECISION",
"description": "If the currency supports decimals, only two decimal place precision is supported."
}
]如果我把税额从137.295美元减到137.30美元,我就会发现以下错误:
"details": [
{
"field": "/purchase_units/0/amount/breakdown/tax_total/value",
"value": "274.59",
"issue": "TAX_TOTAL_MISMATCH",
"description": "Should equal sum of (tax * quantity) across all items for a given purchase_unit"
}
]如果将总税额从274.59更新到274.6,则会出现以下错误:
"details": [
{
"field": "/purchase_units/0/amount/value",
"value": "3368.59",
"issue": "AMOUNT_MISMATCH",
"description": "Should equal item_total + tax_total + shipping + handling + insurance - shipping_discount - discount."
}
]我现在唯一的选择是将总额从3368.59美元改为3368.6美元,但这是不正确的!
如有任何意见,将不胜感激。
发布于 2020-07-21 15:54:18
这里没什么可说的--你的问题有解决办法。计算每个项目的税额,适当地上上下下,你就会有一个不同的税收总额。用那个。
如果要将订单总数调整为某些不同的计算,则需要添加另一个具有正数或负值的行项。
https://stackoverflow.com/questions/63008576
复制相似问题