When adding a payment gateway to a site, and selecting Stripe Payment Element we get "Oops, something went wrong. Check your browser's developer console for more details." due to the below warning being in the AJAX response:

Undefined array key "custom_label" in Drupal\commerce_stripe\Plugin\Commerce\PaymentGateway\StripePaymentElement->buildConfigurationForm() (line 283 of /var/core/www/modules/contrib/commerce_stripe/src/Plugin/Commerce/PaymentGateway/StripePaymentElement.php

Attaching a patch to fix...

CommentFileSizeAuthor
#2 3443187-custom-label-undefined-key.patch925 bytesmjpa
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mjpa created an issue. See original summary.

mjpa’s picture

Status: Active » Needs review
StatusFileSize
new925 bytes

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Needs review » Reviewed & tested by the community

@jsacksick , above patch fixed the issue , I have verified locally, also I created MR easy to merge, moving RTBC++

tomtech’s picture

Assigned: mjpa » tomtech

I'm not able to reproduce an issue with adding a payment gateway, though I do see the message logged to watchdog.

Something is obviously different between our environments, nonetheless, this is a simple fix that removes the error form occurring in the first place.

Thanks for the report and MR!

tomtech’s picture

Status: Reviewed & tested by the community » Fixed
tomtech’s picture

Title: Undefined array key "custom_label" in Drupal\commerce_stripe\Plugin\Commerce\PaymentGateway\StripePaymentElement->buildConfigurationForm() » Undefined array key "custom_label" when adding a new Stripe Payment Element payment gateway

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.