Skip to content

feat(payments): pay crypto from custodial balance, deposit only the s… - #99

Merged
manoahLinks merged 1 commit into
mainfrom
feat/crypto-settlement
Jul 18, 2026
Merged

feat(payments): pay crypto from custodial balance, deposit only the s…#99
manoahLinks merged 1 commit into
mainfrom
feat/crypto-settlement

Conversation

@manoahLinks

Copy link
Copy Markdown
Contributor

…hortfall

Skip the deposit step when the buyer's own Circle wallet already holds enough USDC. At crypto checkout, read the wallet's USDC balance:

  • balance >= required -> settle immediately (mark the transaction paid and enqueue the mints, which spend straight from balance via approve + mintTicket). Response returns paidFromBalance: true and no deposit block.

  • balance < required -> return a deposit instruction for the SHORTFALL only; the buyer tops up the missing amount and the inbound webhook settles once it lands.

  • crypto-checkout: prepareCrypto replaces createDepositIntent, reads the balance via Circle getWalletTokenBalance, and returns a discriminated settlement plan (balance | deposit).

  • PaymentsModule imports CircleModule; TicketsService injects MintQueueService to enqueue mints on the pay-from-balance path.

Refs #96

…hortfall

Skip the deposit step when the buyer's own Circle wallet already holds
enough USDC. At crypto checkout, read the wallet's USDC balance:

- balance >= required -> settle immediately (mark the transaction paid and
  enqueue the mints, which spend straight from balance via approve +
  mintTicket). Response returns `paidFromBalance: true` and no deposit block.
- balance < required -> return a deposit instruction for the SHORTFALL
  only; the buyer tops up the missing amount and the inbound webhook
  settles once it lands.

- crypto-checkout: `prepareCrypto` replaces `createDepositIntent`, reads the
  balance via Circle `getWalletTokenBalance`, and returns a discriminated
  settlement plan (balance | deposit).
- PaymentsModule imports CircleModule; TicketsService injects MintQueueService
  to enqueue mints on the pay-from-balance path.

Refs #96
@manoahLinks
manoahLinks merged commit 50e8d1f into main Jul 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant