我正在使用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
我已经试了几个小时来解决这个问题,但已经放弃了。有人能够指出我需要做什么来让它工作吗?
'PAYMENTREQUEST_0_AMT' => "100.00"
的同时设置L_PAYMENTREQUEST_0_QTY0 = 2
和'L_PAYMENTREQUEST_0_AMT0' => "100.00"
吗?也许 PayPal 不会计算 2x50.00,而只是查找每行的总额。我这里只是做出了一些假设。 - Jakub