Loading modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php +12 −4 Original line number Diff line number Diff line Loading @@ -207,16 +207,24 @@ class PaymentInformation extends CheckoutPaneBase { // Store the options for submitPaneForm(). $pane_form['#payment_options'] = $options; $default_payment_gateway_id = $default_option->getPaymentGatewayId(); $payment_gateway = $payment_gateways[$default_payment_gateway_id]; $payment_gateway_plugin = $payment_gateway->getPlugin(); // If this is an existing payment method, return the pane form. // Editing payment methods at checkout is not supported. if ($default_option->getPaymentMethodId()) { $payment_method_storage = $this->entityTypeManager->getStorage('commerce_payment_method'); /** @var \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method */ $payment_method = $payment_method_storage->load($default_option->getPaymentMethodId()); // If the payment method hasn't been tokenized yet, allow updating the // billing information. if (empty($payment_method->getRemoteId()) && $payment_gateway_plugin->collectsBillingInformation()) { $pane_form = $this->buildBillingProfileForm($pane_form, $form_state); } return $pane_form; } $default_payment_gateway_id = $default_option->getPaymentGatewayId(); $payment_gateway = $payment_gateways[$default_payment_gateway_id]; $payment_gateway_plugin = $payment_gateway->getPlugin(); // If this payment gateway plugin supports creating tokenized payment // methods before processing payment, we build the "add-payment-method" // plugin form. Loading modules/promotion/tests/src/FunctionalJavascript/CouponRedemptionPaneTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ class CouponRedemptionPaneTest extends CommerceWebDriverTestBase { 'uid' => $this->adminUser->id(), 'type' => 'credit_card', 'payment_gateway' => 'onsite', 'remote_id' => '123456', 'card_type' => 'visa', 'card_number' => '1111', 'billing_profile' => $profile, Loading @@ -151,6 +152,7 @@ class CouponRedemptionPaneTest extends CommerceWebDriverTestBase { $payment_method2 = $this->createEntity('commerce_payment_method', [ 'type' => 'credit_card', 'payment_gateway' => 'onsite', 'remote_id' => '123456', 'card_type' => 'visa', 'card_number' => '9999', 'billing_profile' => $profile, Loading Loading
modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php +12 −4 Original line number Diff line number Diff line Loading @@ -207,16 +207,24 @@ class PaymentInformation extends CheckoutPaneBase { // Store the options for submitPaneForm(). $pane_form['#payment_options'] = $options; $default_payment_gateway_id = $default_option->getPaymentGatewayId(); $payment_gateway = $payment_gateways[$default_payment_gateway_id]; $payment_gateway_plugin = $payment_gateway->getPlugin(); // If this is an existing payment method, return the pane form. // Editing payment methods at checkout is not supported. if ($default_option->getPaymentMethodId()) { $payment_method_storage = $this->entityTypeManager->getStorage('commerce_payment_method'); /** @var \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method */ $payment_method = $payment_method_storage->load($default_option->getPaymentMethodId()); // If the payment method hasn't been tokenized yet, allow updating the // billing information. if (empty($payment_method->getRemoteId()) && $payment_gateway_plugin->collectsBillingInformation()) { $pane_form = $this->buildBillingProfileForm($pane_form, $form_state); } return $pane_form; } $default_payment_gateway_id = $default_option->getPaymentGatewayId(); $payment_gateway = $payment_gateways[$default_payment_gateway_id]; $payment_gateway_plugin = $payment_gateway->getPlugin(); // If this payment gateway plugin supports creating tokenized payment // methods before processing payment, we build the "add-payment-method" // plugin form. Loading
modules/promotion/tests/src/FunctionalJavascript/CouponRedemptionPaneTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,7 @@ class CouponRedemptionPaneTest extends CommerceWebDriverTestBase { 'uid' => $this->adminUser->id(), 'type' => 'credit_card', 'payment_gateway' => 'onsite', 'remote_id' => '123456', 'card_type' => 'visa', 'card_number' => '1111', 'billing_profile' => $profile, Loading @@ -151,6 +152,7 @@ class CouponRedemptionPaneTest extends CommerceWebDriverTestBase { $payment_method2 = $this->createEntity('commerce_payment_method', [ 'type' => 'credit_card', 'payment_gateway' => 'onsite', 'remote_id' => '123456', 'card_type' => 'visa', 'card_number' => '9999', 'billing_profile' => $profile, Loading