Skip to content

Recurring UNPROCESSABLE_ENTITY Exception during checkout submission due to unhandled PAYER_ACTION_REQUIRED status #759

Description

@dmf-janw

Shopware Version

6.7.10.2

PayPal plugin version

10.7.0

Actual behaviour

We regularly see failing payments made via PayPal. Failures always show this exception in our logs:

var/log/prod-2026-07-27.log:[2026-07-27T05:41:00.456717+00:00] app.ERROR: An error occurred during processing the payment {"orderTransactionId":"XXXXX","exceptionMessage":"The error \"UNPROCESSABLE_ENTITY\" occurred with the following message: The requested action could not be performed, semantically incorrect, or failed business validation. | [PAYER_ACTION_REQUIRED] Payer needs to perform the following action before proceeding with payment.","exceptionTrace":"#0 /XXXXX/vendor/store.shopware.com/swagpaypal/src/RestApi/RequestService.php(31): Swag\\PayPal\\RestApi\\Exception\\PayPalApiException::from()
#1 /XXXXX/vendor/shopware/paypal-sdk/src/Gateway/AbstractGateway.php(51): Swag\\PayPal\\RestApi\\RequestService->handleResponse()
#2 /XXXXX/vendor/shopware/paypal-sdk/src/Gateway/OrderGateway.php(55): Shopware\\PayPalSDK\\Gateway\\AbstractGateway->request()
#3 /XXXXX/vendor/store.shopware.com/swagpaypal/src/RestApi/V2/Resource/OrderResource.php(85): Shopware\\PayPalSDK\\Gateway\\OrderGateway->captureOrder()
#4 /XXXXX/vendor/store.shopware.com/swagpaypal/src/Checkout/Payment/Service/OrderExecuteService.php(130): Swag\\PayPal\\RestApi\\V2\\Resource\\OrderResource->capture()
#5 /XXXXX/vendor/store.shopware.com/swagpaypal/src/Checkout/Payment/Service/OrderExecuteService.php(62): Swag\\PayPal\\Checkout\\Payment\\Service\\OrderExecuteService->doPayPalRequest()
#6 /XXXXX/vendor/store.shopware.com/swagpaypal/src/Checkout/Payment/Method/AbstractPaymentMethodHandler.php(214): Swag\\PayPal\\Checkout\\Payment\\Service\\OrderExecuteService->captureOrAuthorizeOrder()
#7 /XXXXX/vendor/store.shopware.com/swagpaypal/src/Checkout/Payment/Method/AbstractPaymentMethodHandler.php(131): Swag\\PayPal\\Checkout\\Payment\\Method\\AbstractPaymentMethodHandler->executeOrder()
#8 /XXXXX/vendor/shopware/core/Checkout/Payment/PaymentProcessor.php(93): Swag\\PayPal\\Checkout\\Payment\\Method\\AbstractPaymentMethodHandler->pay()
#9 /XXXXX/vendor/shopware/storefront/Controller/CheckoutController.php(247): Shopware\\Core\\Checkout\\Payment\\PaymentProcessor->pay()
#10 /XXXXX/vendor/shopware/core/Profiling/Profiler.php(67): Shopware\\Storefront\\Controller\\CheckoutController->{closure:Shopware\\Storefront\\Controller\\CheckoutController::order():247}()
#11 /XXXXX/vendor/shopware/storefront/Controller/CheckoutController.php(247): Shopware\\Core\\Profiling\\Profiler::trace()
#12 /XXXXX/vendor/store.shopware.com/swagcommercial/src/B2B/OrderApproval/Storefront/CheckoutControllerDecorator.php(101): Shopware\\Storefront\\Controller\\CheckoutController->order()
#13 /XXXXX/vendor/symfony/http-kernel/HttpKernel.php(183): Shopware\\Commercial\\B2B\\OrderApproval\\Storefront\\CheckoutControllerDecorator->order()
#14 /XXXXX/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw()
#15 /XXXXX/vendor/shopware/core/Framework/Adapter/Kernel/HttpKernel.php(72): Symfony\\Component\\HttpKernel\\HttpKernel->handle()
#16 /XXXXX/vendor/shopware/core/Framework/Adapter/Kernel/HttpCacheKernel.php(46): Shopware\\Core\\Framework\\Adapter\\Kernel\\HttpKernel->handle()
#17 /XXXXX/vendor/shopware/core/Kernel.php(129): Shopware\\Core\\Framework\\Adapter\\Kernel\\HttpCacheKernel->handle()
#18 /XXXXX/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Shopware\\Core\\Kernel->handle()
#19 /XXXXX/vendor/autoload_runtime.php(32): Symfony\\Component\\Runtime\\Runner\\Symfony\\HttpKernelRunner->run()
#20 /XXXXX/public/index.php(10): require_once('...')
#21 {main}","exception":"[object] (Swag\\PayPal\\RestApi\\Exception\\PayPalApiException(code: 0): The error \"UNPROCESSABLE_ENTITY\" occurred with the following message: The requested action could not be performed, semantically incorrect, or failed business validation. | [PAYER_ACTION_REQUIRED] Payer needs to perform the following action before proceeding with payment. at /XXXXX/vendor/store.shopware.com/swagpaypal/src/RestApi/Exception/PayPalApiException.php:89)"} []

From what I can gather, the plugin expects the order to be properly finalised and submittable. However, PayPal returns the status code PAYER_ACTION_REQUIRED which, at this point in the flow, isn't specifically handled and instead falls into general exception handling. I've found that the constant PAYER_ACTION_REQUIRED is defined in the plugin's source, but the only location where it is actually handled seems to be src/Resources/app/storefront/src/checkout/swag-paypal.google-pay.js line 105.

Expected behaviour

From what I understand about this issue, I suppose that the correct behaviour in this instance is to either ensure that all required actions have definitively been performed at this point. If that's not possible, checkout submission should fail gracefully and redirect the customer to Paypal, to properly handle this status code.

How to reproduce & Environment

We have not yet found a clear path to reproduce the issue. We use a custom theme in our shop, which also applies for the checkout. However, most PayPal payments go through without problems. The failure rate is <1%.

Paypal Express direct checkout is enabled. As visible in the logs, we also use the SwagCommercial plugin.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions