Jump to content

Custom payment gateway recurring billing


dreas

Recommended Posts

We're developing a custom payment gateway. How can we trigger our payment module to execute the automatic recurring billing with our payment service when a new invoice is generated? Do we have to hook-in with "InvoiceCreated - invoiceid" or is there some cleaner method for this?

Link to comment
Share on other sites

Can you be more specific? How does WHMCS know which invoice is recurring/nonrecurring? What function is handling it? How does WHMCS find which call to execute with the payment provider? Is there an example gateway module that is opensource and applying this system?

Link to comment
Share on other sites

Theres is a payment gateway development kit on the website, I would look at that first:

 

http://www.whmcs.com/members/dl.php?type=d&id=15

 

I'm not sure what you mean by "how does it know what invoices are non-recurring". Its not the invoice that determines that, its the service you have selected. If you have a recurring service (like web hosting for instance), its going to create an invoice on the predefined date every billing cycle. The payment gateway doesn't need to know if its a recurring payment or not.

Link to comment
Share on other sites

Theres is a payment gateway development kit on the website, I would look at that first:

 

http://www.whmcs.com/members/dl.php?type=d&id=15

Thanks for the link. We looked at that, and there are no references to recurring billing.

 

I'm not sure what you mean by "how does it know what invoices are non-recurring". Its not the invoice that determines that, its the service you have selected. If you have a recurring service (like web hosting for instance), its going to create an invoice on the predefined date every billing cycle. The payment gateway doesn't need to know if its a recurring payment or not.

 

All our services are recurring. WHMCS indeed generates the invoices correctly, but how does WHMCS execute the automatic payment request with our payment provider? That needs to be programmed somehow? Also some payment methods are recurring (like creditcard) and others are not (like banktransfers), we somehow need to tell WHMCS which payment methods can be automatically executed? There doesn't appear to be any documentation anywhere about this.

Edited by dreas
typo
Link to comment
Share on other sites

I would suggest opening a ticket. I'm sure theres a variable that gets set somewhere that tells WHMCS that the module supports recurring payments. Bank transfers and such wouldn't have a "payment gateway" in the traditional sense since it is a manual process.

Link to comment
Share on other sites

Answer from support (in case anyone else has this question):

The _capture function in the module is what will handle the recurring billings. _capture will be called any time an invoice is due for payment and then the logic should be check if the user has previously paid and has a reference setup for repeat billing and if so, process the charge with that, otherwise just return from the function and wait for the client to login and make payment manually.

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.

Guest
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