Skip to content

feat(billing): add Feishu notification on payment success#495

Merged
GenerQAQ merged 1 commit intodevfrom
feat/feishu-payment-notification
Mar 25, 2026
Merged

feat(billing): add Feishu notification on payment success#495
GenerQAQ merged 1 commit intodevfrom
feat/feishu-payment-notification

Conversation

@GenerQAQ
Copy link
Copy Markdown
Contributor

Why we need this PR?

Add async Feishu notifications when payments succeed or new subscriptions activate, so the team gets real-time payment alerts with user and usage context.

Describe your solution

Added a sendPaymentFeishuNotification() helper in the stripe-webhook function that:

  • Reads FEISHU_WEBHOOK_URL from env (silently skips if unset)
  • Queries organization_usage for the org's current month metrics
  • Fetches customer email from Stripe
  • Sends a Feishu interactive card with payment info + usage summary
  • Differentiates new subscriptions (green header) vs renewals (yellow header)
  • Fire-and-forget: errors logged but never block the webhook response

Implementation Tasks

  • Add sendPaymentFeishuNotification() helper function
  • Call on customer.subscription.created/updated (new sub activation)
  • Call on invoice.payment_succeeded (renewal/payment)

Impact Areas

  • Dashboard

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

…scription

Send async Feishu card notifications with org info and monthly usage
metrics when payments succeed or new subscriptions activate.
@GenerQAQ GenerQAQ requested a review from a team as a code owner March 25, 2026 10:24
@GenerQAQ GenerQAQ merged commit 8df4900 into dev Mar 25, 2026
1 check passed
@GenerQAQ GenerQAQ deleted the feat/feishu-payment-notification branch March 25, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant