Skip to content

Testnet: Card Payment — Full End-to-End Test with Stripe Test Mode #119

@0xdevcollins

Description

@0xdevcollins

Summary

Complete a full card payment end-to-end using Stripe test mode. Validates the card session creation, Stripe webhook confirmation, and fiat → Stellar settlement flow.

Test Scenario

  • Payer: Credit card (Stripe test card 4242 4242 4242 4242)
  • Payment method: Card (Stripe Elements)
  • Merchant settlement: USDC on Stellar
  • No blockchain interaction from payer side

Steps to Validate

Setup

  • STRIPE_SECRET_KEY (test mode) configured
  • STRIPE_WEBHOOK_SECRET configured
  • Stripe CLI running: stripe listen --forward-to localhost:3000/webhooks/stripe
  • Stellar relay configured for converting fiat inbound to USDC

Payment Flow

  1. Merchant creates payment via API
  2. Checkout opens card form (Stripe Elements)
  3. POST /v1/payments/:id/card-session creates Stripe PaymentIntent
  4. Payer enters 4242 4242 4242 4242, expiry, CVV
  5. Stripe confirms PaymentIntent
  6. payment_intent.succeeded webhook fires to API
  7. API updates payment to PROCESSING
  8. Stellar path payment converts fiat → USDC → merchant settlement
  9. Payment → COMPLETED
  10. Merchant receives USDC, dashboard updates in real-time

Stripe Test Cards to Test

Card Expected Result
4242 4242 4242 4242 Success
4000 0000 0000 9995 Insufficient funds — should show clear error
4000 0000 0000 0002 Card declined — should show clear error
4000 0025 0000 3155 3DS authentication required

Pass Criteria

  • Successful card charges complete through to USDC settlement
  • Declined cards show specific error messages (not generic)
  • 3DS authentication flow works in checkout
  • Webhook signature verified on every event
  • No payment stays in PENDING forever after card charge

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend API worktestingTests and validation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions