'App Engine and flask fails to get post message from webhook

I'm doing a webhook request from Paypal webhook simulator to an App Engine service, developped in flask.

The webservice has a route to get webhooks using this simple code in flask:

@app.route('/webhook',methods = ['POST'])
def webhook():
    
    print(request.method )
    if request.method == 'POST':
        print(request.json)
        
        return 'success', 200
    else:
        abort(400)

Unfortunatelly, the request doesn't work, and there is no log message from the flask app, not even from the print(request.method).

Picture of Web hook test failed

Webhooks URL:

https://www.mywebsite/webhook

After sending test, I have the following event status:

Your event failed to queue at May 13 2022, 20:28:47

Error details:

{}

Do you know why the webhook test isn't working?



Solution 1:[1]

The error comes from the sandbox account created by default. When starting a sandbox service, Paypal creates a default account that doesn't have all the functions, including the webhook one. I've created a new sandbox account and the webhook works.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1