Reputation: 173
Ok so I have built my shopping cart system for my site that uses PayPal Parallel Payments to multiple sellers since the site allows users to sell thier own items and when a buyer buys stuff, they can buy from many sellers at once. I then figure out the payment to each seller including fee's and then send the user off to paypal where they would pay.
The part I am not sure of is do I create the order ID and update in the DataBase the order has been created but not paid for yet. Then when the users pays for it in paypal, I would update order in the Database it has been paid. At which point I would allow the user access to the content they paid for.
I guess I am asking how do I check to see if the user has payed in PayPal or if the transaction failed due to insufficient funds or something? Is there way to search by the order ID in paypal to see if the order has been paid for?
edit: I know I could use the return URL but that doesn't seem very safe?
Upvotes: 0
Views: 981
Reputation: 620
Once a Payment is executed (payKey created, user has been redirected to PayPal, approved payment, and is redirected back to your return URL), you can then use the Adaptive Payments API to call and check the status of the payment to determine if the money has really moved.
Use the PaymentDetails call - the status should be COMPLETED if the payment was successful.
Upvotes: 1