positivemedium Posted November 3, 2022 Share Posted November 3, 2022 Until recently I had been using Stripe as my payment gateway, so there is no local card data in my WHMCS, just Stripe tokens. However, I have migrated to Authorize.net, and am using the Accept.js gateway module. As part of my migration, Authorize.net imported the card data stored at Stripe into my Authorize.net account. Is there any way to link this card data to clients in my WHMCS? I would like to avoid asking for customers to update their cards when they are already stored in my Authorize.net account. Any help is appreciated! 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 3, 2022 Share Posted November 3, 2022 Out of the box, nope. You could edit the database and update each client's gateway token to the new token, however, IIRC the payment method entries are encrypted and/or in a binary column and can't easily be changed. An addon that does that "the proper way" is probably best. On a related note, was not aware authorize.net could import Stripe data and be able to charge the cards. IIRC, none of their API functions returns the full card info. So sure they have the client info. So I suppose there is a behind the scenes data swap between the two...? 0 Quote Link to comment Share on other sites More sharing options...
positivemedium Posted November 3, 2022 Author Share Posted November 3, 2022 1 minute ago, steven99 said: On a related note, was not aware authorize.net could import Stripe data and be able to charge the cards. IIRC, none of their API functions returns the full card info. So sure they have the client info. So I suppose there is a behind the scenes data swap between the two...? Yes if you contact the old gateway (Stripe) and tell them you want to migrate your card data to another gateway, they will reach out to them for you and provide them with the data in a secure format. Then the new gateway (Authorize.net) will do the import. You never actually have access to the card data. The whole process took about a week to complete. Unfortunately since I can't get the tokens into WHMCS, I still have to use Stripe for the clients that haven't re-entered their cards. 0 Quote Link to comment Share on other sites More sharing options...
positivemedium Posted November 3, 2022 Author Share Posted November 3, 2022 5 minutes ago, steven99 said: Out of the box, nope. You could edit the database and update each client's gateway token to the new token, however, IIRC the payment method entries are encrypted and/or in a binary column and can't easily be changed. An addon that does that "the proper way" is probably best. I'd actually looked into manually adding the card tokens into the database, but the server where my WHMCS is installed uses MariaDB instead of MySQL, and doesn't have the ability to change the block encryption mode. I was trying to come up with something based on the info in this thread: How to save the credit card_data and in whmcs database using stripe payment gateway. - Developer Corner - WHMCS.Community 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted November 3, 2022 Share Posted November 3, 2022 A quick, very rough example, of doing this in code would be: $client = Client::find(124433); $client->createRemoteCardPayMethod('authcim', '1234', "1299", "authnet_123abciyez" ); https://classdocs.whmcs.com/8.6/WHMCS/User/Client.html You could use the $client->payMethods() function to get the current methods, find the stripe one and get its data via Stripe API. Then check authorize.net API for a matching client and last 4 and expiry date and add using the above. Did not have time to check what paymethods returns, but likely an array of tblpaymentmethods objects or array of them. print_r /vardump to log to find out. Once you matched it up, use the above function and you're done. 0 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.