Whenever a customer pays for something, they have to click on a link, the URL of which is generated by the GetPayPalPaymentUrl().
You already learned how this long URL's querystring contains other URLs, one of which is returnUrl (see previous post). Another URL it contains is notifyUrl, which the PayPal service hits whenever a link containing the PaymentUrl is clicked.
The purpose of hitting this URL is to allow the programmer to run code that can check if an order is Verified. The Notify.aspx page does that. (Notice that the UI of this page doesn't show anything. It is only there to run code only.)
The code in Notify.aspx first determines if the order is Verified by the PayPal service by sending a POST request with a cmd=_notify_validate parameter. This causes PayPal to emit a response of 'VERIFIED" if the order is verified. Then the code has to check the response to see if it contains "VERIFIED". (I am assuming this was before the days of JSON, which would make this much easier ;)
Then, the Notify.aspx code changes the order's StatusID to StatusCode.Verified in the database.
|