Skip to content

Reject invalid payment creation payloads#4183

Open
bozicovichsantiago20-oss wants to merge 1 commit into
SecureBananaLabs:mainfrom
bozicovichsantiago20-oss:codex/validate-payment-inputs
Open

Reject invalid payment creation payloads#4183
bozicovichsantiago20-oss wants to merge 1 commit into
SecureBananaLabs:mainfrom
bozicovichsantiago20-oss:codex/validate-payment-inputs

Conversation

@bozicovichsantiago20-oss

Copy link
Copy Markdown

Summary

  • Add a Zod payment creation schema requiring positive finite amounts.
  • Normalize valid three-letter currency codes to lowercase and default missing currency to usd.
  • Return a structured 400 response for invalid payment payloads before creating a mock intent.
  • Update the API test script to target test files and add payment validation coverage.

Verification

  • npm.cmd test -w apps/api
  • node --test apps/api/src/tests/payment.test.js
  • git diff --check

Closes #4181
Refs #743
/claim #4181

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.

Payment creation should reject non-positive amounts and invalid currency

1 participant