• Hi there! Wanted to reach out as I use your stripe plugin for one of my Sub-Brands, However I also use the same stripe account with another sub-brand just to keep all income for my entire company all in one place. However the issue I notice is that webhook triggers will be sent to the plugin from orders from my other site that is not using WooCommerce and has custom stripe integration.

    I wanted to know if there is some kind of action or filter I can set in code to set a condition where if the metadata “brand_id” equals a specific value then it would process that webhook request?

    I did find you can set custom metadata but wanted to see if you can set a condition so that we don’t get a lot of logs saying can’t find order for example when it receives a webhook request from a charge or payment intent from my other site that has its own custom stripe setup.

    Really love your plugin it is really one of the best stripe plugins for WooCommerce and thanks for the great support 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @drewbc

    Thank you for contacting Payment Plugins. If you look at the metadata for the payment intent you should see a webhook_id value. Is that present or missing?

    The Stripe plugin adds the webhook_id to the metadata that way it can keep track of where the request originated from and process only the webhook requests that pertain to that site.

    However, if the webhook_id is missing then all requests will be processed since Stripe sends events to all configured webhooks. You can go to the API Settings page of the Stripe plugin and verify that your webhook ID is populated.

    Kind Regards

    Thread Starter drewbc

    (@drewbc)

    Oh gotcha yes I do see the webhook_id being set. So basically if my other site uses its own stripe integration and does not set webhook_id then the payment plugin will ignore the webhook trigger?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @drewbc

    So basically if my other site uses its own stripe integration and does not set webhook_id then the payment plugin will ignore the webhook trigger?

    Not quite. Here is the logic:

    1. If the webhook_id property exists in the metadata, then the Stripe plugin will compare that ID to the value stored in your WordPress site. If they match, the plugin will process the webhook.
    2. If the webhook_id property is missing, the plugin will process the webhook. This is because metadata can be customized and some merchants unknowingly remove that property. We try to make the plugin robust enough that mistakes made by merchants doesn’t impact functionality.

    Kind Regards

    Thread Starter drewbc

    (@drewbc)

    So if my other integrations sets a webhook_id to its own webhook id and not the payment plugins webhook id it will skip it correct?

    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @drewbc

    So if my other integrations sets a webhook_id to its own webhook id and not the payment plugins webhook id it will skip it correct?

    Yes that is correct.

    Kind Regards

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

You must be logged in to reply to this topic.