Just saw your reply on the other post. You are welcome. Here’s how my app does what you are asking. It again will contain details you dont need. I typed this in response to an earlier question you had before I seen this one. It’s breakfast time for me. I’m up all hours.
In regards to the uniqueness of the transaction, the transaction Id will be in the json payload. In order to tie the transaction Id to your records, you will need to pass some retrievable value in your accept hosted API call.
By retrievable, I mean something you call pull from authorize in a gettransactiondetails method call. For my application I use the invoice number which is tied to the customers shopping cart. Here’s how that works, again in php, and again I would imagine you can find a parallel method in C#.
1. When the API call is made, the invoice number is passed
2. If transaction succeeds. Webhook comes in
3. The json payload is captured and the transaction id is programmatically extracted
4. The transaction id is passed as a parameter in the gettransactiondetails method call
5. This will return a response object that has the entire transaction that relates to that transaction id, including the invoice
6. I extract the invoice number from the response object
7. The invoice number is used to locate the appropriate record in the dB to insert the transaction Id