我得到了传说中的Paypal ApPI错误:10400。
有人遇到同样的问题,所以我接受了接受的答案的代码。 Missing amount and order summary in PayPal Express Checkout
不幸的是我仍然得到同样的错误。这是我发送的内容:
'&CURRENCYCODE='.urlencode($PayPalCurrencyCode).
// Total amount of the purchase, incl shipping, tax, etc
"&PAYMENTREQUEST_0_AMT=300.00".
// Total amount of items purchased, excl shipping, tax, etc
"&PAYMENTREQUEST_0_ITEMAMT=300.00".
// Authorize the funds first (Authorization), or capture immediately (Sale)?
"&PAYMENTREQUEST_0_PAYMENTACTION=Sale".
// First item
"&L_PAYMENTREQUEST_0_NAME0=Item1".
"&L_PAYMENTREQUEST_0_QTY0=1".
"&L_PAYMENTREQUEST_0_AMT0=100.00".
// Second item
"&L_PAYMENTREQUEST_0_NAME1=Item2".
"&L_PAYMENTREQUEST_0_QTY1=1".
"&L_PAYMENTREQUEST_0_AMT1=200.00".
"&RETURNURL=".urlencode($PayPalReturnURL ).
"&CANCELURL=".urlencode($PayPalCancelURL);
在paypal网站上我可以使用正确的名称和金额,但响应有错误:
Error : Order total is missing.
Array
(
[TIMESTAMP] => 2013%2d02%2d08T16%3a33%3a56Z
[CORRELATIONID] => fad1ebcd85c8c
[ACK] => Failure
[VERSION] => 76%2e0
[BUILD] => 5060305
[L_ERRORCODE0] => 10400
[L_SHORTMESSAGE0] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e
[L_LONGMESSAGE0] => Order%20total%20is%20missing%2e
[L_SEVERITYCODE0] => Error
)
有人可以确认此代码有效吗?