您的付款狀態不應該爲空,應該完成或待定。任何其他狀態通常意味着付款未完成或出現錯誤。確保事務完成的一種方法是發送GetTransactionDetails API調用或TransactionSearch API調用。
從PayPal的開發者網站這裏是交易搜索:
How to Do a Transaction Search
Request
-------
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=merchant_user_name
&PWD=merchant_password
&SIGNATURE=merchant_signature
&METHOD=TransactionSearch
&STARTDATE=2012-01-01T05:38:48Z #Start date of the time range for the search
&ENDDATE=2012-01-31T05:38:48Z #End date of the time range for the search
&VERSION=94
Response
--------
L_TIMESTAMP0=2012%2d01%2d11T06%3a39%3a13Z
...
&L_TIMEZONE0=GMT
...
&L_TYPE0=Payment
...
&L_EMAIL0=test_user%40x%2ecom
...
&L_NAME0=TestName%20Q
...
&L_TRANSACTIONID0=9XJ88717E86951234
...
&L_STATUS0=Completed
...
&L_AMT0=0%2e11
...
&L_CURRENCYCODE0=USD
...
&L_FEEAMT0=0%2e00
...
&L_NETAMT0=0%2e11
...
&TIMESTAMP=2012%2d10%2d01T17%3a55%3a54Z
&ACK=Success
...
可以在DoExpressCheckoutPayment調用後立即調用GetTransactionDetails? – Chewy
是的,您可以在DoExpressCheckoutPayment調用之後立即調用GetTransactionDetails。 –