php - Edit Database After Successful paypal payment -
i've been @ bit now, , have tried using google extensively.
i have application set up: hwid system available paid subscribers.
i want buyers able click on 'buy button', , once pay automatically adds information database app uses. way there no waiting after payments.
i know possible, because i've seen done before - can't seem find how works?
i prefer done in php well.
basically need use paypal api's -
you specified don't want waiting update records after payments. depending on plans should aware of dangers of assuming payment has been processed (before has).
there number of ways either trick system thinking have paid using paypal (when payment failed or trying commit fraud).
so if updated records based on return value after paying paypal lead open problems. wouldn't operations specified unless know payment has gone through ok, , how do that?
i use paypal's ipn (you combine pdt indicator / info user), steps:
- get paypal sandbox account testing - from here
- decide if going use paypal's pdt ipn / redirect page method
- create ipn code (available variables review these) - take ideas here - class can found: https://github.com/quixotix/php-paypal-ipn
- within ipn code (once has been validated , verified) can safety add username / other things in db wanted / email user payment has been successful.
on testing receive ipn within few seconds after payment (sometimes before user has been redirected. times ipn takes longer process need keep user updated payment progress (you use pdt data this) or display message on redirect page paypal.
there lot go through paypal's end, if take step step, isn't painful.
Comments
Post a Comment