An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Hi @Matt Lee ,
Thanks for reaching out.
The way to handle this is to use your own internal ID instead of trying to match on email address. After the user submits the ASP.NET form and you save their details to the database, generate or retrieve the record ID for that submission, then pass that value into the PayPal button using the custom field.
For example:
<input type="hidden" name="custom" value="<%= PendingOrderId %>" />
When PayPal sends the transaction details back, that same custom value is included, so you can use it to look up the correct record in your database and link the payment to the original form submission even if the buyer uses a different PayPal email address.
One important point is not to rely only on the return page in the browser to confirm payment. It is better to use PayPal’s server-side notification flow and read the custom value there before marking the record as paid. That gives you a more reliable way to reconcile the payment with the correct user data.
Also, make sure the value you pass is just a safe reference such as an order ID or GUID, and not any sensitive customer information.
Hope this helps! If my explanation and suggestion were helpful to you, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.