Payment fails for certain subscription product configuration
-
Hi. We’ve found an error introduced in 7.3 version that is still present. It is a major issue that prevents us from updating the plugin to the latest versions, we have to stay with 7.2.1. The error does not allow to place an order if the cart has a subscription product with specific configuration.
Here is how to reproduce it. The set up is default latest WordPress, WooCommerce, WooCommerce Stripe Gateway and WooCommerce Subscriptions. Create a variable subscription product with one variation having a non-zero set up fee and zero recurring fee, and the other with a non-zero recurring fee. Add that product to the cart with the zero recurring fee variation and try to place an order. It fails. If you choose a variation with a recurring fee, the order is placed successfully.
The error was introduced in the new mandate feature release within ver 7.3. For subscriptions products it adds up all subscriptions recurring fees for the ?amount? field. If the order has only one product with a subscription has no recurring fee but has a set up fee, then the amount is zero, and stripe refuses to process the order.
That’s what the mandate part looks like in the request:
"payment_method_options": { "card": { "mandate_options": { "start_date": "1688476957", "interval_count": "1", "interval": "year", "amount_type": "fixed", "reference": "12345", "supported_types": { "0": "india" }, "amount": "0" } } },
Here is the response body:
{ "error": { "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]", ... "type": "invalid_request_error" } }
- The topic ‘Payment fails for certain subscription product configuration’ is closed to new replies.