[PM-32216] Create Stripe Checkout Session Endpoint#7246
[PM-32216] Create Stripe Checkout Session Endpoint#7246sbrown-livefront wants to merge 12 commits intomainfrom
Conversation
|
Claude finished @sbrown-livefront's task in 2m 26s —— View job I'll analyze this and get back to you. |
|
New Issues (3)Checkmarx found the following issues in this Pull Request
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7246 +/- ##
==========================================
+ Coverage 57.66% 57.70% +0.03%
==========================================
Files 2037 2040 +3
Lines 89701 89799 +98
Branches 7979 7981 +2
==========================================
+ Hits 51728 51817 +89
- Misses 36117 36126 +9
Partials 1856 1856 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cyprain-okeke
left a comment
There was a problem hiding this comment.
Nice Work, it seem you have some conflict. I will review after you resolve them
| { | ||
| Metadata = new Dictionary<string, string> | ||
| { | ||
| [StripeConstants.MetadataKeys.UserId] = user.Id.ToString(), |
There was a problem hiding this comment.
How does the subscription get activated after the user completes checkout?
The metadata is properly attached, but I want to confirm the end-to-end flow works. Have you tested this in Stripe test mode to verify the user's premium status gets activated correctly?
There was a problem hiding this comment.
The user's premium is activated by the webhook after the checkout is complete. That's the next PR for this story.
I've tested that the checkout session is usable above, the webhook will complete the upgrade.
|





🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32216
📔 Objective
This pull request introduces a new API endpoint to enable users to initiate a Stripe Checkout Session for purchasing a premium subscription via mobile platforms (iOS/Android). It adds the necessary request/response models, command, and service integration with Stripe, along with platform and app version tracking for analytics.
New Premium Checkout Session Flow:
/premium/checkoutinAccountBillingVNextControllerfor creating a Stripe Checkout Session, requiring theBitwarden-Client-Versionheader and a platform (iOS/Android).CreatePremiumCheckoutSessionRequestmodel with validation to ensure only supported platforms are accepted.ICreatePremiumCheckoutSessionCommandand its handler to orchestrate the creation of a Stripe Checkout Session, including customer creation if needed, and returning the session URL.PremiumCheckoutSessionResponseModelto encapsulate the session URL response.📸 Screenshots
CheckoutSession-Recording.mp4