How to Fix User Subscriptions After Deleting a Live Payment Gateway

If you have deleted a payment gateway from the MemberPress > Settings > Payments tab that is currently associated with active automatically recurring subscriptions *, then those subscriptions will not update correctly in MemberPress after the payment occurs on the gateway. This is because the connection between the gateway and MemberPress was deleted when you deleted the payment gateway option. 

If you have many automatically recurring subscriptions that were connected to the now deleted gateway here is what you need to do to fix them:

  1. Recreate the gateway following the setup instructions for it. These can be found here. (If you have already recreated the payment gateway you may skip this step.)
  2. Follow the import instructions here to import the subscriptions. In this step, be sure to import them connected with the gateway you recreated in step #1 (or previously). 
    1. Note: You only need the required fields. And if you include the optional id field with the subscription id, the records will be updated and step 3 below won't be needed. 
  3. (Optional, but recommended) Go through the MemberPress > Subscriptions page and delete all the subscriptions that were connected with the now deleted gateway. You can identify them because under the Gateway column on the MemberPress > Subscriptions page, you will see a unique ID number that was associated with your old gateway. For example, you may see something like, "pea5pn-8cz," instead of, "Stripe". MemberPress forces you to delete these one-by-one, there is no mass delete option. This will help clean up your site and prevent any confusion in the future for you and other admins. 
  4. If you are using Stripe, you will also want to run this SQL statement on your database to copy over customer id numbers. 

    Replace [qp] (in both places) with your dabase unique prefix. 
    Replace [new gateway unique id] with the new gateways unique identifier.
    Replace [old gateway uniquey id] with the old gateways unique identifire.
    Replace [currency] (in both places) with the currency code you are using, in all caps. (Example USD)

    INSERT INTO [wp]_usermeta(user_id, meta_key, meta_value)
    SELECT user_id, '_mepr_stripe_customer_id_[new gateway unique id]_[currency]' as meta_key, meta_value
    FROM [wp]_usermeta
    WHERE meta_key = '_mepr_stripe_customer_id_[old gateway unique id]_[currency]'	

    Note: If you do not know how to run SQL queries, or don't feel comfortable doing it yourself, contact our support team and we will be happy to help.

If you only had a few automatically recurring subscriptions that were connected to the now deleted gateway you may find these steps easier to follow:

  1. Recreate the gateway following the setup instructions for it. These can be found here. (If you have already recreated the payment gateway you may skip this step.)
  2. Navigate to the MemberPress > Subscriptions page. 
  3. Find the subscription associated with the old, now deleted gateway. 
  4. Click edit on the Subscription after hovering over it's unique ID. 
  5. Find the Gateway: option and using the drop down, select your newly created gateway from step #1 (or that you created previously).
  6. Click the Update button at the bottom to save. 
  7. Repeat for every automatically recurring subscriptions connected to the deleted gateway. 
  8. If you are using Stripe, you will want to do the SQL statement in step 4 in the process mentioned above.

*Note: One-time payment type subscriptions are NOT affected by deleting the gateway. This is because they have to signup again, re-instigating the purchase to renew or subscribe again. In that process they have the option to select any other gateway on your site. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.