diff -u b/modules/payment/src/Controller/PaymentCheckoutController.php b/modules/payment/src/Controller/PaymentCheckoutController.php --- b/modules/payment/src/Controller/PaymentCheckoutController.php +++ b/modules/payment/src/Controller/PaymentCheckoutController.php @@ -7,7 +7,7 @@ use Drupal\commerce_order\Entity\OrderInterface; use Drupal\commerce_payment\Exception\PaymentGatewayException; use Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\OffsitePaymentGatewayInterface; -use Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsCreatingOffsitePaymentMethodsOnCheckoutInterface; +use Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\SupportsStoredPaymentMethodsInterface; use Drupal\Core\Access\AccessException; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; @@ -107,7 +107,7 @@ $checkout_flow = $order->get('checkout_flow')->entity; $checkout_flow_plugin = $checkout_flow->getPlugin(); - if ($payment_gateway_plugin instanceof SupportsCreatingOffsitePaymentMethodsOnCheckoutInterface) { + if ($payment_gateway_plugin instanceof SupportsStoredPaymentMethodsInterface) { try { $payment_method_storage = $this->entityTypeManager->getStorage('commerce_payment_method'); /** @var \Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method */ @@ -125,7 +125,7 @@ 'payment_gateway_mode' => $payment_gateway_plugin->getMode(), ]); // In case payment gateway supports payment method. - $payment_gateway_plugin->createPaymentMethod($payment_method, $order, $request); + $payment_gateway_plugin->createPaymentMethod($payment_method, ['order' => $order, 'request' => $request]); // Add payment method to the order. $order->set('payment_method', $payment_method); reverted: --- b/modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsCreatingOffsitePaymentMethodsOnCheckoutInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -card_type = CreditCard::detectType($request->query->get('cardprefix'))->getId(); $payment_method->card_number = substr($request->query->get('cardnomask'), -4); $payment_method->card_exp_month = substr($request->query->get('cardexpdate'), 0, 2);