Jump to content

Importing credit card data from Authorize.net?


positivemedium

Recommended Posts

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!

Link to comment
Share on other sites

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...? 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. 

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