Jump to content

Stripe CC encrypt/decrypt gateway token


alebeta

Recommended Posts

Hi all,

 

Recently I needed to change my stripe merchant account, and stripe support did the migration of the customer objects from one merchant account to the other.

It means all the customer id(cus_xxxx...) and credit card information was migration properly. But the payment method id, was changed in the migration, for some internal stirpe policy they need to generate a new payment method id, this payment method id is store in the Gateway Token(card_data in the tblcreditcards).

After having a conversation with Stripe support, they just ask me, to create an script that fetch the new payment method id per each user in my stripe account and then save it in my WHMCS Gateway Token(card_data) field for each user.

My question starts here:

How can I decrypt the card_data blob from my data base when I have the cc_encryption_hash key?

In the internet I could find some ideas about how to insert some data using a good security practice

 

But there is nothing related with the WHMCS method of encryption of that field for the Gateway Token.

 

At the moment the only possibility(which is not a solution because of the volume of customers) is to delete the payment method of each customer(it need to be force, because the payment method id does not match) and then the user will have to add the payment method again.

 

Thanks in advance

Link to comment
Share on other sites

  • 2 years later...

I've been looking for a solution to this as well, to update the old format of storing customer/method parameters to the new one, which seems like a proper JSON format instead of just two strings separated by a comma. 

Apparently there is no other way of doing this manually other than EACH and EVERY client having to be bothered to go into their client area and updating their card data manually... which, given a few hundred clients is a painful process to pass onto them, when it could be easily fixed by a one line mySQL query, so to speak.

Anyone? Any suggestions?

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