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

Check billing interval and period to set in mandate options #3690

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

Mayisha
Copy link
Contributor

@Mayisha Mayisha commented Jan 3, 2025

Fixes #3634

In the issue, it is reported that subscription purchases and renewals failed due to empty values in the interval and interval_count args in the mandate_options. We could not reproduce the bug. One possibility is this might be related to a bigger issue with the HPOS data synchronizer causing object metadata to be wiped/deleted (see woocommerce/woocommerce#53307).

Changes proposed in this Pull Request:

  • Checking if the subscription has billing interval and billing period data. If these are not present we fallback to the else block to use interval: sporadic.

Testing instructions

As the originally reported bug is not reproducible, test subscription and renewal flow to ensure there are no regressions.
Single subscription

  • As a shopper, add a subscription product to your cart and complete the checkout with a card.
    • Check the logs and confirm that interval and interval_count are correctly set in the mandate_options.
  • Renew this subscription as an admin from the subscription edit page.
    • Check the logs and confirm that interval and interval_count are correctly set in the mandate_options.
  • Renew this subscription as the shopper from 'My Account > Subscriptions' page.
    • Check the logs and confirm that interval and interval_count are correctly set in the mandate_options.

Multiple Subscriptions

  • As a shopper, add two subscription products to your cart having different billing intervals and complete the checkout with a card.
    • Check the logs and confirm that interval: sporadic is set in the mandate_options with no interval_count.
  • Renew one of the subscriptions as an admin from the corresponding subscription edit page.
    • Check the logs and confirm that interval and interval_count are correctly set in the mandate_options.
  • Renew one of the subscriptions as the shopper from 'My Account > Subscriptions' page.
    • Check the logs and confirm that interval and interval_count are correctly set in the mandate_options.

@Mayisha Mayisha requested review from a team and annemirasol and removed request for a team January 3, 2025 11:57
Copy link
Contributor

@annemirasol annemirasol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this check makes sense to me! 🚢

✅ Correct interval and interval count for single subscription orders, customer-initiated and admin-initiated renewals.
✅ Correct interval and interval count for multiple subscription orders, customer-initiated and admin-initiated renewals.

📝 Reminder to add changelog and readme entries ✏️

@Mayisha Mayisha merged commit bb92f43 into develop Jan 6, 2025
33 of 35 checks passed
@Mayisha Mayisha deleted the fix/3634-empty-data-in-mandate branch January 6, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty interval and interval_count data in mandate options causes subscription purchases & renewals to fail
2 participants