Skip to content

Implement Stripe PaymentIntent creation#19

Open
dannyward630 wants to merge 1 commit into
SecureBananaLabs:mainfrom
dannyward630:codex/stripe-payment-intents
Open

Implement Stripe PaymentIntent creation#19
dannyward630 wants to merge 1 commit into
SecureBananaLabs:mainfrom
dannyward630:codex/stripe-payment-intents

Conversation

@dannyward630
Copy link
Copy Markdown

/claim #1

Fixes #1

Summary

  • replace the timestamp-based payment stub with Stripe paymentIntents.create() using STRIPE_SECRET_KEY
  • validate amount, normalize/default currency, and validate optional metadata before calling Stripe
  • return Stripe id as paymentId and client_secret as clientSecret
  • preserve Stripe API error messages through a provider error and return validation/provider errors from the payment route
  • add mocked service tests, route tests, and an opt-in Stripe test-mode smoke test

Verification

  • npm test — 8 passed, 1 skipped guarded Stripe smoke test
  • npm run build — root script prints package-specific build guidance
  • npm run lint — root script reports no lint configured
  • git diff --check

Smoke test

The live Stripe smoke test is intentionally skipped by default so CI does not need secrets. It can be run with:

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

Demo note

This is a backend-only payment service change. I do not have a Stripe test key in this environment, so the PR demo is the mocked API/service test run plus the guarded live smoke-test path above rather than a live provider charge.

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