View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007449 | module PayPal Checkout | module PayPal checkout - sub | public | 2023-03-23 15:04 | 2023-05-10 15:12 |
Reporter | OxidSimonGassenschmidt | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2.2.3 / 1.2.3 | ||||
Target Version | Fixed in Version | 2.3.0 / 1.3.0 | |||
Summary | 0007449: Surcharges with negative Discounts are not forseen | ||||
Description | Surcharges with negative Discounts are not forseen and lead to failed api calls similar to 7447 | ||||
Steps To Reproduce | 1. install and configurate ee 2. install and configurate paypal checkout 3. create a new discount with negative value, so you have a surcharges (don't reuse demo-data discount, those are buggys and don't lead to general basekt disount) 4. try to create an order | ||||
Additional Information | [2023-03-23 14:26:45] OXID Logger.ERROR: Api error on order create call. CANNOT_BE_NEGATIVE ["[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\\/breakdown\\/discount\\/value\",\"value\":\"-399.50\",\"issue\":\"CANNOT_BE_NEGATIVE\",\"description\":\"Must be greater than or equal to 0. If the currency supports decimals, only two decimal place precision is supported.\"}]\n\nResponse: \n{\"name\":\"UNPROCESSABLE_ENTITY\",\"debug_id\":\"fed9bc8b5b5fa\",\"links\":[{\"href\":\"https:\\/\\/developer.paypal.com\\/docs\\/api\\/orders\\/v2\\/#error-CANNOT_BE_NEGATIVE\",\"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: \" -H \"PayPal-Client-Metadata-Id: \" -H \"Prefer: return=minimal\" -H \"Authorization: Bearer A21AAJ1x6t1ovly1_q0fV-7uaDidBH0EBCMI-ttKnieO00H-Pdn4ZinXGKzKwj0B7KNkMEhq169W3ctaEITym_rpK0OQisEbg\" -d {\"intent\":\"CAPTURE\",\"processing_instruction\":\"NO_INSTRUCTION\",\"payer\":{\"email_address\":\"[email protected]\",\"name\":{\"given_name\":\"s\",\"surname\":\"g\"},\"address\":{\"address_line_1\":\"Bertholdstra\\u00dfe 48\",\"address_line_2\":\" \",\"admin_area_2\":\"Freiburg\",\"postal_code\":\"79199\",\"country_code\":\"DE\"}},\"purchase_units\":[{\"reference_id\":\"OXID_REFERENCE\",\"amount\":{\"currency_code\":\"EUR\",\"value\":\"1200.50\",\"breakdown\":{\"item_total\":{\"currency_code\":\"EUR\",\"value\":\"801.00\"},\"tax_total\":{\"currency_code\":\"EUR\",\"value\":\"0.00\"},\"discount\":{\"currency_code\":\"EUR\",\"value\":\"-399.50\"}}},\"description\":\"Zahlung bei OXID eShop 6\",\"shipping\":{\"name\":{\"full_name\":\"s g\"},\"address\":{\"address_line_1\":\"Bertholdstra\\u00dfe 48\",\"address_line_2\":\" \",\"admin_area_2\":\"Freiburg\",\"postal_code\":\"79199\",\"country_code\":\"DE\"}}}],\"application_context\":{\"brand_name\":\"OXID eShop 6\",\"landing_page\":\"LOGIN\",\"shipping_preference\":\"SET_PROVIDED_ADDRESS\",\"user_action\":\"CONTINUE\",\"vault\":false}} at /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-client/src/Service/BaseService.php:45)\n[stacktrace]\n#0 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-client/generated/Service/Orders.php(55): 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(142): OxidSolutionCatalysts\\PayPalApi\\Service\\Orders->createOrder(Object(OxidSolutionCatalysts\\PayPalApi\\Model\\Orders\\OrderRequest), '', '', 'return=minimal', '')\n#2 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Service/Payment.php(177): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doCreatePayPalOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), 'CAPTURE', 'CONTINUE', NULL, NULL, '', '', '', NULL, NULL, false)\n#3 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Controller/OrderController.php(149): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doCreatePatchedOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket))\n#4 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidSolutionCatalysts\\PayPal\\Controller\\OrderController->createAcdcOrder()\n#5 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('createAcdcOrder')\n#6 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('createAcdcOrder')\n#7 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(280): OxidEsales\\EshopCommunity\\Core\\ShopControl->executeAction(Object(OxidSolutionCatalysts\\PayPal\\Controller\\OrderController), 'createAcdcOrder')\n#8 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'createAcdcOrder', NULL, NULL)\n#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#10 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#11 {main}\n"] [] | ||||
Tags | No tags attached. | ||||