> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/recipes/stripe-failed-payment-to-slack.md).

# Alert Slack on failed Stripe payments with Duaer

In Duaer, when a Stripe subscription charge fails, post the customer email, amount, attempt count, and invoice link to a Slack channel.
## Build the failed payment alert in Duaer

1. Add [Stripe Trigger](/integrations/builtin/trigger-nodes/duaer-nodes-base.stripetrigger.md), connect the [Stripe credential](/integrations/builtin/credentials/stripe.md), and set Events to Invoice Payment_failed.
2. Add [Slack](/build/slack.md) with Resource Message, Operation Send, channel #billing.
3. Message: Payment failed {{ $json.data.object.customer_email }}, {{ ($json.data.object.amount_due / 100).toFixed(2) }} {{ $json.data.object.currency.toUpperCase() }}, attempt {{ $json.data.object.attempt_count }}. Invoice: {{ $json.data.object.hosted_invoice_url }}
4. Publish the digital organization. Stripe Trigger registers its webhook in Stripe after publishing.

For zero-decimal currencies such as JPY, do not divide the amount by 100.

## Test

Use a Stripe test-mode key in the credential. Attach card 4000 0000 0000 0341 (attaches, then declines) to a test customer and start a subscription to get invoice.payment_failed. If the channel stays silent, refer to [Fix Slack not_in_channel in Duaer](/troubleshooting/slack-not-in-channel.md).
## Questions

### Can Duaer alert on failed one-time Stripe payments too?

Yes. Also select Payment Intent.payment_failed in the Duaer Stripe Trigger and use data.object.amount for the amount.

### Can Duaer post to WeCom instead of Slack?

Yes. Replace the Slack node in the Duaer flow with a WeCom group bot; the message stays the same.

## Related

- [Create a Stripe customer in Duaer](https://doc.duaer.com/build/stripe.md)
- [Send a Slack message in Duaer](https://doc.duaer.com/build/slack.md)
- [Fix Slack not_in_channel and channel_not_found in Duaer](https://doc.duaer.com/troubleshooting/slack-not-in-channel.md)

