Forums / General Questions / How to send order notification emails from an external gateway?

How to send order notification emails from an external gateway?

Views: 594

Results 1 to 1 of 1
14 Sep 2012, 2:53 PM
#1
rajoo_sharma avatar

rajoo_sharma

Zen Follower

Join Date:
Aug 2009
Posts:
137
Plugin Contributions:
0

How to send order notification emails from an external gateway?

Hello

This payment gateway doesn't have PayPal IPN kind of functionality so when the user closes the browser after paying successfully but before redirecting to the merchant website, the orders are not logged on to the zen-cart DB. So to handle this, we run a PHP Script through CRON every sometime that queries the payment gateway through API for those orders that were not logged into zen-cart DB, if the return value is Y we add the order records. This works fine.

We are running it from a folder /cron I'm not using any zen-cart function in this file, written in plain PHP style. The problem is with the order notification emails, is there a method I can use orders class and use it's method send_order_email($zf_insert_id, $zf_mode) but I can't instantiate it in my file because if I do it, I get "Illegal Access".

So how do I do this so that I can access order class outside of zen-cart framework?
or
how can I write the entire thing in the zen-cart framework?

Thanks