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

WooCommerce subscriptions missing _pronamic_subscription_id meta #11

Closed
rvdsteege opened this issue Aug 19, 2022 · 0 comments · Fixed by #12
Closed

WooCommerce subscriptions missing _pronamic_subscription_id meta #11

rvdsteege opened this issue Aug 19, 2022 · 0 comments · Fixed by #12
Assignees
Labels

Comments

@rvdsteege
Copy link
Member

Through a support ticket it came to our attention that there are older WooCommerce subscriptions without the _pronamic_subscription_id meta. This results in:

  • payment for a subscription not being linked to the Pronamic subscription;
  • the recurring payment will be created for a Mollie customer only, without specifying which mandate to use (if there are multiple valid mandates for a customer, this can lead to using the 'wrong' mandate).

The meta is used to add the subscription to a payment, so that the Mollie mandate ID can be retrieved from the subscription and set correctly on the payment when processing subscription payments:

In a discussion with @remcotolsma, it was suggested to add an upgrade script to add the meta to WooCommerce subscriptions where necessary. This can be done in the following way:

  1. loop through Pronamic subscriptions
  2. get WooCommerce subscription for subscription source
    (note: source IDs can lead to WooCommerce first orders and subscriptions)
  3. add _pronamic_subscription_id meta to WooCommerce subscription (see https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/4.1.1/src/Gateway.php#L419)

Internal Help Scout ticket: https://secure.helpscout.net/conversation/1949568266/24219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
2 participants