Create a payment mod :: Access payment module options

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 ?

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()

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'].

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']);

Can we see the full code pls?

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 :

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').

This thread has been closed due to long inactivity. Posting to it is not possible.
View code on GitHub