Paypal Standard Workflow?
I am about to try and intergrate paypal standard into my site, i just want to know if this is possible with paypal standard?
I have a order form with a total that can vary depending on what they have selected.
User clicks buy now.
Redirects to paypal with开发者_高级运维 details, user pays. (I have done up to here before!)
My question is, when they click buy now, and pay.
At what point should one submit the order to the site database? and would you store the order status (Payed, or failed)
If anyone could let me know if this is possible, it would be great!
You'd store it as soon as the payment was verified.
What I mean by that: you shouldn't blindly trust the user. Verify the payment that went through by adding PayPal Instant Payment Notification () to your button. PayPal will then send a POST to this URL. You should take this POST data and send it back to PayPal for verification. If valid, you'll receive a VERIFIED response (as opposed to INVALID). When it's VERIFIED, you know for a fact that it's a valid POST. You can then do some additional checks, to verify whether the correct amount was charged etc.
Have a look at https://www.paypal.com/ipn/ for more information.
精彩评论