I know Java, but am no expert. I use JSP pages and Java Servlets for my site, with a Mysql database.
For a site that is selling products, I want to use Paypal payment buttons. Specifically the “Add to Cart” and “View Cart” buttons so the site can have a shopping cart feel.
I want to keep track of inventory, so when a purchase is made, meaning the payment has actually been submitted through Paypal and was successful, the database is then updated for each item purchased. I don’t want to accept payment(s) for an item that is no longer available. So inventory tracking in this case is important.
Is it possible to interact somehow with Paypal and accomplish this task? I need some advice on how to do this.
Yes, you can use IPN (instant payment notification).
Everything you need is here https://www.paypal.com/ipn with examples.
Just simply update the inventory after the purchase is made and if it is down to zero, disable the payment button. The problem is very straightforward and all you have to do is go over the IPN documentation.