Duaer

App recipes

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, connect the Stripe credential, and set Events to Invoice Payment_failed.
  2. Add Slack 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.

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.

In this section