fix: sync scripts for Stripe-to-Woo migrations#2632
Merged
Conversation
claudiulodro
approved these changes
Sep 11, 2023
claudiulodro
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the speedy turnaround on this! It looks solid and works well in my testing.
Long-term I do think we should move these CLI commands into Custom Content Migrator, so we don't have to wait so long for them to become available, but that's far outside the scope of this PR. :)
matticbot
pushed a commit
that referenced
this pull request
Sep 11, 2023
# [2.6.0-alpha.2](v2.6.0-alpha.1...v2.6.0-alpha.2) (2023-09-11) ### Bug Fixes * sync scripts for Stripe-to-Woo migrations ([#2632](#2632)) ([34beb15](34beb15))
Contributor
|
🎉 This PR is included in version 2.6.0-alpha.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
matticbot
pushed a commit
that referenced
this pull request
Sep 13, 2023
# [2.6.0](v2.5.1...v2.6.0) (2023-09-13) ### Bug Fixes * sync scripts for Stripe-to-Woo migrations ([#2632](#2632)) ([34beb15](34beb15)) ### Features * add anonymized email to ga4 events ([#2585](#2585)) ([9ac1c33](9ac1c33)) * add filter to the lists in the reg block ([#2611](#2611)) ([d960541](d960541)) * new option to require all membership plans for restricted content ([#2623](#2623)) ([60b361e](60b361e))
Contributor
|
🎉 This PR is included in version 2.6.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Fixes some lingering issues with the Stripe-to-Woo migration script. Also adds a new script that allows us to trigger a resync of contact data to the connected ESP, in case the ESP's synced data has diverged from the source of truth (WooCommerce).
How to test the changes in this Pull Request:
Stripe-to-Woo migration script fix
master, set your Reader Revenue platform to Stripe and make sure your wp-config.php doesn't have theNEWSPACK_USE_WC_SUBSCRIPTIONS_WITH_STRIPE_PLATFORMconstant. Also make sure that RAS is enabled and that your connected ESP is either ActiveCampaign or Mailchimp (the ESPs to which we sync RAS data).NP_Membership Statusvalue: it should be something like "Monthly Donor", indicating your donor status and the recurrence period of the donation.wp newspack stripe sync-stripe-subscriptions-to-wcscript. This will migrate the Stripe customer and their subscription to WooCommerce and cancel the Stripe subscription.NP_Membership Statusfield will now say something like "Ex-Monthly donor", which isn't accurate because the subscription wasn't actually cancelled, it was just migrated to WooCommerce. Make note of this contact for testing the resync script, below.NP_Total Paidvalue has increased by the amount of the manual renewal), indicating that the WooCommerce subscription is now syncing to this contact in the ESP.Note: in this test, the manual renewal will trigger a one-time donation transaction for the customer, which will change the
NP_Membership Statusof the contact in the ESP to "Donor" instead of e.g. "Monthly Donor". This won't happen for real automated subscription renewals.Resync script
wp newspack woo resyncCLI script. You can run this script without flags, which will resync all customers in the site, or with the following options:--migrated-subscriptions: will only resync customers attached to subscriptions that were migrated from Stripe. This takes precedence over any other args passed.--subscription-ids: will resync customers attached to the given subscription IDs (comma-delimited list).--user-ids: will resync customers with the given user IDs (comma-delimited list).--order-ids: will resync customers attached to the given order IDs (comma-delimited list).NP_Membership Statusvalue).Other information: