• Resolved Losi

    (@losi)


    Hi!

    Under Webhooks in Braitnree Dashboard, i have this notification after set up the webhooks for plugin:

    “A webhook notification is a message indicating that a specific event has occurred, such as a canceled subscription. When the event occurs, the notification is sent via HTTPS POST to a destination url of your choice. Learn more.

    Clicking a webhook’s Check URL action will fire a test webhook to your endpoint. Watch out though, if your webhook handling code doesn’t check notification types this might cause unexpected side effects.
    If you have older non-HTTPS webhooks, they have been disabled and can no longer be checked.”

    Then hit “Check URL”, and I received this error message:
    “Last delivery unsuccessful. Invalid server response 401”

    How to solve this?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @losi,

    When you perform the webhook test make sure you have the proper environment set in the plug-ins API settings page.

    For example if you have sandbox mode in abled and you try to perform a test in production you will get the 401 response code.

    Kind regards,

    Thread Starter Losi

    (@losi)

    Hi,
    Thank You for quick answer.

    After set-up “Production” enviroment to active (instead of sandbox), the error message stay.

    Plugin Author Clayton R

    (@mrclayton)

    @losi did you enter your production API keys?

    Thread Starter Losi

    (@losi)

    Sure!

    Plugin Author Clayton R

    (@mrclayton)

    @losi,

    I’ll have to reach out to Braintree because when I test, I get a 404 as well but the debug logs shows that the webhook was received. So they appear to not be processing the 200 response code.

    Check your debug log and if you see INFO Webhook received. Kind: check. then it’s working despite what Braintree’s control panel says.

    Kind Regards,

    Thread Starter Losi

    (@losi)

    “wc-braintre…” debug log contains just one line:
    “2020-04-22T17:12:11+00:00 ERROR Error creating client token. Exception: Braintree\Exception\Configuration”

    And Braintree payment not visible in WC wizard process. (Screenshot about this: https://drive.google.com/file/d/1kGz-X6YfQHw2pgPqvipzhgGf9Swy-FXo/view?usp=sharing)

    Plugin Author Clayton R

    (@mrclayton)

    It’s not visible in the WooCommmerce wizard process because we aren’t the same company as WooCommmerce. They promote their own plugins in that setup.

    That log is from 4/22 so not relevant. In API settings make sure you have debug log enabled.
    Then perform a connection test.

    Thread Starter Losi

    (@losi)

    Understand.

    Made this process sometimes, but nothing show in logs πŸ™

    Thread Starter Losi

    (@losi)

    Sorry, sometimes many times

    Plugin Author Clayton R

    (@mrclayton)

    Is your connection test working?

    Thread Starter Losi

    (@losi)

    Yes, get a green success message (although it flashes for only a few tenths of a second)

    Plugin Author Clayton R

    (@mrclayton)

    @losi I checked your url using postman and I get the following response:

    {
        "code": "rest_cannot_access",
        "message": "Only authenticated users can access the REST API.",
        "data": {
            "status": 401
        }
    }

    That tells me you have another plugin or custom code that is preventing access to the WP REST API if the user is not logged on. You would need to remove that so that webhooks can be received. Webhooks come from Braintree so there won’t be any logged in user.

    Thread Starter Losi

    (@losi)

    This is a -relatively- new installation.
    But i turned off every plugin, at this time in log show this:
    2020-04-24T23:01:46+00:00 INFO Webhook received. Kind: check.

    Debugging may come…

    Thank You for all!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Webhook “Check URL” error’ is closed to new replies.