Fix for Nashville Wordpress Stripe Renew Database Error

Use this method when legacy customers try to auto renew, but system doesn't automatically do it.
Stripe Customer ID Issues (screenshots attached for reference)
—————————————————————————
To rectify the Stripe user id issue you just need to go to the “Users” section in the backend of Wordpress and search for the user based on their email address. Click on the user’s page that you are looking for and you can grab their user id from the url query parameter in the address bar (Screenshot : RetrieveUserId.jpg). From there, you can log in to phpMyAdmin and search for all user_meta associated with that user id in the wp_usermeta table. 
RetrieveUserId
SELECT * FROM wp_usermeta WHERE user_id = 4422031; (Screenshot : MySQL_Usermeta_RetrieveAllRecords.jpg) 
MySQL_Usermeta_RetrieveAllRecords
That will return all records for the user. What you are looking for is the record with the meta_key of “stripe_customer_id” (Screenshot : StripeRecords.jpg) 
stripe-records
You’ll want to delete the record in the DB (If there are multiple records with that key, just start by deleting the first from the top). Once you do that, go back to the users page in WP and click refresh. If you see an object under stripe with all of the customer info (Screenshot : RetrieveUserId.jpg), you’re done. If it still shows an error, just repeat the process until you you see that customer info object. 
RetrieveUserId
Shopify Tag Update Issues (screenshots attached for reference)
—————————————————————————
 
To rectify the Shopify customer tag issues after auto-renewal (this really only applies to Keith Urban but I set up all accounts just in case) you’ll just need to append a query string on the end of the url from the front end of the site (Screenshot : Shopify_UpdateUserTags_AfterAutoRenewal.jpg). This will update all users that had an expiration, of “today’s date", with the new tags based on success or failure. The “update_user_tags” param value is the same for all accounts. I just wanted to make it impossible for site users to accidentally run the function. See below for default params and examples.
{
update_user_tags : nI1M0tQeWem5KRApTaQt2vuZTyiplCnn, // Required
date : date('Y-m-d’), // Todays current date
limit : 50,
offset : 0
}
Using defaults:
Adding a limit of 500:
Adding an offset with a limit:
Adding a date:
When you use any of those URL’s, it will take a sec for the page to load since it’s running the process. Once the page loads, you can confirm how many users were affected during the process by viewing the source code (command+option+u on a Mac / control+option+u on a PC). Scroll to the bottom and you will see an array of objects containing the user ID’s (Shopify_UpdateUserTags_ShowsUsersAffected.jpg). This is a hidden element so it will not show up on the actual front end of the site.

Leave a comment