feat(api): replace createPaymentIntent stub with real Stripe PaymentIntent (Bounty #1, $350)#24
Closed
cx306806112 wants to merge 1 commit into
Closed
Conversation
…ntent (B1, $350) - Add stripe npm package (apiVersion 2025-04-30.basil) - Validate payload.amount (required, positive integer in cents) - Validate payload.currency (defaults to usd) - Call stripe.paymentIntents.create with automatic_payment_methods - Map paymentIntent.client_secret → clientSecret, id → paymentId - Catch and re-throw Stripe errors preserving original message - 12 unit tests covering validation, mapping, and error paths - Expose setStripeClient() for testability
gacorpoll-ui
pushed a commit
to gacorpoll-ui/bug-bounty
that referenced
this pull request
May 17, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaced the stub implementation with a real Stripe PaymentIntent integration.
Changes
stripenpm packageSTRIPE_SECRET_KEYenv var (no hardcoded keys)payload.amountvalidation (required, positive integer)payload.currencydefaults to"usd"if not providedstripe.paymentIntents.create({ amount, currency })callclientSecret(frompaymentIntent.client_secret) andpaymentId(frompaymentIntent.id)pay_${Date.now()}ID generationStripeCardError,StripeInvalidRequestError, etc.) caught and re-thrown with descriptive messagesAcceptance Criteria
STRIPE_SECRET_KEYenv var usedpayload.amountrequired, positive integer validatedpayload.currencydefaults to"usd"stripe.paymentIntents.create()call madeclientSecretandpaymentId/bounty $350