PayPalClassic no longer responds in Shopware5 frontend, error message: Webhook URL

Dear Community :slightly_smiling_face:
Since a few days (no update was the trigger) our „Pay now“ button doesn’t work anymore, where the pop-up from PayPal should appear. However, there is no error message in the frontend, instead everything stops and the cursor shows that the page is loading.

The following error message is displayed in the Shopware logs:
PayPal: GOT ERROR WHILE REQUEST OF TYPE (POST) TO URL: https://api-m.paypal.com/v1/notifications/webhooks

{
  "payload": "{\"url\":\"https:\\/\\/XXX.com.cloud1-vm473.de-nserver.de\\/PaypalUnifiedWebhook\\/execute\",\"event_types\":[{\"name\":\"*\"}]}",
  "headers": "{\"Authorization\":\"Bearer A21AAOlIxwTj31mWF2cNDeCJYSysZhtPIJrUCE6gFOsD-ZPGVphiaGXT5UjOCvNIjUJ-yFwTQRoeBOwHbqi0hvLJyDzDFcQOA\",\"content-type\":\"application\\/json\"}",
  "exception": {
    "message": "Client error: `POST https://api-m.paypal.com/v1/notifications/webhooks` resulted in a `400 Bad Request` response:\n{\"name\":\"WEBHOOK_URL_ALREADY_EXISTS\",\"message\":\"Webhook URL already exists\",\"debug_id\":\"2aad32f11f733\",\"information_link (truncated...)\n",
    "trace": "#0 /custom/plugins/SwagPaymentPayPalUnified/PayPalBundle/Services/ClientService.php(155): Shopware\\Components\\HttpClient\\GuzzleHttpClient->post()\n#1 /custom/plugins/SwagPaymentPayPalUnified/PayPalBundle/Resources/WebhookResource.php(64): SwagPaymentPayPalUnified\\PayPalBundle\\Services\\ClientService->sendRequest()\n#2 /custom/plugins/SwagPaymentPayPalUnified/Controllers/Backend/PaypalUnifiedSettings.php(94): SwagPaymentPayPalUnified\\PayPalBundle\\Resources\\WebhookResource->create()\n#3 /engine/Library/Enlight/Controller/Action.php(182): Shopware_Controllers_Backend_PaypalUnifiedSettings->registerWebhookAction()\n#4 /engine/Library/Enlight/Controller/Dispatcher/Default.php(461): Enlight_Controller_Action->dispatch()\n#5 /engine/Library/Enlight/Controller/Front.php(225): Enlight_Controller_Dispatcher_Default->dispatch()\n#6 /engine/Shopware/Kernel.php(197): Enlight_Controller_Front->dispatch()\n#7 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(85): Shopware\\Kernel->handle()\n#8 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(479): Symfony\\Component\\HttpKernel\\HttpCache\\SubRequestHandler::handle()\n#9 /engine/Shopware/Components/HttpCache/AppCache.php(262): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->forward()\n#10 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(269): Shopware\\Components\\HttpCache\\AppCache->forward()\n#11 /engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->pass()\n#12 /home/frumkntb/www.XXX.com/shopware.php(122): Shopware\\Components\\HttpCache\\AppCache->handle()\n#13 {main}",
    "code": 400,
    "file": /engine/Shopware/Components/HttpClient/GuzzleHttpClient.php",
    "line": 166,
    "body": "{\"name\":\"WEBHOOK_URL_ALREADY_EXISTS\",\"message\":\"Webhook URL already exists\",\"debug_id\":\"2aad32f11f733\",\"information_link\":\"https://developer.paypal.com/docs/api/webhooks/#errors\",\"details\":[],\"links\":[]}"
  }
}

The following error message is displayed in the PayPal Error logs:
Request

{
  "additional_properties": "xxxxxx",
  "body": {
    "event_types": [
      {
        "name": "xxxxxx"
      }
    ],
    "url": "xxxxxx"
  },
  "header": {
    "ak-client-info": "xxxxxx",
    "akamai-x-forwarded-for-7": "xxxxxx",
    "authorization": "xxxxxx",
    "client-auth": "xxxxxx",
    "client_info": "xxxxxx",
    "content-length": "xxxxxx",
    "content-type": "xxxxxx",
    "correlation-id": "2aad32f11f733",
    "host": "xxxxxx",
    "paypal-routing-metadata": "xxxxxx",
    "pp_geo_loc": "xxxxxx",
    "pp_remote_addr": "xxxxxx",
    "pp_vip": "xxxxxx",
    "rl-count-10s": "xxxxxx",
    "rl-count-60s": "xxxxxx",
    "rl-rate-10s": "xxxxxx",
    "rl-rate-60s": "xxxxxx",
    "traceparent": "xxxxxx",
    "true-client-ip": "xxxxxx",
    "user-agent": "xxxxxx",
    "x-akamai-edgescape": "xxxxxx",
    "x-b3-spanid": "xxxxxx",
    "x-edge-security-info": "xxxxxx",
    "x-forwarded-for": "xxxxxx",
    "x-forwarded-host": "xxxxxx",
    "x-forwarded-server": "xxxxxx",
    "x-limit-exceeded-v2": "xxxxxx",
    "x-paypal-correlation-id": "xxxxxx",
    "x-pp-corrid": "xxxxxx",
    "x-pp-idempotencyid": "xxxxxx",
    "x-pp-slingshot-targetapp": "xxxxxx",
    "x-slr-orig-script_uri": "xxxxxx"
  },
  "method": "POST"
}

Respond

{
  "additional_properties": "xxxxxx",
  "body": {
    "debug_id": "xxxxxx",
    "details": "xxxxxx",
    "information_link": "xxxxxx",
    "links": "xxxxxx",
    "message": "xxxxxx",
    "name": "xxxxxx"
  },
  "duration_time": "xxxxxx",
  "header": {
    "APPLICATION_ID": "xxxxxx",
    "BORDER-IP": "xxxxxx",
    "CALLER_ACCT_NUM": "xxxxxx",
    "Date": "xxxxxx",
    "PROCESSING-IP": "xxxxxx",
    "SERVER_INFO": "xxxxxx",
    "paypal-debug-id": "xxxxxx"
  },
  "status": 400
}

Even after completely re-installing PayPal including re-creating an app to receive our REST API credentials and re-creating a webhook (both done automatically by Shopware), the frontend shows the same error and the logs also show the same error messages.

I don’t understand „Webhook already exists“ as we only have one app with one webhook address active in PayPal.

Shopware version: 5.7.6
PayPal version: 6.0.2

I would be very happy, if someone has any idea how to solve.

Hello,

this error message has nothing to do with the button not working anymore :slightly_smiling_face:
It appears, if the settings module tries to register the webhook URL, but it is already registered, so no problem. This could be seen as hint.

So the reason why your buttons do not work anymore, must be somewhere else.

Best regards from Schöppingen
Michael Telgmann

We have the exact same issue in SW 5.6.9. and Paypal 6.0.2.

Everything was fine until the client updated PP from 5.0.4. to 6.0.2.

With Paypal as Payment option, we get redirected to /checkout/shippingPayment with error notice (Während der Kommunikation mit dem Zahlungsanbieter ist ein Fehler aufgetreten, bitte versuchen Sie eine andere Zahlart), with e.g. Lastschrift via Paypal Payment nothing happens after clicking the button.

Did you get this solved?

Hello again :slight_smile:
In fact, the non-functional button had nothing to do with PayPal itself, but with a theme that prevented the button from being hidden.
We were able to fix the problem - the PayPal function was never disturbed. What we were not aware of is that the yellow PayPal button is not an express checkout, but the conventional button to pay logged in with PayPal.
Thanks for your support.

We have the same problem after updating to Paypal V6.
I understand, that the solution is to edit the template of the final order confirmation page. Is that right?