我正在使用paypal express checkout API,並且在設置數量方面存在問題。以下是我的URI參數:Paypal API:購物車項目金額的總計與訂單金額不匹配
$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
我曾嘗試了幾個小時就結束脩復它和已經放棄。有人可以強調我需要做些什麼才能使其發揮作用?
您是否嘗試過做'L_PAYMENTREQUEST_0_QTY0 = 2'和''L_PAYMENTREQUEST_0_AMT0 '=>「100.00」'while''PAYMENTREQUEST_0_AMT'=>「100.00」'?也許paypal不會計算2x50.00,而只是尋找每條LINE的TOTAL。我只是在這裏做出假設。 – Jakub 2012-04-17 12:36:11
唉,那沒用。 – Rijndael 2012-04-17 16:49:18
我不知道這是否有幫助,但也許所有的美元值應格式正確'0.00' – thescientist 2012-04-18 13:23:35