Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe recurring profile doesn't migrate when moving customer #9647

Open
brianleejackson opened this issue May 17, 2023 · 2 comments
Open

Stripe recurring profile doesn't migrate when moving customer #9647

brianleejackson opened this issue May 17, 2023 · 2 comments
Labels
type-improvement workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.

Comments

@brianleejackson
Copy link

Bug Report

Expected behavior

There are many times when an account will have a typo on it; the person no longer exists, someone has changed in the company, etc. This means I have to create a new customer/user ID and move everything over to it. The problem is, the recurring profile for Stripe doesn't seem to automatically get moved over.

If I have created a new customer along with a new user ID, I would assume changing the customer on a purchase record would also move the recurring profile along with it.

Actual behavior

Typically the Stripe record shows on the following URL under "Recurring Profiles."

/wp-admin/edit.php?post_type=download&page=edd-customers&view=overview&id=XXXXX#edd_general_subscriptions

However, when creating a new customer/user ID and then updating the customer attached to it, the Stripe recurring profile is no longer there. It's still attached to the old user ID.

Steps to reproduce the behavior

  1. Create a customer and user ID with a Stripe purchase/subscription.
  2. Create a second customer and user ID with nothing.
  3. Move the purchase to the second customer. Typically this is done in the dropdown on the individual order page where it says "assign to existing customer."
  4. Check the URL as mentioned above of the second customer. It won't have the Stripe recurring profile attached to it. It's still attached to the first customer/user ID.

Typically a way to fix this manually is to search for the recurring profile ID in wp_usermeta using %LIKE% since it will be inside a serialized array, then you have to update the user id to the new one.

Information (if a specific version is affected):

PHP Version: 8.1

EDD Version (or branch):

  • EDD Version 3.1.1.4.2
  • EDD Recurring Payments Version 2.11.9
  • EDD Software Licensing Version 3.8.7
  • EDD Stripe Pro Payment Gateway Version 2.9.3

WordPress Version: 6.2.1

Any other relevant information:

Perhaps there is a better way to move everything from a customer/user ID to a new account, and I'm missing something. But the above seems like a bug.

Happy to provide any additional information if needed.

Thanks

@brianleejackson brianleejackson added type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on. labels May 17, 2023
@cklosowski
Copy link
Contributor

Hey @brianleejackson Thanks for the detailed issue.

While on the surface your assessment is accurate, there are some considerations that need to be taken when moving payments around. While the concept you are detailng here is not ideal, it is 'intentional' that we don't link a new customer in EDD to the old Stripe customer Profile ID.

There are a number of cases where this is not the desired outcome and in some cases is actually not possible, depending on circumstances and the state of the customer's purchase history.

We are looking into some other Stripe Customer Record related changes in the future to better facilitate multi-currency support and other aspects of Stripe's Customer records, and we'll keep this situation in mind when we're looking at this.

@brianleejackson
Copy link
Author

Thanks for the detailed response @cklosowski. That makes sense, and definitely would like to see improvements going forward with how this might be handled. Part of me was wondering if I was missing something, so glad to confirm that part at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-improvement workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.
Projects
None yet
Development

No branches or pull requests

2 participants