Jump to content

How To Call Value From Gateway In Component To A Plugin


Recommended Posts

Posted

Currently, i develop a plugin in plugins folder. Now, i want to call values of gateway(non-merchant) in component to this plugin.

 

So, how can i do that?

 

Thanks,

Posted

If you want to invoke a payment/refund on a gateway via your plugin, I suppose you could use the Payments model to do so.

 

You could also load and instantiate the gateway yourself:

Loader::loadComponents($this array("Gateways"));

// Load the gateway by its name (my_gateway) and type (non-merchant)
try {
    $gateway = $this->Gateways->create('my_gateway', 'nonmerchant');

    // Do something
    $gateway->method();
} catch (Exception $e) {
    echo $e->getMessage();
}

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...