I have following design problem: In my website you post a thread and then checkout with the paypal button. The paypal button sends costum data like thread.content and regular fields like payerID, paymentID, ... to proceed the payment. The payment finally gets executed via
request.post(PAYPAL_API + '/v1/payments/payment/' + paymentID +
'/execute', ...,
function(err, response){
//here I insert into Database a new thread with costum data
});
Now after payment gets finally executed Webhook fires up, and triggers my IPN Listener. I want to confirm and update the database with status "completed" "pending" "mc_gross-mc_fee" ect..., but here I have a problem to identify the current IPN Event with the Database row. While inserting INTO database I could also insert "paypal-debug-id" which I also can find in the IPN "ipn_track_id", but I don't know if this is a good way to identify my database element.