gpt4 book ai didi

php - Paypal API : The totals of the cart item amounts do not match order amounts

转载 作者:IT王子 更新时间:2023-10-28 23:52:09 28 4
gpt4 key购买 nike

我正在使用 paypal 快速结帐 API,但在设置数量时遇到问题。以下是我的 URI 参数:

$params = array(
'METHOD' => 'SetExpressCheckout',
'PAYMENTREQUEST_0_SHIPPINGAMT' => '0',
'PAYMENTREQUEST_0_TAXAMT' => '0',
'PAYMENTREQUEST_0_HANDLINGAMT' => '0',
'PAYMENTREQUEST_0_AMT' => "50.00",
'RETURNURL' => $this->_returnUri,
'CANCELURL' => $this->_cancelUri,
'HDRIMG' => $this->_logoUri,
'PAYMENTREQUEST_0_CURRENCYCODE' => 'GBP',
'L_PAYMENTREQUEST_0_DESC0' => 'Product description',
'L_PAYMENTREQUEST_0_NAME0' => 'Product name',
'L_PAYMENTREQUEST_0_AMT0' => "50.00",
'L_PAYMENTREQUEST_0_QTY0' => "2"
);

如果 L_PAYMENTREQUEST_0_QTY0 设置为 1,则该过程正常。但是,将其更改为 2 并将 'PAYMENTREQUEST_0_ITEMAMT' => "100.00"添加到数组中会出现以下错误:

TIMESTAMP: 2012-04-17T12:11:16Z
CORRELATIONID: da43f6c91254
ACK: Failure
VERSION: 88.0
BUILD: 2808426
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

我已经尝试了几个小时来修复它并放弃了。有人可以强调我需要做些什么才能让它工作吗?

最佳答案

您缺少一个 ITEMAMT。另请参阅我在 Paypal Express checkout with shipping cost and error 中的回答其中包含一个具有多个数量的工作示例。

&L_PAYMENTREQUEST_0_NAME0=10% Decaf Kona Blend Coffee  
&L_PAYMENTREQUEST_0_NUMBER0=623083
&L_PAYMENTREQUEST_0_DESC0=Size: 8.8-oz
&L_PAYMENTREQUEST_0_AMT0=9.95
&L_PAYMENTREQUEST_0_QTY0=2
&L_PAYMENTREQUEST_0_NAME1=Coffee Filter bags
&L_PAYMENTREQUEST_0_NUMBER1=623084
&L_PAYMENTREQUEST_0_DESC1=Size: Two 24-piece boxes
&L_PAYMENTREQUEST_0_AMT1=39.70
&L_PAYMENTREQUEST_0_QTY1=2
&PAYMENTREQUEST_0_ITEMAMT=99.30
&PAYMENTREQUEST_0_TAXAMT=2.58
&PAYMENTREQUEST_0_SHIPPINGAMT=3.00
&PAYMENTREQUEST_0_HANDLINGAMT=2.99
&PAYMENTREQUEST_0_SHIPDISCAMT=-3.00
&PAYMENTREQUEST_0_INSURANCEAMT=1.00
&PAYMENTREQUEST_0_AMT=105.87
&PAYMENTREQUEST_0_CURRENCYCODE=USD

关于php - Paypal API : The totals of the cart item amounts do not match order amounts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10191209/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com