PayPal SetExpressCheckout错误

时间:2013-06-09 22:45:41

标签: php paypal

我在PayPal遇到SetExpressCheckout的问题。我正在尝试使用价格为11.96欧元(含增值税21%)的商品设置新的快速结账。但是,PayPal表示购物车中的金额与订单不符。这是请求:

[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[SOLUTIONTYPE] => Mark
[PAYMENTREQUEST_0_AMT] => 11.96
[PAYMENTREQUEST_0_ITEMAMT] => 9.88
[PAYMENTREQUEST_0_TAXAMT] => 2.08
[L_BILLINGTYPE0] => MerchantInitiatedBillingSingleAgreement
[BILLINGTYPE] => MerchantInitiatedBillingSingleAgreement
[L_BILLINGAGREEMENTDESCRIPTION0] => Some description here
[L_PAYMENTREQUEST_0_ITEMAMT0] => 9.88
[L_PAYMENTREQUEST_0_NAME0] => 011213
[L_PAYMENTREQUEST_0_DESC0] => Description here
[L_PAYMENTREQUEST_0_NUMBER0] => 1
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_TAXAMT0] => 2.08
[L_PAYMENTTYPE0] => ANY

然后这是来自PayPal的回复:

[ACK] => Failure
[VERSION] => 72.0
[L_ERRORCODE0] => 10413
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts.
[L_SEVERITYCODE0] => Error

我在这里遗漏了什么吗?我很感激你的帮助。

谢谢!

1 个答案:

答案 0 :(得分:2)

我已通过以下请求解决了我的问题:

[METHOD] => SetExpressCheckout
[NOSHIPPING] => 1
[ALLOWNOTE] => 1
[LOCALECODE] => IT
[PAYMENTACTION] => Sale
[CHANNELTYPE] => Merchant
[REQCONFIRMSHIPPING] => 0
[CALLBACKVERSION] => 72.0
[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[SOLUTIONTYPE] => Sole
[PAYMENTREQUEST_0_AMT] => 14.33
[PAYMENTREQUEST_0_ITEMAMT] => 11.84
[PAYMENTREQUEST_0_TAXAMT] => 2.49
[L_BILLINGTYPE0] => MerchantInitiatedBillingSingleAgreement
[BILLINGTYPE] => MerchantInitiatedBillingSingleAgreement
[L_BILLINGAGREEMENTDESCRIPTION0] => Billing agreement description
[L_PAYMENTREQUEST_0_AMT0] => 11.84
[L_PAYMENTREQUEST_0_NAME0] => Item name
[L_PAYMENTREQUEST_0_DESC0] => Item description
[L_PAYMENTREQUEST_0_NUMBER0] => 1
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_TAXAMT0] => 2.49
[L_PAYMENTTYPE0] => ANY

价格不同,因为我实际上改变了它们(虽然它们不影响最终结果)。基本上我在发送[L_PAYMENTREQUEST_0_AMT0]时遗漏了一些字段(例如[L_PAYMENTREQUEST_0_ITEMAMT0],但情况并非如此。