SIELOnline / acumulus-for-WHMCS

WHMCS add-on module that connects your WHMCS Service to Acumulus
GNU General Public License v3.0
2 stars 1 forks source link

Sending invoices manually always uses default account #2

Closed dqos closed 1 year ago

dqos commented 1 year ago

When you are sending an invoice from WHMCS to Acumulus, it seems that it's always using the default account number instead of the account number from the gateway/PSP.

This is caused by $config in doesn't have account_numbers.

I have a PR for this.

fietserwin commented 1 year ago

Looking at the code, $config seems to be initialized by calling acumulus_connect_get_config() before it gets passed to acumulus_connect_XmlPrepareInvoiceDetails() for all possible call paths, including the hook acumulus_connect_invoiceCreated in hoos.php. Thus if the entry 'account_numbers' is not initialized in $config, it looks like that the function acumulus_connect_getWHMCSAccountNumbers() returns an empty list (local api call 'GetPaymentMethods' not yet initialized?)

dqos commented 1 year ago

I'm not sure, but this fixed it for me. Please note that this code from Remline is a big mess and if I were you I wouldn't invest much time in this, to be honest. It's better to keep this patched up until a completely new module is created with libAcumulus as API abstraction.