我们如何使用PayPal Express Check Out中Paypal的响应令牌来验证付款成功/失败。
PayPal responds with a message, such as the one shown below. Note the status, which should include ACK
set to Success
, and a token that is used in subsequent steps.
TIMESTAMP=2007%2d04%2d05T23%3a23%3a07Z
&CORRELATIONID=63cdac0b67b50
&ACK=Success
&VERSION=XX%2e000000
&BUILD=1%2e0006
&TOKEN=EC%2d1NK66318YB717835M
The DoExpressCheckoutPayment response (if Successful) will include a PAYMENTINFO_n_PAYMENTSTATUS parameter that you can check to see if the payment associated with the API call is actually completed or not.
If this param has a value of "Completed" then you know you're good to go. It could be "Pending", though, in cases where an e-check is used for payment, fraud filters flag the transaction, etc.
Because of this it is recommended that you use Instant Payment Notification (IPN) in order to handle all post-transaction processing tasks like updating your database, sending email notifications, etc.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.