Quantcast
Channel: WHMCS Community Forums
Viewing all articles
Browse latest Browse all 13458

How can I tell if a module is suspended for non-payment via the API?

$
0
0
I have an external installed program (Win32) that users can lease and pay for monthly.

I'd like to sell them a service in WHMCS where the billing recurs monthly. It will use the autorelease module.

I know I can create a hook that will be called if the module is suspended. However, I can't turn off the external program via a hook.

The external program needs to contact WHMCS via the api and check to see that the service is paid in full and not suspended. If the service is suspended, then the installed program will stop working. Once the service becomes un-suspended, the program can check and start working again.

What's the best way to do this?

One way: The I retrieve a list of invoices via the API for the current customer. Check each invoice in turn to see which one is for the correct service (since the customer could have multiple purchases) If the most recent, current invoice has been paid, then the program will work. If the current invoice is not paid, it wont.

Is there a better way?

Viewing all articles
Browse latest Browse all 13458

Trending Articles