You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears to be an issue if your default API version is pre 2018-02-05 as per the notes below. It is probably worth including for anyone whom also runs into this issue in the future. As per the below Stripe upgrade changelog and thread below:
Description
I am unable to add a subscription plan in Craft CMS. I have connected the Stripe gateway and added the plans in Stripe.
2023-10-04 01:00:21 [web.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Undefined array key "prod_OkopYDnI55jTxu" in /Users/cloudgray/Sites/cloudgray/vendor/craftcms/commerce-stripe/src/base/SubscriptionGateway.php:319
Stack trace:
#0 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError(2, 'Undefined array...', '/Users/cloudgra...', 319)
#1 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/commerce-stripe/src/base/SubscriptionGateway.php(319): craft\web\ErrorHandler->handleError(2, 'Undefined array...', '/Users/cloudgra...', 319)
#2 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/commerce-stripe/src/base/SubscriptionGateway.php(169): craft\commerce\stripe\base\SubscriptionGateway->getSubscriptionPlans()
#3 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Extension/CoreExtension.php(1607): craft\commerce\stripe\base\SubscriptionGateway->getPlanSettingsHtml(Array)
#4 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/helpers/Template.php(129): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\commerce\stripe\gateways\PaymentIntents), 'getPlanSettings...', Array, 'method', false, false)
#5 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/6c/6c15026ee13c21bf7cdd664efbc82229.php(211): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig\Source), Object(craft\commerce\stripe\gateways\PaymentIntents), 'getPlanSettings...', Array, 'method')
#6 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(171): __TwigTemplate_11b536b9ae46435c12ae4a48be1dfebb->block_content(Array, Array)
#7 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/42/42eb15a4248a946a53ab965a5b970fdb.php(645): Twig\Template->displayBlock('content', Array, Array)
#8 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(171): __TwigTemplate_0de4246bd403274546fb05b684736d9c->block_main(Array, Array)
#9 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/42/42eb15a4248a946a53ab965a5b970fdb.php(377): Twig\Template->displayBlock('main', Array, Array)
#10 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(171): __TwigTemplate_0de4246bd403274546fb05b684736d9c->block_body(Array, Array)
#11 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/18/185f9adf97586373fa3335313169410c.php(94): Twig\Template->displayBlock('body', Array, Array)
#12 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(394): __TwigTemplate_34a4d99b91a652bace4a4544cca977f0->doDisplay(Array, Array)
#13 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#14 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/17/17de2de2e9140cf987ed4ab0fced98f3.php(56): Twig\Template->display(Array, Array)
#15 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(394): __TwigTemplate_f9b9604113d7b7261f384fa3d01b1eee->doDisplay(Array, Array)
#16 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#17 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/42/42eb15a4248a946a53ab965a5b970fdb.php(180): Twig\Template->display(Array, Array)
#18 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(394): __TwigTemplate_0de4246bd403274546fb05b684736d9c->doDisplay(Array, Array)
#19 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#20 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/39/39fc035e142b61ef1359e591c1a41ef8.php(45): Twig\Template->display(Array, Array)
#21 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(394): __TwigTemplate_1e7d9abce4f32f2e6d32f93522a1c19a->doDisplay(Array, Array)
#22 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#23 /Users/cloudgray/Sites/cloudgray/storage/runtime/compiled_templates/6c/6c15026ee13c21bf7cdd664efbc82229.php(71): Twig\Template->display(Array, Array)
#24 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(394): __TwigTemplate_11b536b9ae46435c12ae4a48be1dfebb->doDisplay(Array, Array)
#25 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#26 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#27 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render(Array, Array)
#28 /Users/cloudgray/Sites/cloudgray/vendor/twig/twig/src/Environment.php(277): Twig\TemplateWrapper->render(Array)
#29 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/web/View.php(474): Twig\Environment->render('commerce/store-...', Array)
#30 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/web/View.php(527): craft\web\View->renderTemplate('commerce/store-...', Array)
#31 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(56): craft\web\View->renderPageTemplate('commerce/store-...', Array, 'cp')
#32 /Users/cloudgray/Sites/cloudgray/vendor/yiisoft/yii2/web/Response.php(1100): craft\web\TemplateResponseFormatter->format(Object(craft\web\Response))
#33 /Users/cloudgray/Sites/cloudgray/vendor/craftcms/cms/src/web/Response.php(337): yii\web\Response->prepare()
#34 /Users/cloudgray/Sites/cloudgray/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#35 /Users/cloudgray/Sites/cloudgray/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#36 /Users/cloudgray/Sites/cloudgray/web/index.php(12): yii\base\Application->run()
#37 {main} {"memory":48720320,"exception":"[object] (yii\base\ErrorException(code: 2): Undefined array key "prod_OkopYDnI55jTxu" at /Users/cloudgray/Sites/cloudgray/vendor/craftcms/commerce-stripe/src/base/SubscriptionGateway.php:319)"}
Additional info
The text was updated successfully, but these errors were encountered: