chore: Add free trial alert to our customers slack channel#3049
chore: Add free trial alert to our customers slack channel#3049
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe change updates the webhook processing logic for Stripe events by adding a new case for "customer.subscription.created". The code now checks if a subscription is a trial. If not a trial, it returns early with an "OK" response. For trial subscriptions, it retrieves the price, product, and customer details from Stripe, formats the price, and then calls a new asynchronous function, Changes
Sequence Diagram(s)sequenceDiagram
participant S as Stripe
participant WH as Webhook Handler
participant API as Stripe API
participant SS as Slack Service
S->>WH: POST "customer.subscription.created" event
alt Not a trial subscription
WH->>S: Return "OK"
else Trial subscription
WH->>API: Request price & product details (using price ID)
API-->>WH: Return price & product info
WH->>API: Request customer details
API-->>WH: Return customer info
WH->>SS: Call alertSlack with product, formatted price, email, name
SS-->>WH: Send Slack notification (if webhook URL is set)
WH->>S: Return "OK"
end
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
This adds Customer alert to the slack channel.
So we know who has a free trial.
It tells us the product, amount, name and email.
Summary by CodeRabbit
New Features
Improvements