• Resolved vdrn

    (@vdrn)


    I’m currently developing a shop in test mode, and everything seems to work fine without webhooks.
    Looking at the webhooks source code, it also suggests that other parts of woocommerce/woocommerce-gateway-stripe are not using them.

    So I’d like a confirmation that webhooks are not necessary when using live mode either.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello vdrn

    Thank you for contacting WooCommerce Support.

    Webhooks are not required for many standard operations of WooCommerce and the Stripe payment gateway but webhooks do play an important role when it comes to tracking events that occur with transactions.

    For live mode operation, webhooks become essential for updating order statuses automatically when certain asynchronous events happen – such as chargebacks or refunds – that occur post-payment and require the system to be notified.

    Although your store can operate without them, enabling webhooks ensures that your WooCommerce store stays in sync with Stripe for any post-payment events and reduces the need for manual updates, thereby making the process seamless for both you and your customers.

    I hope this answers your question.
    If you have any further queries, please feel free to reach out. ??

    Best regards.

    Thread Starter vdrn

    (@vdrn)

    Thanks so much @doublezed2 for a quick response.

    I have a follow-up question: In order for webhooks to work properly, is adding a webhook secret in woocommerce-gateway-stripe? settings strictly necessary?
    (I beleive woocommerce-gateway-stripe can alternately use useragent checking to verify webhooks, which makes secret key optional)

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello vdrn,

    Thank you for your reply.

    Yes, that is correct.
    Adding a webhook secret is a required step of the configuration process.
    Without it, the communication between Stripe and WooCommerce will not happen.

    Could you share more details about what you mean by:
    useragent checking to verify webhooks

    Please let me know if you have any other questions.
    I will be happy to answer. ??

    Best regards.

    Thread Starter vdrn

    (@vdrn)

    I was hoping that secret is not strictly required when using webhooks. (I’m using multiple stripe accounts for my shop, and while publishable and secret keys can be changed by filter hooks easily, there is no such functionality for webhook secret).


    More details on useragent checking to verify webhooks:


    This code calls validate_request_user_agent when there is no wehbook secret: https://github.com/woocommerce/woocommerce-gateway-stripe/blob/44584a226cdd0008d78513eeb0140b889ccc556c/includes/class-wc-stripe-webhook-handler.php#L108

    I’m quoting the comment to the function called there:
    Verify User Agent of the incoming webhook notification. Used as fallback for the cases when webhook secret is missing.

    (link to the comment: https://github.com/woocommerce/woocommerce-gateway-stripe/blob/44584a226cdd0008d78513eeb0140b889ccc556c/includes/class-wc-stripe-webhook-handler.php#L136)

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi there @vdrn,

    Just as my colleague has shared above, it is important for the webhooks to be enabled, as they do play an important role when it comes to tracking events that occur with transactions.

    However, the plugin does have a fallback mechanism in place when the webhook secret is missing. The validate_request_user_agent function you’ve mentioned checks the incoming webhook notification to verify that it’s from Stripe. This is not as secure as the secret, but it does provide a basic level of verification and communication.

    I hope this helps.

    Thread Starter vdrn

    (@vdrn)

    @ckadenge Thank you. I guess my only option is to modify the plugin.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello vdrn,

    Thank you for your reply.
    We are glad to be of your help.

    Please don’t hesitate to contact us again if you have more questions or concerns.
    We are here to help ??

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Are Webhooks neccesary?’ is closed to new replies.