View Issue Details

IDProjectCategoryView StatusLast Update
0007771module PayPal Checkoutmodule PayPal checkout - subpublic2025-03-11 09:41
ReporterOxidSimonGassenschmidt Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.5.2 / 3.5.2 
Summary0007771: additional decimal for a currency - formating
DescriptionYou can change the formating of Currencys for formating in Master Settings -> Core Settings -> Settings -> Add or remove currencies:
then you cannot make paypal orders anymore.
Steps To ReproduceChange the decimal number like

EUR@ 1.00@ ,@ .@ €@ 2

->

EUR@ 1.00@ ,@ .@ €@ 6
Additional Information [2025-02-20 09:44:37] PayPal Payment Logger.ERROR: API Error. ["[object] (OxidSolutionCatalysts\\PayPalApi\\Exception\\ApiException(code: 422): POST https://api.sandbox.paypal.com/v2/checkout/orders returned: 422 Unprocessable Entity\nReturned Message: The requested action could not be performed, semantically incorrect, or failed business validation.\nError Details: \n[{\"field\":\"\\/purchase_units\\/@reference_id=='OXID_REFERENCE'\\/amount\\/value\",\"value\":\"131.255\",\"issue\":\"DECIMAL_PRECISION\",\"description\":\"If the currency supports decimals, only two decimal place precision is supported.\"}]\n\nResponse: \n{\"name\":\"UNPROCESSABLE_ENTITY\",\"debug_id\":\"92595face3761\",\"links\":[{\"href\":\"https:\\/\\/developer.paypal.com\\/api\\/rest\\/reference\\/orders\\/v2\\/errors\\/#DECIMAL_PRECISION\",\"rel\":\"information_link\",\"method\":\"GET\"}]}\n\nThe following curl request could be used to simulate a similar request:\n \ncurl -v -X POST \"https://api.sandbox.paypal.com/v2/checkout/orders\" -H \"User-Agent: GuzzleHttp/7\" -H \"Host: api.sandbox.paypal.com\" -H \"Content-Type: application/json\" -H \"PayPal-Partner-Attribution-Id: Oxid_Cart_Payments\" -H \"PayPal-Client-Metadata-Id: \" -H \"Prefer: return=minimal\" -H \"PayPal-Request-Id: 184d30fbbead3906e158feaa55de5e11\" -H \"Authorization: Bearer A21AALP2ZcOrmfTSswZUzu5JhgC8d2uKYwI2wBGZL8IVoxAYy2UuJ7ZglfXlnNw9H-ZOVK4tqPlBo7w4BMSlL2AFXV6BZmzrw\" -d {\"intent\":\"CAPTURE\",\"processing_instruction\":\"NO_INSTRUCTION\",\"payer\":{\"email_address\":\"[email protected]\",\"name\":{\"given_name\":\"a\",\"surname\":\"a\"},\"address\":{\"address_line_1\":\"b b\",\"address_line_2\":\" \",\"admin_area_2\":\"c\",\"postal_code\":\"c\",\"country_code\":\"DE\"}},\"purchase_units\":[{\"reference_id\":\"OXID_REFERENCE\",\"amount\":{\"currency_code\":\"EUR\",\"value\":131.255,\"breakdown\":{\"item_total\":{\"currency_code\":\"EUR\",\"value\":\"130.900000\"},\"shipping\":{\"currency_code\":\"EUR\",\"value\":\"6.900000\"},\"tax_total\":{\"currency_code\":\"EUR\",\"value\":\"0.000000\"},\"discount\":{\"currency_code\":\"EUR\",\"value\":\"6.545000\"}}},\"description\":\"Zahlung bei OXID eShop 6\",\"items\":[{\"name\":\"Kiteboard CABRINHA CALIBER\",\"unit_amount\":{\"currency_code\":\"EUR\",\"value\":\"130.900000\"},\"tax\":{\"currency_code\":\"EUR\",\"value\":\"0.000000\"},\"quantity\":\"1\",\"tax_rate\":\"0\",\"category\":\"PHYSICAL_GOODS\"}],\"shipping\":{\"name\":{\"full_name\":\"a a\"},\"address\":{\"address_line_1\":\"b b\",\"address_line_2\":\" \",\"admin_area_2\":\"c\",\"postal_code\":\"c\",\"country_code\":\"DE\"}}}],\"application_context\":{\"brand_name\":\"OXID eShop 6\",\"landing_page\":\"LOGIN\",\"shipping_preference\":\"GET_FROM_FILE\",\"user_action\":\"PAY_NOW\",\"return_url\":\"https:\\/\\/t2.oxid.academy\\/index.php?cl=order&fnc=finalizepaypalsession\",\"cancel_url\":\"https:\\/\\/t2.oxid.academy\\/index.php?cl=order&fnc=cancelpaypalsession\",\"vault\":false}} at /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-client/src/Service/BaseService.php:62)\n[stacktrace]\n#0 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-client/generated/Service/Orders.php(51): OxidSolutionCatalysts\\PayPalApi\\Service\\BaseService->send('POST', '/orders', Array, Array, '{\"intent\":\"CAPT...')\n#1 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Service/Payment.php(143): OxidSolutionCatalysts\\PayPalApi\\Service\\Orders->createOrder(Object(OxidSolutionCatalysts\\PayPalApi\\Model\\Orders\\OrderRequest), 'Oxid_Cart_Payme...', '', 'return=minimal')\n#2 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Service/Payment.php(585): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doCreatePayPalOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), 'CAPTURE', 'PAY_NOW', NULL, NULL, '', 'Oxid_Cart_Payme...', 'https://t2.oxid...', 'https://t2.oxid...', false)\n#3 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Model/Order.php(295): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doExecuteStandardPayment(Object(OxidSolutionCatalysts\\PayPal\\Model\\Order), Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), 'CAPTURE')\n#4 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/Order.php(532): OxidSolutionCatalysts\\PayPal\\Model\\Order->_executePayment(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), Object(OxidEsales\\Eshop\\Application\\Model\\UserPayment))\n#5 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Model/Order.php(638): OxidEsales\\EshopCommunity\\Application\\Model\\Order->finalizeOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), Object(OxidSolutionCatalysts\\PayPal\\Model\\User), false)\n#6 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Controller/OrderController.php(219): OxidSolutionCatalysts\\PayPal\\Model\\Order->finalizeOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), Object(OxidSolutionCatalysts\\PayPal\\Model\\User))\n#7 /var/www/oxideshop/vendor/oxid-esales/unzer/src/Controller/OrderController.php(99): OxidEsales\\EshopCommunity\\Application\\Controller\\OrderController->execute()\n#8 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidSolutionCatalysts\\Unzer\\Controller\\OrderController->execute()\n#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('execute')\n#10 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('execute')\n#11 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(280): OxidEsales\\EshopCommunity\\Core\\ShopControl->executeAction(Object(OxidSolutionCatalysts\\PayPal\\Controller\\OrderController), 'execute')\n#12 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'execute', NULL, NULL)\n#13 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#14 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#15 {main}\n"] []
TagsNo tags attached.

Activities

mario_lorenz

2025-02-27 13:52

developer   ~0017833

Hello @OxidSimonGassenschmidt, Our research has shown that PayPal can only work with an accuracy of 2 decimal places. This means that we can only pass on the shopping cart total rounded to two decimal places. Furthermore, further rounding errors arise when transferring item positions.

Therefore, our solution can only be:

If more than 2 decimal places are used in the current currency, two things will happen in the case of PayPal:

1) The shopping cart total will be rounded to 2 decimal places so that no API errors arise

2) As with Netto Mode, no items will be passed on to PayPal as this will cause further rounding errors.

With this adjustment, payment with PayPal is possible again.

If everyone agrees, we will implement it this way.

Mark.Schuette

2025-03-11 09:41

manager   ~0017859

This ticket has been resolved. The fix is included in v2.5.3-rc2 and will be available in all future releases. We are working on several paypal topics right now, which will be released in a bigger release as soon as possible.