I'm currently using the paypal's api for checking payments using the IPN checking. In the method where paypal is checking if the payment is verified , there's a comment saying :
//check that txn_id has not been previously processed
But I can't understand what is ths txn_id , what it does and why do I need to check it and how .
Thanks in advance,
This is a Unique Transaction ID, that is generated by PayPal.
You connect that with your order, and paypal report that back to you with the results of this order.
You use it to prevent fraud, for example what you do, when you verify that your order is OK, you read that number and search your database to see if this is connected to some other order. If you find it again, means that a potential fraud is on progress, some is buy something from you, lets say 5 euro items, and after some months, is try to order from you 100 euro items, and some how is replay to you with an old verify status id - trying to reuse an old complete transaction. But because that status id is unique you catch him.
To use it, connect that id, with the unique id of your order, and keep that connection for check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With