我们使用 Express Checkout 并希望根据结账时在 PayPal 上选择的送货地址计算税款。我们可以增加订单总额来计税,但税额始终记录为零。这是我们的流程:
我们SetExpressCheckout
将PAYMENTREQUEST_0_AMT
订单总额PAYMENTREQUEST_0_TAXAMT
设为零(或省略),以及MAXAMT
订单总额 + 最大可能税额。
在回调时,我们运行GetExpressCheckoutDetails
以查找送货地址。
如果有税,我们会DoExpressCheckoutPayment
以PAYMENTREQUEST_0_AMT
(订单总额 + 税)和PAYMENTREQUEST_0_TAXAMT
税的形式运行L_PAYMENTREQUEST_0_TAXAMT0
。
总订单按金额(订单总额 + 税金)处理,但PAYMENTINFO_0_TAXAMT
返回的始终为零。
是否需要传递其他字段才能正确应用税款?
设置:
METHOD: "SetExpressCheckout"
PAYMENTREQUEST_0_PAYMENTACTION: "SALE"
PAYMENTREQUEST_0_AMT: 1.00
PAYMENTREQUEST_0_ITEMAMT: 1.00
PAYMENTREQUEST_0_SHIPPINGAMT: 0
MAXAMT: 1.1
L_PAYMENTREQUEST_0_QTY0: 1
L_PAYMENTREQUEST_0_AMT0: 1.0
捕获:
METHOD: "DoExpressCheckoutPayment"
PAYMENTREQUEST_0_PAYMENTACTION: "SALE"
PAYMENTREQUEST_0_AMT: 1.1
PAYMENTREQUEST_0_ITEMAMT: 1.1
PAYMENTREQUEST_0_TAXAMT: 0.1
PAYMENTREQUEST_0_SHIPPINGAMT: 0
L_PAYMENTREQUEST_0_TAXAMT0: 0.1
L_PAYMENTREQUEST_0_AMT0: 1.0
结果:
ACK: "Success"
VERSION: "95"
BUILD: "7161310"
PAYMENTINFO_0_TRANSACTIONTYPE: "cart"
PAYMENTINFO_0_PAYMENTTYPE: "instant"
PAYMENTINFO_0_AMT: "1.10"
PAYMENTINFO_0_FEEAMT: "0.33"
PAYMENTINFO_0_TAXAMT: "0.00"
PAYMENTINFO_0_PAYMENTSTATUS: "Completed"