I'd like to ask a question related to a community extension, but about how to specifically extend that extension. The extension developer's support doesn't extend this far.
It's a payment module in the checkout. In system->config->payment methods
there is a field within the credit card section for client ID. I need to set it up so instead of being able to provide one client ID to the payment service as it is just now, I need the plugin to be able to handle multiple client IDs, one for each of our business partners.
So for example, a customer buys a product on the site, which belongs to one of our partners (id of 1), then the client ID sent to the payment service should be for partner 1. A product of partner 2 should send to the payment service the equivalent client id 2.
Looking at the extension code, I found the client_id section within etc/system.xml
, allowing us to set the client id in admin.
Also in Model/Observer.php
I can see
$clientId = Mage::getStoreConfig('payment/'.$payment->getMethod().'/client_id', $storeId);
This is overly simplistic, but could I somehow
- Add extra sections within system.xml for each client ID I required, so these can be entered in admin (e.g. client_id1, client_id2)
- When a product goes to checkout, use the observer to get the partner id of the product to set client id (e.g. client_id1, client_id2) to be sent to the payment service?
Or would there be a better/correct way to approach this, perhaps as a separate local extension?