Problem/Motivation
I try to pay with paypal credit card on site.
I try in sandbox and i use test credit card 371449635398431 (American Express)
Drupal 10.2.6
Commerce 2.39
Paypal 1.7
i get this error:
InvalidArgumentException: Field card_type is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 616 of /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
#0 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(597): Drupal\Core\Entity\ContentEntityBase->getTranslatedField('card_type', 'x-default')
#1 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(657): Drupal\Core\Entity\ContentEntityBase->get('card_type')
#2 /var/www/html/web/modules/contrib/commerce_paypal/src/Plugin/Commerce/PaymentGateway/Checkout.php(870): Drupal\Core\Entity\ContentEntityBase->set('card_type', 'amex')
#3 /var/www/html/web/modules/contrib/commerce/modules/payment/src/PluginForm/PaymentMethodAddForm.php(83): Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\Checkout->createPaymentMethod(Object(Drupal\commerce_payment\Entity\PaymentMethod), Array)
#4 /var/www/html/web/modules/contrib/commerce_paypal/src/PluginForm/Checkout/PaymentMethodAddForm.php(110): Drupal\commerce_payment\PluginForm\PaymentMethodAddForm->submitConfigurationForm(Array, Object(Drupal\Core\Form\FormState))
#5 /var/www/html/web/modules/contrib/commerce/modules/payment/src/Plugin/Commerce/InlineForm/PaymentGatewayForm.php(172): Drupal\commerce_paypal\PluginForm\Checkout\PaymentMethodAddForm->submitConfigurationForm(Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/html/web/modules/contrib/commerce/src/Plugin/Commerce/InlineForm/InlineFormBase.php(159): Drupal\commerce_payment\Plugin\Commerce\InlineForm\PaymentGatewayForm->submitInlineForm(Array, Object(Drupal\Core\Form\FormState))
#7 [internal function]: Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::runSubmit(Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/html/web/modules/contrib/commerce/src/Element/CommerceElementTrait.php(141): call_user_func_array(Array, Array)
#9 /var/www/html/web/modules/contrib/commerce/src/Element/CommerceElementTrait.php(134): Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#10 /var/www/html/web/modules/contrib/commerce/src/Element/CommerceElementTrait.php(134): Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#11 /var/www/html/web/modules/contrib/commerce/src/Element/CommerceElementTrait.php(86): Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#12 [internal function]: Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::executeElementSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#13 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array(Array, Array)
#14 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(275): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
#15 /var/www/html/web/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'commerce_checko...')
#16 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(605): Drupal\Core\Form\FormValidator->validateForm('commerce_checko...', Array, Object(Drupal\Core\Form\FormState))
#17 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm('commerce_checko...', Array, Object(Drupal\Core\Form\FormState))
#18 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(224): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), Object(Drupal\Core\Form\FormState))
#19 /var/www/html/web/modules/contrib/commerce/modules/checkout/src/Controller/CheckoutController.php(143): Drupal\Core\Form\FormBuilder->getForm(Object(Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault), 'order_informati...')
#20 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object(Drupal\Core\Routing\RouteMatch))
#21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#22 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#24 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#25 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#39 {main}
Thank you
Steps to reproduce
Complete checkout with PayPal Checkout (Preferred) metothod.