Jump to content
  • 0
dtravlos

Stripe element gateway

Question

Hello,

I am trying to create a payment gateway using stripe and elements. For one time payment it works ok but I can't figure it out how to make it with subscriptions. I think that it should be handled from WHMCS per each invoice generation(monthly, quarterly etc) and not by creating product and plan on stripe. Is there any sample to see or doc with complete info on whmcs payment gateways?

Thanks

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

The way I did mine was to use regular charge API call and not subscriptions as I do overage fees and so the monthly can change and a subscription wouldn't work.   Also, if you need 3dsecure, make sure to start with paymentintents first instead of checkout or regular token creation. 

Share this post


Link to post
Share on other sites
  • 0

Thanks! What do you mean the regural charge API and where I can find the paymentintents doc? Also the subscription is more essential than the one time payment so I need to focus firstly on the subscription feature.

Share this post


Link to post
Share on other sites
  • 0

Yes I read the stripe docs. My problem is with WHMCS payment gateway docs which are incomplete with not all the necessary functions etc. You have any other links with full doc about the payment gateways?

Share this post


Link to post
Share on other sites
  • 0

Completely agree about the WHMCS docs. 

Start with the merchant gateway and the example for that and then add in _remoteinput() for the checkout page and _remoteupdate for the card management page.  Those last two functions expect an HTML form and I found them here on the community and not on the docs so they could be removed at some point but have not found another option yet.  Just return your forms to those functions and have them post back to it and use the functions for any processing.   I have posts on this on this community which may have other details I am forgetting. 

Share this post


Link to post
Share on other sites
  • 0

Thank you! These functions store info on whmcs right? Because the prefered method is to not store anything on WHMCS. 

Share this post


Link to post
Share on other sites
  • 0

With those functions acting as processing, you can store whatever information you want as you would be in control of that.  There is also storeremote but it seemed to want card info also and so wouldn't be of use with Stripe and don't use it personally. 

Share this post


Link to post
Share on other sites
  • 0

I wil ltry to see what will do with that... A bit tricky... Thanks for the help!

Share this post


Link to post
Share on other sites
  • 0

Hello again. Is there any way to work with subscriptions on whmcs using elements.js? 

Thanks

Share this post


Link to post
Share on other sites
  • 0

Yes, though webhooks.  https://stripe.com/docs/billing/webhooks  Basically listen for the invoice.payment_succeeded event, find the client in WHMCS based off the customer id given in the event.  You will need to query the database for clients that have a gatewayid of the customer id given.   Then just match up the invoice in WHMCS with the service with the subscription id of the payment. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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