PayPal Integration, IPN & PDT, txn_id general query
Posted on 2004-08-06
I have set up a Buy now button for payment of goods and general custom invoiced items. It returns the user back to a completed page if the transaction is succesful. There is no processing on the completed page. Paypal also uses IPN (instant payment notification) posting results to my processing page.
The query I have is:
Is the Transaction ID (txn_id) that PayPal creates always unique? I Know the docs state this but it appears there are times it is not while I am testing, has me scratching my head. Maybe this can occur from a PayPal error? I know they have been up and down lately...
The simple code I am using is below. There are no database calls before this on the page yet somehow for the last 24 hrs everytime I test it, it trips that it is a duplicate.... Does anyone know of any gotchas here?
' check that TransactionID has not been previously processed
strSQL = "Select * FROM tb_Payments WHERE TransactionID='" & TransactionID & "'"
rs.Open strSQL, Conn, adOpenStatic, adLockReadOnly
if rs.eof Then
validID = True
error_str = error_str & "<br>error:transactionID(TransactionID)=Duplicate"
validID = False
set rs = nothing