I have created a website with a custom shopping cart, and plan to use PayPal to process payments. Once a payment is made, PayPal posts details to a page on the website which contains a script to receive the transaction details, and pass them back to PayPal for verification. The details can then be captured into variables and inserted into the database on my site.
I need someone to write a PHP script? which is capable of? handling the above.? ?
Full specifications can be obtained from the PayPal website Website Payments Standard Integration Guide and Order Integration Guide:
"You must post all form variables exactly as you received them, and you must also append a variable named cmd with the value _notify-validate. PayPal verifies the transaction by checking the encrypted string.
PayPal then sends confirmation back to your server with a single word, "VERIFIED" or "INVALID", in the body of the response. Your IPN script should then post back a 200 OK response to prevent additional attempts by PayPal to post your transaction data. If PayPal does not receive the 200 OK response from your server, PayPal will resend the notification for up to four days.
If you receive an INVALID notification, it should be treated as suspicious and be investigated. If you receive a VERIFIED response, perform the following checks before fulfilling the order:
Confirm that the payment_status is Completed, since IPNs are also sent for other results such as Pending or Failed
Check that the txn_id is unique, to prevent a fraudster from reusing an old, completed transaction
Validate that the receiver_email is an email address registered in your PayPal account, to prevent the payment from being sent to a fraudster's account
Check other transaction details, such as the item number and price, to confirm that the price has not been changed. We also recommend using the custom or invoice variable to pass your own transaction ID that can you check.
Once you have completed the above checks, you can update your database with the IPN data and process the purchase."