[2.x] The "disabled" state of the field is not fully respected

Created on 17 June 2021, over 3 years ago
Updated 29 November 2024, about 2 months ago

Problem/Motivation

When the "stripe" field is marked as disabled the processStripe method is fully executed and the with the use of the STRIPE API a payment_intent is created.

In addition to this the Stripe Card (iframe) is rendered it intervene in the submissions process. The sumbission process do not complete properly.

Steps to reproduce

Use example form that comes with the stripe module and mark the card element as #disabled

    $form['card'] = [
      '#type' => 'stripe',
      '#title' => $this->t('Credit card'),
      '#description' => $this->t('You can use test card numbers and tokens from @link.', [
        '@link' => $link_generator->generate('stripe docs', Url::fromUri('https://stripe.com/docs/testing')),
      ]),
      '#stripe_paymentintent_unique' => TRUE,
      '#stripe_currency' => 'eur',
      '#disabled' =>  TRUE
    ];

The form is availabe in the path:

  • /stripe_examples/form/simple_checkout

Proposed resolution

If the element is marked as #disabled render just a disabled input field with a placehodler.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇬🇷Greece skounis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024