user882 LiteCart Fan Od Člen od sep 2014 user882 9 mar 2015 10:14 Hi, How i can access the payment module settings from an external file (like callback.php) I tried the following code : $payment = new mod_payment(); list($module_id, $option_id) = explode(':', $order->data['payment_option']['id']); I would like to know the defined status id for a successfully paid case and update the order status with this id : $ctrl_order = new ctrl_order('load', $order['id']); $ctrl_order->save($data['order'], $status_id); I would like to know how i can get $status_id from the module settings. Can the $payment instance give me the module settings ?
user882 LiteCart Fan Od Člen od sep 2014 user882 9 mar 2015 13:50 oops problem solved, but how i can transmit a parameter to the callback method on : $payment->run('callback', $module_id); I tried : global $my_var;//but $my_var stills undefined under $payment_module->callback()
litecart Main Crew Od Sweden Člen od feb 2013 litecart 9 mar 2015 16:43 For the module settings: var_dump($payment->modules[$module_id]->settings); To output order status id: echo $order->data['order_status_id']; To set order status id 99: $order->data['order_status_id'] = 99; $order->save(); To fetch a variable in the global scope inside a local scope $GLOBALS['my_var'].
user882 LiteCart Fan Od Člen od sep 2014 user882 9 mar 2015 18:23 many thanks but i still can't access $ctrl_order properties on callback() my var on callback.php : $ctrl_order = new ctrl_order('load', $order['id']);
litecart Main Crew Od Sweden Člen od feb 2013 litecart 9 mar 2015 18:37 Can we see the full code pls?
user882 LiteCart Fan Od Člen od sep 2014 user882 10 mar 2015 13:36 I solved the problem by moving all the PHP code from callback.php to the $payment->callback() method. The content of my new callback.php :
litecart Main Crew Od Sweden Člen od feb 2013 litecart 10 mar 2015 20:12 Thank you for sharing your solution. Incoming data can usually be retrieved inside a class method with superglobals $_POST, $_GET and file_get_contents('php://input').