0

On Drupal commerce 2 (Drupal 8), the default country for the site is Canada. But I have multiple currencies enabled. When the price for a product is entered as US dollars, after completing the payment process in a cart, the following message shows:

The website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 783 of core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php). Drupal\commerce_price\Price->add(Object) (Line: 44) Drupal\commerce_payment\PaymentOrderManager->updateTotalPaid(Object) (Line: 323) Drupal\commerce_payment\Entity\Payment->postSave(Object, ) (Line: 506) Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 658) Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 432) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 774) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 390) Drupal\Core\Entity\Entity->save() (Line: 113) Drupal\commerce_payment_example\Plugin\Commerce\PaymentGateway\Onsite->createPayment(Object, 1) (Line: 173) Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentProcess->buildPaneForm(Array, Object, Array) (Line: 558) Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase->buildForm(Array, Object, 'payment') call_user_func_array(Array, Array) (Line: 518) Drupal\Core\Form\FormBuilder->retrieveForm('commerce_checkout_flow_multistep_default', Object) (Line: 275) Drupal\Core\Form\FormBuilder->buildForm('commerce_checkout_flow_multistep_default', Object) (Line: 216) Drupal\Core\Form\FormBuilder->getForm(Object, 'payment') (Line: 94) Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 151) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

For testing purpose, I set up one payment gateway as Example(on-site) in test mode. I thought commerce 2 is able to handle multiple currencies out of the box. or are there any other modules or settings in order to handle multiple currencies on the same site? I also tried to create a store with default currency as USD, then order a product from this store but got the same error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.