Closed kaushikasomaiya closed 10 months ago
Affected tickets:
6228375-zen 6214004-zen 6211018-zen 6243181-zen 6253081-zen 6229538-zen
Slack: p1682307961991049-slack-C7U3Y3VMY
With UPI Enabled, the following error pops up:
As per Indian regulations, export transactions require a description. More info here: https://stripe.com/docs/india-exports
We're getting the same issue for £0/mo subscriptions with a Sign up fee of xx (we're in the UK).
Where in the past in the mandate_options object, the "amount" key had the correct charge as the value, now the key for amount in the mandate_options object shows as "0" and the correct price shows outside of that object afterwards.
This is why Stripe is throwing the invalid integer code as it can't process a £0 transaction.
What we've also noticed is that this issue only happens with Parent Subscription orders (i.e. when someone first signs up for a subscription). Our recurring charges aren't affected and non-subscription items can be processed just fine too.
It's clear something has changed as none of this was happening before.
Getting the exact same issue on our site with WooCommerce 7.6.0 and WooCommerce Stripe 7.3.0, I had to downgrade Stripe extension to 7.2.0 to fix the issue. I upgraded WooCommerce Stripe 7.4.0 hoping the issue was resolved, but had to go back to 7.2.0 again.
Another ticket: #6271643-zen
Also happening to me, will downgrade to 7.2.0 as suggested here until solved
Reported here as well 6274199-zd-woothemes
I added the below code to wp-content/plugins/woocommerce-gateway-stripe/includes/compat/trait-wc-stripe-subscriptions.php
at line 598 to resolve this issue
if ($sub_amount === 0)
return $request;
6271770-zen as well
6289100-zen
6288116-zen
6298103-zen
Reported just now here 6313561-zd-woothemes
6308172-zen
I was able to replicate this with a slightly more straightforward setup:
Error log in Stripe dashboard:
parameter_invalid_integer - payment_method_options[card][mandate_options][amount]
This value must be greater than or equal to 1.
The error is logged in Stripe with UPE enabled, but the checkout doesn't fail. At the same time, the checkout fails with UPE disabled.
Error is reproducible both in 7.3.0 and 7.4.0.
6300305-zen
Marking this is high priority due to the number of affected merchants and how $0 "Free" subscriptions are a relatively common use case.
It seems this issue stems from the mandate functionality added for Indian merchants in 7.3 and how "0" is not a valid mandate amount. For many users this "free tier" subscription is integral to their business model.
Same issue in 6315769-zen and 6299029-zen as reported in #2623 which is a duplicate of this issue.
Closing #2623 in favor of this issue (2607)
6234421-zen
I added the below code to
wp-content/plugins/woocommerce-gateway-stripe/includes/compat/trait-wc-stripe-subscriptions.php
at line 598 to resolve this issueif ($sub_amount === 0) return $request;
Has the above solution worked for others?
Has anyone applied the latest Stripe security patch update and still had this issue with $0 subs?
6354786-zen
6381004-zen
Customer reported the same issue in the case 6393456-zen:
The following is what the user shared with us:
In case of switch the Stripe plugin is using the initial subscription price for the mandate instead of the new subscription price In our case, the initial subscription price is zero You have a sub $0 You switch to a sub $10 The plugin will create an intent of $10 with a mandate of $0 Instead of an intent of $10 with a mandate of $10
To reproduce:
Create a sub at $10 Switch to a sub at $20 The intent will have an amount of $20 but the mandate will be $10
The user implemented the fix and shared it with us:
I just created a fix using the wc_stripe_generate_create_intent_request filter I override the mandate amount $request['payment_method_options']['card']['mandate_options']['amount'] A cleaner way for the WooCommerce team would be welcome ;)
6383640-zen
6407908-zen
I'm facing the same issue. I had to use the wc_stripe_generate_create_intent_request filter to overwrite $request['payment_method_options']['card']['mandate_options']['amount']. An official fix would be welcome.
6364764-zen
6414081-zen
6414868-zen
6466659-zen
zd-6462028
6479201-zen
6496437-zen
6361583-zen
6497008-zen
6499288-zen
6518383-zen
6542196-zen
6530210-zen
Critically, in this ticket, the value of the renewal was NOT zero but the value of the mandate is:
2023-07-12T10:16:51+00:00 DEBUG
====Stripe Version: 7.4.1====
====Start Log====
payment_intents request: Array
(
[amount] => 49900
[currency] => eur
[description] => [REDACTED]
[metadata] => Array
(
[customer_name] => [REDACTED]
[customer_email] => [REDACTED]
[order_id] => [REDACTED]
[site_url] => [REDACTED]
[payment_type] => recurring
[save_payment_method] => true
)
[capture_method] => automatic
[payment_method_types] => Array
(
[0] => card
)
[payment_method] => [REDACTED]
[setup_future_usage] => off_session
[customer] => [REDACTED]
[payment_method_options] => Array
(
[card] => Array
(
[mandate_options] => Array
(
[amount_type] => fixed
[interval] => year
[interval_count] => 1
[amount] => 0
[reference] => 126419
[start_date] => 1689156990
[supported_types] => Array
(
[0] => india
)
)
)
)
)
====End Log====
2023-07-12T10:16:52+00:00 DEBUG
====Stripe Version: 7.4.1====
====Start Log====
Error: stdClass Object
(
[error] => stdClass Object
(
[code] => parameter_invalid_integer
[doc_url] => https://stripe.com/docs/error-codes/parameter-invalid-integer
[message] => This value must be greater than or equal to 1.
[param] => payment_method_options[card][mandate_options][amount]
[request_log_url] => https://dashboard.stripe.com/[REDACTED]
[type] => invalid_request_error
)
)
====End Log====
This means that only the initial setup needs to be for zero for this bug to take effect.
6524770-zen
6556867-zen
6521080-zen
There are 2 PRs for the fix. The ticket was mistakenly closed on the first PR merge. Reopening the issue until the second PR is merged as well.
6612997-zen
6641918-zen
6659215-zen
7224517-zen
1) 6243181-zen
User has the following setup:
1) Variable Subs with switching enabled
2) Switch settings: Full Size: https://d.pr/i/5t5nd5
Issue: When we have an active Subscription with $0/month cost (Virtual), upgrading to a paid subscription doesn't work with Stripe: (only occurs when prorating)
Full Size: https://d.pr/i/q2kqvL
Able to replicate on my test site.
2) 6253081-zen
Merchant's prepaid subscriptions ($0/month with a signup fee) aren't being processed.