hostbelly Posted January 27, 2021 Share Posted January 27, 2021 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! 0 Quote Link to comment Share on other sites More sharing options...
blakeh Posted July 20, 2021 Share Posted July 20, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 20, 2021 Share Posted July 20, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
blakeh Posted July 20, 2021 Share Posted July 20, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 20, 2021 Share Posted July 20, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
blakeh Posted July 20, 2021 Share Posted July 20, 2021 I don’t believe there are any docs detailing how stripe data is stored in the database. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 21, 2021 Share Posted July 21, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.