Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is txn_id of paypal api and why it should be checked and how?

Tags:

c#

asp.net

paypal

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,

like image 403
Josi Avatar asked Oct 31 '25 13:10

Josi


1 Answers

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.

like image 134
Aristos Avatar answered Nov 03 '25 03:11

Aristos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!