Search code examples
paypalpaypal-ipn

Checking the txn_id for preventing frauds


If the payment status in "VERIFIED" then I'll just check if the txn_id exists(using sql) if it doesn't exist then I will continue checking the payment BUT if the txn_id exists it won't continue.

Is this checking method correct for the txn_id in order of preventing a fraud?

Thanks in advance,


Solution

  • No, it's to ensure you don't process the same transaction twice. Checking the txn_id by itself isn't sufficient. If it isn't null you have to check the tuple {txn_id, payment_status}, and if it is null you may have to check {parent_txn_id, payment_status}, or else other things like the subscr_id.