Jump to content

Handling Recurring Subscriptions - Custom Module


Recommended Posts


I'm developing a custom gateway payment module and it's already working for one time payments, but I'm wrapping my head around the best way to  make it work with recurring subscriptions.

I understand that on the first time the user chooses to subscribe, the payment gateway provides a unique subscriptionid (just like paypal or stripe do) and it's added to the tblhosting on the subscriptionid field, what I don't get is when the subscription renews, let's say after 1 month, how does the system handle this? How does it know which services/invoices need to renew or be marked as paid?

Is there any tips that you can provide or a sample code/module that shows how recurring subscriptions are handled internally ?

Any help will be very appreciated

Thank you.

Edited by tuga
Link to comment
Share on other sites

  • 8 months later...

Some subscription options are based on the table `tblhosting` (or hosting if it hasn't a prefix).
Next_due_date  & next_invoice_date are some of the columns that show you some info about the subscription status.

Based on that, you can search into whmcs code (on some free/unencoded versions eg. 7) to find where that columns are used and how to manage data.
Hope someone find this a little helpful. :)

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