**Listening for Stripe Webhooks on ApiDog for Test Scenarios Automation:**

We’re using Stripe for payment processing and ApiDog for backend API testing.

We’ve written tests for our endpoints on ApiDog, and these tests are integrated with our CI/CD pipeline on GitHub.

The issue we’re facing is how to listen for Stripe webhooks on ApiDog during the CI/CD process to automate testing.

Could you let me know if there’s a way to capture webhooks on ApiDog?

Listening for Stripe Webhooks on ApiDog for Test Scenarios Automation:

Hi Temesgen,
Thank you for reaching out. While ApiDog doesn’t directly support listening for webhooks, you can achieve this by leveraging your backend service to capture the webhook events and then using ApiDog to validate the data.
Here’s a suggested approach:
1.Capture Webhook Events in Your Backend:
Set up an endpoint in your backend service to receive Stripe webhooks.
When a webhook event is received, store the relevant data in your database.
2. Add a Post-Request Processor-Database Operation in ApiDog to query your database and validate the stored data against your expected result.

I hope this helps. If you have any further questions or need more detailed guidance, please let me know.

Hello Emily

Thank you for you suggestion. Yes, we are already listening the stripe webhooks in our backend and we are processing the necessary logic in our backend based on the stripe webhook events.

The problem comes when we run the test scenarios during the CI/CD to automate the testing process. We have many test scenarios written for the endpoints on the ApiDog. We are unable to listen the stripe webhooks from ApiDog during the CI/CD.

I think the idea Emily mentioned would work. Let me explain it with more details:

  1. You first need to record every Stripe webhook event on your backbend service that save it as a Stripe event logs Database table.
  2. And then you can utilize Apidog post processer to get the row that match your logic from the event logs table since Apidog support connect to the database for corresponding environment.

Okay, thank you Karan

It seems clear now

Can I run Stripe JS on the ApiDog using $$.liveRequire function?

According to this document Using JS libraries - Apidog Docs, liveRequire can use pure JS packages from npm, so you can try using @stripe/stripe-js.

The documentation for this package can be found here: @stripe/stripe-js - npm.