-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add product checkout with CUSTOM price support #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
| // Create a checkout for a product with CUSTOM pricing | ||
| const result = await createCheckout({ | ||
| type: 'PRODUCTS', | ||
| products: [customPriceProductId], // Product configured with CUSTOM price in dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
product? not products?
martinsaposnic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
products: string[]toproduct: string(single product)@moneydevkit/api-contractto 0.1.17 for new product selection fieldsAPI Changes
CUSTOM Price Flow
When a product has a CUSTOM price type, users see an "Enter Amount" input:
$prefix, converts dollars to centssatssuffix, uses value directlyTest plan