Jump to content
Sign in to follow this  
hostbelly

Existing Customers in Stripe

Recommended Posts

Hi!

I have all of my customer's card information already stored in Stripe. I've looked around the WHMCS database to see if I could manually assign a user to a customer ID, but found nothing. Is there a way to manually link a WHMCS customer to a Stripe customer/payment ID?

Thanks so much in advance!

Share this post


Link to post
Share on other sites

There really isn't a way to do this.

We acquired a hosting company that was already using Stripe and WHMCS.  We ended up just having to take over their Stripe account.  Stripe can copy customer records and tokens to a new account, but there's no way to update the whmcs database without contacting support, and they seem confused and not aware of any of this. They finally gave us a quote of about $500 for a script. 

Share this post


Link to post
Share on other sites

If Stripe can copy the customer objects and their tokens to a new account, then an whmcs addon or even a hook to inject a form on the client summary page and a hook to accept that forms action could be used to assign a stripe customer to a whmcs client.   Now it would have to be per client and manually but at least it could be done without direct database changes. 

Share this post


Link to post
Share on other sites
23 minutes ago, steven99 said:

If Stripe can copy the customer objects and their tokens to a new account, then an whmcs addon or even a hook to inject a form on the client summary page and a hook to accept that forms action could be used to assign a stripe customer to a whmcs client.   Now it would have to be per client and manually but at least it could be done without direct database changes. 

Yeah, it's not that easy, they really encrypt this stuff in the DB and that's where you'd have to do the updates.  

Share this post


Link to post
Share on other sites

Had forgotten the payment methods changed how the gateway id is stored where in older WHMCS it was in the clear in the clients table.   But I would not suggest doing database changes anyhow.   So with that in mind the addon / hook method is the way to go for this and any php developer with knowledge of stripe and whmcs gateway functions or one that will read docs should be able to do it.   

Share this post


Link to post
Share on other sites

I don’t believe there are any docs detailing how stripe data is stored in the database. 

Share this post


Link to post
Share on other sites
8 minutes ago, blakeh said:

I don’t believe there are any docs detailing how stripe data is stored in the database. 

To get existing Stripe tokens, just use  GetPayMethods API call or get them via $client->payMethods  when using the classes method.  Once you have that, you get the remote_token variable and that will be a json array of:

{"customer":"cus_xxxxxxxxxx","method":"pm_xxxxxxxxxxxxxx"}

Where customer is the stripe customer token and method is the stripe payment token.   Though the docs are not clear, surprised I know, on this, if you look at the example response given on the GetPayMethods -> remote_token it shows similar to the above and viewing a payment method in the admin shows this. 

Then when you're storing Stripe info, you use $client->createRemoteCardPayMethod() and pass the same json array to it in the remoteToken variable.    

Share this post


Link to post
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.

Sign in to follow this  

  • 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