How can I automatically alert my php/mysql web app that a PayPal transaction has gone through?
I have a client who will be selling access to an online service on their website. They would like to integrate a PayPal Buy Now button into the site... no problems there. However, they want their customers to have instant access to the online service that they are selling as soon as the payment is processed. That seems reasonable to me... the problem is that I can't seem to find a way to automate that. So my question is really this:
How can I automatically alert my php/mysql web app that a PayPal transaction has gone through?
All I would really need is like a callback process that triggers a php script to updates the customer's record in the database... right? Seems simple to me. But I can't seem to find a way to do it! 开发者_运维技巧Anyway, if you've accomplished anything similar with PayPal, I'd be grateful for your advice!
See Instant Payment Notification.
I think you want to send in a variable to paypal (item_number) that they will return to a page that you specify in your post to them (return - success and cancel_return - cancel). They will send you back whether the transaction was successful or not and then with your variable you can make a call to your db to update the record in your database based upon the result of the transaction. In the return page you can also send some sort of notification to the client of the success or failure of the payment process and clean up after a canceled transaction.
PayPal maintains an extensive knowledge base on how to integrate their services with your web app. In think that is a good first starting point. See www.x.com
精彩评论