When upgrading from 2.1 to 2.3.5, I am now getting the following error when I try to create a new cart rule:

[2020-09-19 15:53:49] main.CRITICAL: Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 {"exception":"[object] (Exception(code: 0): Notice: Undefined index: rule_id in /var/www/html/magento2/vendor/stripe/module-payments/Observer/CouponEditObserver.php on line 29 at /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61)"} []

I emailed stripe support and they've told me it's not them. Any help would be appreciated. Thank you.

  • Same issue with magento 2.4. did you find a solution?
    – Donato P
    Sep 22, 2020 at 6:53
  • No sorry, not yet. I'll reply here when I do. Hopefully someone will be able to help.
    – deicul
    Sep 24, 2020 at 1:48

1 Answer 1


This error related to Stripe Payment extension, when you upgrade Magento from 2.1 to 2.3.5, you have to change PHP version to 7.2 or 7.3 then the error will be happened. The easy way is change the code around line 29 in vendor/stripe/module-payments/Observer/CouponEditObserver.php

if (!isset($data['rule_id']) || !is_numeric($data['rule_id']))

instead of

if (!is_numeric($data['rule_id']))
  • Apologies for the late reply. Only just got around to this. Thank you so much! This fixed the issue for me.
    – deicul
    Dec 9, 2020 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.