Skip to content

Conversation

@NatElkins
Copy link
Contributor

@NatElkins NatElkins commented Jan 15, 2026

Summary

  • Simplifies product checkout API from products: string[] to product: string (single product)
  • Adds CUSTOM price (pay-what-you-want) support in checkout UI
  • Updates @moneydevkit/api-contract to 0.1.17 for new product selection fields

API Changes

createCheckout({ type: 'PRODUCTS', product: 'prod_123' })

CUSTOM Price Flow

When a product has a CUSTOM price type, users see an "Enter Amount" input:

  • USD: Shows $ prefix, converts dollars to cents
  • SAT: Shows sats suffix, uses value directly

Test plan

  • Build succeeds
  • All tests pass (92 tests)
  • Manual testing with FIXED price product
  • Manual testing with CUSTOM price product

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fcef37b06

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…soon

- Add CreateCheckoutOptions type with product: string field
- Transform product to products: [product] internally for API contract
- Update handler schemas and action types to use singular product
- Revert example files to main (local dev paths shouldn't be committed)
- Remove multi-product radio button UI (not supported yet)
- Remove FREE price type check (not in api-contract)
- Keep selectedProductId state for CUSTOM price handling
- Add comment explaining selectedProductId setter is intentionally omitted
- Fix floating point precision with Number.EPSILON for USD cents conversion
- Fix currency display: $ prefix for USD, "sats" suffix for SAT
- Fix input padding for SAT currency to accommodate suffix
@NatElkins NatElkins changed the title feat: add product selector for multi-product checkouts feat: add product checkout with CUSTOM price support Jan 20, 2026
// Create a checkout for a product with CUSTOM pricing
const result = await createCheckout({
type: 'PRODUCTS',
products: [customPriceProductId], // Product configured with CUSTOM price in dashboard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

product? not products?

Copy link
Contributor

@martinsaposnic martinsaposnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinsaposnic martinsaposnic merged commit c1340bc into main Jan 20, 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.

3 participants