Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal's Token ID Unique?

Tags:

php

paypal

Is the paypal's Token ID which it returns (ie: EC-XXXXXXXXXXXXXXXXX), always unique? i am doubting it would be? But what i am doing is that i am inserting it to my transaction table to verify if this transaction has already been processed.

I know Transaction ID can work too, but the thing is that the Token ID is returned first before even using the PayPal API methods such as GetExpressCheckoutDetails or DoExpressCheckout.

Please let me know what you think is best, from your own experiences.

Thanks

like image 893
Zubair1 Avatar asked Sep 21 '12 00:09

Zubair1


1 Answers

The Token is unique, but it only represents the session, which is why it is returned first. It does not indicate a complete transaction at all, and you shouldn't store it for that purpose. I would not recommend storing it for future use anyway, because PayPal doesn't use it to identify the transaction for refunds, etc (that I've seen at least).

I recommend you only use the Token to manage the actual checkout flow going from SetExpressCheckout -> GetExpressCheckoutDetails -> DoExpressCheckoutPayment, and then store the TransactionID returned from DoExpressCheckoutPayment as your "transaction complete" indicator. You should probably check the PaymentStatus return, too, since eChecks do not give the money to your account right away.

like image 172
jimp Avatar answered Oct 05 '22 00:10

jimp