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.