New Zenner
- Join Date:
- Mar 2011
- Posts:
- 2
- Plugin Contributions:
- 0
reduce inventory in external system after payment is confirmed by Paypal?
I am using a new install of v1.3.9h and default PayPal Express Checkout. When a payment gets processed, I get the updates back as expected in the Zen cart system. I understand payment is processed by ipn_main_handler.php, and I am assuming that the IPN notification from Paypal comes back to this php such that it updates tables PAYPAL, PAYPAL_PAYMENT_STATUS_HISTORY, ORDERS_STATUS_HISTORY, etc.
Now, I have a custom inventory management system for my retail store that got evolved over years. What I need is that when a product gets sold on my Zen cart website, it should automatically update my inventory management system. I have created a url that can be called with a parameter for the product id that gets sold. For illustration: http://www.myinventoryurl.com/updateinventory.jsp?id=101 which, when called, will reduce the quantity of 101 by 1.
I need to understand where can I call this url ( in ipn_main_handler.php? - I don't see the product ids in the order available in this code) and how such that I can pass the product ids to the url and call it for each item.
And, because we are at it, will I call the url like this example (I don't know much php)?
$page = file_get_contents("http://www.domain.com/filename");
Alternatively, could I could use triggers on mysql database table (orders_products?) to call the url. But I am not sure if I can call urls when using triggers.
If there is any plugin, or other approach available, I will appreciate, since I am sure I must not be the first person with a requirement like this, but unfortunately can't find any info on this.
Thanks in advance!