# Stripe webhooks

> Some payment methods like SEPA Direct Debit can take up to 6 business days until the payment is confirmed. Learn how to use webhooks to get notified when the payment is succeeded.

When you set up Stripe webhook as described, the Stripe payments with delayed payment confirmations are marked as paid, as soon as Merx receives the hook.

## Create a Stripe webhook

Go to [dashboard.stripe.com/test/webhooks/create?events=payment_intent.succeeded](https://dashboard.stripe.com/test/webhooks/create?events=payment_intent.succeeded) to create a new hook.

Enter the Endpoint URL: [`https://[your-domain]/api/shop/hooks/stripe`](https://merx2.wagnerwagner.de/reference/api/routes/shop-hooks-stripe-post.md).

Copy the created Signing secret. `whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`

## Set the stripe.webhook_signing_secret option

Add the Signing secret as [`stripe.webhook_signing_secret`](https://merx2.wagnerwagner.de/reference/options/config-options/stripe-webhook-signing-secret.md) option.

```php title="/site/config/env.php"
<?php
return [
  'wagnerwagner.merx.stripe.webhook_signing_secret' => 'whsec_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
];
```

We recommend to set these keys in `/site/config/env.php` on your server only. For your development environment you can use a separate env file containing sandbox keys.

## Use other Stripe hooks

You can create your own [`stripe-hooks`](https://merx2.wagnerwagner.de/reference/options/hooks/stripe-hooks.md) hook, to handle other Stripe events via webhook. To learn more about Stripe webkooks you can read the [Stripe Docs](https://docs.stripe.com/payments/payment-intents/verifying-status#webhooks).
