Can't have log in and payment information panes on one checkout step

Created on 9 December 2020, about 4 years ago
Updated 16 July 2024, 5 months ago

Hi!

It might be commerce bug, of course, but seems to me that it's related to Email registration forms in the checkout pane.

Problem/Motivation

I have a one-step checkout form on Drupal Commerce and exactly one payment gateway. The flow is set up as in the attached image. Users should log in/register and then they should be immediately redirected to payment without taking any other steps. The registration part works: when I register a new user by entering the new email, user is created, logged in and redirected to the payment gateway. The log in part doesn't work though: when I try to log in as an existing user, this error is what I get:

Error: Call to a member function getPaymentGatewayId() on string в Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentInformation->submitPaneForm() (строка 377 из /var/www/web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php)

So it seems that this code the error refers to:

$values = $form_state->getValue($pane_form['#parents']);
/** @var \Drupal\commerce_payment\PaymentOption $selected_option */
$selected_option = $pane_form['#payment_options'][$values['payment_method']];

Is failing to figure out the payment gateway exactly when the user is logging in while checking out.

And when I provide the payment gateway manually (by hacking the PaymentInformation pane class) everything works fine.

Steps to reproduce

1. Set up Drupal Commerce.
2. Set up one payment gateway (for me it's https://www.drupal.org/project/commerce_rbspayment )
3. Put Login with email registration and Payment information panes to the Login step of the checkout flow (as shown on the image attached).
4. Try to log in (not register!) as existing user during the checkout.

Proposed resolution

Investigate.

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇷🇺Russia graker

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

Comments & Activities

Not all content is available!

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

  • 🇩🇪Germany Grevil

    Is this still the case for latest dev?

  • Status changed to Closed: cannot reproduce 5 months ago
  • 🇺🇸United States greggles Denver, Colorado, USA

    The commerce integration of email_registration is quite new and may not be fully featured enough yet to support this scenario. It also has been modified a bit recently so the question from comment #2 is quite relevant.

    I'm going to close this since the question in #2 was not yet answered. Please do reopen it if you have more information to provide.

    Thanks!

Production build 0.71.5 2024