InvalidArgumentException: Field card_type is unknown

Created on 28 May 2024, 6 months ago
Updated 29 May 2024, 6 months ago

Describe your bug or feature request.

New installation.
Drupal 10.2.6
Commerce 2.39
Commerce PayPal 1.7
When i try to pay with paypal i get this error:

The website encountered an unexpected error. Try again later.

InvalidArgumentException: Field card_type is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 616 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get('card_type') (Line: 657)
Drupal\Core\Entity\ContentEntityBase->set('card_type', 'visa') (Line: 870)
Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\Checkout->createPaymentMethod(Object, Array) (Line: 83)
Drupal\commerce_payment\PluginForm\PaymentMethodAddForm->submitConfigurationForm(Array, Object) (Line: 110)
Drupal\commerce_paypal\PluginForm\Checkout\PaymentMethodAddForm->submitConfigurationForm(Array, Object) (Line: 172)
Drupal\commerce_payment\Plugin\Commerce\InlineForm\PaymentGatewayForm->submitInlineForm(Array, Object) (Line: 159)
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::runSubmit(Array, Object)
call_user_func_array(Array, Array) (Line: 141)
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object) (Line: 134)
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object) (Line: 134)
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::doExecuteSubmitHandlers(Array, Object) (Line: 86)
Drupal\commerce\Plugin\Commerce\InlineForm\InlineFormBase::executeElementSubmitHandlers(Array, Object)
call_user_func_array(Array, Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'commerce_checkout_flow_multistep_default') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 605)
Drupal\Core\Form\FormBuilder->processForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 224)
Drupal\Core\Form\FormBuilder->getForm(Object, 'order_information') (Line: 143)
Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

If a bug, provide steps to reproduce it from a clean install.

Install drupal
Install commerce
install paypal

Create store and product
Configure payment gateway, select PayPal Checkout (Preferred) and accept credit cards.

Go to product, add to cart and complete checkout.

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

PayPal Checkout

Created by

🇮🇹Italy trickfun

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

Comments & Activities

Production build 0.71.5 2024