Skip to content

Implement Stripe payment intents#20

Open
yang-agoni wants to merge 1 commit into
SecureBananaLabs:mainfrom
yang-agoni:codex/stripe-payment-intent-issue-1
Open

Implement Stripe payment intents#20
yang-agoni wants to merge 1 commit into
SecureBananaLabs:mainfrom
yang-agoni:codex/stripe-payment-intent-issue-1

Conversation

@yang-agoni
Copy link
Copy Markdown

@yang-agoni yang-agoni commented May 16, 2026

/claim #1

Summary

Implements the Stripe PaymentIntent flow for the payment service.

  • Replaces the mock pay_${Date.now()} payment id with Stripe's Node SDK.
  • Reads the Stripe secret key from STRIPE_SECRET_KEY.
  • Validates payment payloads before contacting Stripe.
  • Defaults currency to usd and normalizes explicit three-letter currency codes.
  • Supports Stripe metadata after filtering nullish values and converting values to strings.
  • Returns the Stripe paymentId, clientSecret, amount, currency, and provider.
  • Maps validation, configuration, and Stripe provider failures to useful API responses.

Verification

  • npm test -w apps/api
  • git diff --check

Demo

The real Stripe smoke test is included but intentionally skipped by default. It runs only with:

STRIPE_SMOKE_TEST=1 STRIPE_SECRET_KEY=sk_test_... npm test -w apps/api

Notes

The smoke test should be run only with a Stripe test-mode key. No secret key is committed.

Closes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Secure Payment Gateway and Payment Service

1 participant