Skip to content

Fix: no KYC status check before withdrawal — unverified merchants can submit cash-out requests #591

Description

@henrypeters

Category: Compliance - Bug
Priority: High
Estimated Time: 2 hours

Description:
app/(app)/withdraw/page.tsx loads balances and renders the cash-out form with no check against the merchant's KYC status. A freshly-created account with kyc_status: 'pending' can immediately submit a withdrawal. types/kyc.ts already defines KycStatus and related types, and the existing Me interface in lib/api.ts returns merchant_id — extending it to include kyc_status is the minimal required backend change.

Tasks:

  • Extend Me interface in lib/api.ts with kyc_status: KycStatus | null
  • Load me data at the top of WithdrawPage (alongside existing balances fetch)
  • If kyc_status !== 'approved', render a gated banner with a link to the KYC flow instead of the form
  • Add tests covering the blocked and unblocked render paths

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomplianceRegulatory / legal compliancekycKnow Your Customer verificationpaymentsPayment gateway integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions