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

Invalid Recurring Shipping Method with Apple / Google Pay When Paying for Multiple Subscriptions #8029

Closed
mattallan opened this issue Jan 17, 2024 · 3 comments · Fixed by #8618
Labels
category: core WC Payments core related issues, where it’s obvious. component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: subscriptions type: bug The issue is a confirmed bug.

Comments

@mattallan
Copy link
Contributor

Originally reported in 4606-gh-woocommerce/woocommerce-subscriptions


Describe the bug

When attempting to purchase multiple subscriptions of varying periods with Apple/Google Pay, you will get an "Invalid recurring shipping method." error:

image

After some initial investigation I believe this issue is caused by WooPayments wiping the recurring shipping methods from the chosen_shipping_methods session when it calls WC()->shipping->reset_shipping(), which is called when calculating the shipping options to display in the Apple/Google Pay pop-ups.

Before we wipe/clear the chosen shipping methods, we store them in a variable here so I think to fix this we'll need to restore any other chosen shipping methods that were wiped.

Additional details

Example of shipping_method data from payment button $_POST:

Array
(
    [0] => free_shipping:2
)

Example from a default checkout process:

Array
(
    [0] => free_shipping:2
    [2024_04_12_every_3rd_month_0] => free_shipping:2
    [2024_03_12_every_2nd_month_0] => free_shipping:2
)

To Reproduce

  1. Install and activate the latest Woo Subscriptions plugin
  2. Enable/activate Apple Pay and Google Pay payment request buttons
  3. Create two subscription products with different billing periods (monthly and weekly)
  4. Add both subscription products to your cart and navigate to the checkout page
  5. Purchase the checkout with Google Pay
  6. Notice the error seen in the screenshot above

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

@mattallan mattallan added the type: bug The issue is a confirmed bug. label Jan 17, 2024
@jessy-p jessy-p added the component: wcpay subscriptions Issues related to Stripe Billing Subscriptions label Jan 17, 2024
@zmaglica zmaglica added the category: core WC Payments core related issues, where it’s obvious. label Jan 30, 2024
@zmaglica
Copy link
Contributor

This issue impacts WC Payments Subscriptions so assigning to Quark (based on team responsibilities Pc2DNy-3z-p2) @diego373. Assigning as part of Gamma Triage process PcreKM-yM-p2.

@glagonikas
Copy link

Hi @mattallan can you check if #8602 indeed resolves the issue and complies with the coding requirements? We could do with having this merged soon as it's affecting a reasonable number of customers.

I suspect a similar PR would also resolve woocommerce/woocommerce-gateway-stripe#2837

@mattallan
Copy link
Contributor Author

Hey @glagonikas I've just left a comment on #8602 but I'll also message here to let you know there was an issue with the approach taken, so I've pushed up a PR which fixes this in a different way: #8618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. component: wcpay subscriptions Issues related to Stripe Billing Subscriptions focus: subscriptions type: bug The issue is a confirmed bug.
Projects
None yet
5 participants