enupal / stripe

Allows customers sign up for recurring and one-time payments with Stripe, perfect for orders, donations, subscriptions, and events. Create simple payment forms in seconds easily without coding. For Craft CMS
https://enupal.com/craft-plugins/stripe-payments/
Other
33 stars 19 forks source link

Can't upload or edit Payment Form #207

Closed jomotion11 closed 1 year ago

jomotion11 commented 3 years ago

Having trouble with payment form. It won't let me create new or edit forms. I get the error "Payment Form not found" or "Key "0" does not exist as the array is empty", which is odd because a form does exist.

Additional info

andrelopez commented 3 years ago

Hi @jomotion11 could you please recreate the issue and send back to us a zip file of the following folder? storage/logs

Please send the file to support@enupal.com

shifuma commented 1 year ago

I'm also getting this. Works fine locally, but on my staging site I'm getting Key "0" does not exist as the array is empty. when I create a new form. Going back to All Forms shows it was actually created, but trying to edit gives the same error.

2023-02-19 12:39:00 [web.ERROR] [Twig\Error\RuntimeError] Twig\Error\RuntimeError: Key "0" does not exist as the array is empty. in /webroot/daed86b3116754d8/vendor/enupal/stripe/src/templates/forms/_edit.twig:19
Stack trace:
#0 /webroot/daed86b3116754d8/vendor/craftcms/cms/src/helpers/Template.php(110): twig_get_attribute()
#1 /webroot/daed86b3116754d8/storage/runtime/compiled_templates/2e/2ef02dcc63810e7095b6f0a708680488.php(55): craft\helpers\Template::attribute()
#2 /webroot/daed86b3116754d8/vendor/twig/twig/src/Template.php(394): __TwigTemplate_a2c2292e99b934f72101921f0e3e9422->doDisplay()
#3 /webroot/daed86b3116754d8/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling()
#4 /webroot/daed86b3116754d8/vendor/twig/twig/src/Template.php(379): Twig\Template->display()
#5 /webroot/daed86b3116754d8/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render()
#6 /webroot/daed86b3116754d8/vendor/twig/twig/src/Environment.php(277): Twig\TemplateWrapper->render()
#7 /webroot/daed86b3116754d8/vendor/craftcms/cms/src/web/View.php(451): Twig\Environment->render()
#8 /webroot/daed86b3116754d8/vendor/craftcms/cms/src/web/View.php(504): craft\web\View->renderTemplate()
#9 /webroot/daed86b3116754d8/vendor/craftcms/cms/src/web/TemplateResponseFormatter.php(56): craft\web\View->renderPageTemplate()
#10 /webroot/daed86b3116754d8/vendor/yiisoft/yii2/web/Response.php(1098): craft\web\TemplateResponseFormatter->format()
#11 /webroot/daed86b3116754d8/vendor/craftcms/cms/src/web/Response.php(286): yii\web\Response->prepare()
#12 /webroot/daed86b3116754d8/vendor/yiisoft/yii2/web/Response.php(339): craft\web\Response->prepare()
#13 /webroot/daed86b3116754d8/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#14 /webroot/daed86b3116754d8/release/deployment_107_3d0f0e51/web/index.php(12): yii\base\Application->run()
#15 {main} {"memory":4250776,"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): Key \"0\" does not exist as the array is empty. at /webroot/daed86b3116754d8/vendor/enupal/stripe/src/templates/forms/_edit.twig:19)"} 

Not sure if it's related, but from Settings > Subscription Plans > Refresh Plans I get No plans were found in stripe. Check your Stripe Keys. I'm not sure if I need to do this at all, but my Stripe keys are definitely set correctly.

Craft 4.3.10 Stripe Payments 5.1.0

shifuma commented 1 year ago

Very odd by after setting the staging environment to production (and thus disabling allowAdminChanges I no longer get the error.

andrelopez commented 1 year ago

Possible related to https://github.com/enupal/stripe/issues/356 moving discussion to that ticket