View Issue Details

IDProjectCategoryView StatusLast Update
0007394module PayPal Checkoutmodule PayPal checkout - subpublic2023-01-24 09:54
ReporterSteven 
PriorityhighSeveritycriticalReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.2.2 / 1.2.2 
Target Version2.2.4 / 1.2.4Fixed in Version2.2.3 / 1.2.3 
Summary0007394: Price reduction by payment method blocks order
DescriptionIn the shop you can set a price surcharge or reduction for a payment method. When setting a surcharge, everything works fine, but using a reduction blocks the finalization of the order. A error message is shown to the user:

- The payment authorization failed. Please verify your input! -

Or if you are using PayPal's credit card you are also blocked with message:

- Payment process was stopped due to security reasons. Please enter your credit card data again and press submit button once. -

Error AMOUNT_MISMATCH is written to the log. See additional note for full log entry.
Steps To Reproduce- Log in to administration area.
- Navigate to Shop Settings > Payment Methods.
- Select PayPal.
- Set Price Surcharge/Reduction (€) to a negative value, like -2.
- Add item to basket.
- Start checkout and choose PayPal as payment method.
- The price reduction is displayed correctly underneath the payment method.
- Continue to final order step.
- The price reduction is displayed correctly in the price summary.
- Click button Order now.

You are transfered back to Step 3 with error message.
You are unable to order with PayPal.
TagsNo tags attached.

Activities

Steven

2022-12-19 09:35

reporter   ~0014964

[2022-12-16 16:59:38] OXID Logger.ERROR: Api error on order create call. AMOUNT_MISMATCH ["[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\":\"704.72\",\"issue\":\"AMOUNT_MISMATCH\",\"description\":\"Should equal item_total + tax_total + shipping + handling + insurance - shipping_discount - discount.\"}]\n\nResponse: \n{\"name\":\"UNPROCESSABLE_ENTITY\",\"debug_id\":\"6159cd305b20e\",\"links\":[{\"href\":\"https:\\/\\/developer.paypal.com\\/docs\\/api\\/orders\\/v2\\/#error-AMOUNT_MISMATCH\",\"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 \"Authorization: Bearer A21AAJsVnvwv2S1-mnAMDEnT8DUpqxWtrpzX30BUpqB4oCMrkObKkIgjh9UkK5Oezj5N9DzqfS-DfUX9HBM0ink7ffEMxq6gg\" -d {\"intent\":\"CAPTURE\",\"processing_instruction\":\"NO_INSTRUCTION\",\"payer\":{\"email_address\":\"[email protected]\",\"name\":{\"given_name\":\"Marc\",\"surname\":\"Muster\"},\"address\":{\"address_line_1\":\"Hauptstr. 13\",\"address_line_2\":\" \",\"admin_area_2\":\"Freiburg\",\"postal_code\":\"79098\",\"country_code\":\"DE\"}},\"purchase_units\":[{\"reference_id\":\"OXID_REFERENCE\",\"amount\":{\"currency_code\":\"EUR\",\"value\":\"704.72\",\"breakdown\":{\"item_total\":{\"currency_code\":\"EUR\",\"value\":\"704.72\"},\"tax_total\":{\"currency_code\":\"EUR\",\"value\":\"0.00\"},\"discount\":{\"currency_code\":\"EUR\",\"value\":\"14.38\"}}},\"description\":\"Zahlung bei OXID eShop 6\",\"shipping\":{\"name\":{\"full_name\":\"Marc Muster\"},\"address\":{\"address_line_1\":\"Hauptstr. 13\",\"address_line_2\":\" \",\"admin_area_2\":\"Freiburg\",\"postal_code\":\"79098\",\"country_code\":\"DE\"}}}],\"application_context\":{\"brand_name\":\"OXID eShop 6\",\"landing_page\":\"LOGIN\",\"shipping_preference\":\"SET_PROVIDED_ADDRESS\",\"user_action\":\"CONTINUE\",\"return_url\":\"https:\\/\\/sp.oxid.academy\\/index.php?cl=order&fnc=finalizepaypalsession\",\"cancel_url\":\"https:\\/\\/sp.oxid.academy\\/index.php?cl=order&fnc=cancelpaypalsession\",\"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), 'Oxid_Cart_Payme...', '', 'return=minimal', '')\n#2 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Service/Payment.php(498): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doCreatePayPalOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), 'CAPTURE', NULL, NULL, NULL, '', '', 'Oxid_Cart_Payme...', 'https://sp.oxid...', 'https://sp.oxid...', false)\n#3 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Model/Order.php(286): 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(601): 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/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidEsales\\EshopCommunity\\Application\\Controller\\OrderController->execute()\n#8 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('execute')\n#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('execute')\n#10 /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#11 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'execute', NULL, NULL)\n#12 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#13 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#14 {main}\n"] []
[2022-12-16 16:59:38] OXID Logger.ERROR: Could not create PayPal order. ["[object] (OxidSolutionCatalysts\\PayPal\\Exception\\PayPalException(code: 0): Could not create PayPal order. at /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Exception/PayPalException.php:16)\n[stacktrace]\n#0 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Service/Payment.php(505): OxidSolutionCatalysts\\PayPal\\Exception\\PayPalException::createPayPalOrderFail()\n#1 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Model/Order.php(286): OxidSolutionCatalysts\\PayPal\\Service\\Payment->doExecuteStandardPayment(Object(OxidSolutionCatalysts\\PayPal\\Model\\Order), Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), 'CAPTURE')\n#2 /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#3 /var/www/oxideshop/vendor/oxid-solution-catalysts/paypal-module/src/Model/Order.php(601): OxidEsales\\EshopCommunity\\Application\\Model\\Order->finalizeOrder(Object(OxidSolutionCatalysts\\PayPal\\Model\\Basket), Object(OxidSolutionCatalysts\\PayPal\\Model\\User), false)\n#4 /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#5 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidEsales\\EshopCommunity\\Application\\Controller\\OrderController->execute()\n#6 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('execute')\n#7 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('execute')\n#8 /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#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'execute', NULL, NULL)\n#10 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#11 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#12 {main}\n"] []

QA

2022-12-19 15:39

administrator   ~0014966

Last edited: 2022-12-19 15:43

View 2 revisions

While using PayPal Express instead of normal PayPal, you are able to finish the order. The payment reduction is noted in the shop order overview, but seems not to be transfered to PayPal, since the PayPal Developer Dashboard does not show the reduction, but the total cost excluding the reduction instead.

[sp]