Jump to content

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

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated