-
Notifications
You must be signed in to change notification settings - Fork 4
feat(react): implement Buy Now and Cart payment modes #44
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
base: main
Are you sure you want to change the base?
feat(react): implement Buy Now and Cart payment modes #44
Conversation
- Add 'buyNow' and 'cart' commerce modes - Implement product total calculation and list rendering - Update PaymentButton to accept paymentConfig - fix(sdk): resolve RPC stability and lint errors - chore(docs): simplify demo flow
|
@Don-Vicks is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
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.
Important
Looks good to me! 👍
Reviewed everything up to 6c63e83 in 1 minute and 36 seconds. Click for details.
- Reviewed
2983lines of code in31files - Skipped
2files when reviewing. - Skipped posting
5draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/sdk/src/core/error-handler.ts:372
- Draft comment:
The initial switch block in calculateDelay is redundant—it computes linear and exponential delays but doesn’t store or return them. Remove that block and rely solely on the subsequent switch for clarity. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. apps/docs/app/(home)/components/interactive-demo.tsx:36
- Draft comment:
When converting the product price from a string (customizations.productPrice) to a number, consider using parseFloat rather than Number. This can help avoid unintended falsy results (e.g. '0' might fall back to 0.1). - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. packages/sdk/src/hooks/use-transfer-token.ts:384
- Draft comment:
Ensure the retry delay calculation properly incorporates the 'backoffMultiplier' from the retry config. In the current implementation after a blockhash error, the delay is computed as baseDelay * backoffMultiplier ** attempt. Verify that this behavior meets your desired exponential backoff policy. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =50%<= threshold50%The comment is asking the PR author to verify the behavior of the retry delay calculation, which is against the rules. However, it also provides a specific suggestion about how the calculation is currently implemented, which could be useful for the author to consider. The comment could be rephrased to focus on the suggestion rather than asking for verification.
4. packages/react/src/components/ui/payment-modal-content.tsx:59
- Draft comment:
Consider using a dedicated currency formatting utility (or Intl.NumberFormat) for displaying totals instead of manually concatenating the '$' symbol. This will improve localization and consistency in future iterations. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
5. apps/docs/app/(home)/components/demo-preview.tsx:95
- Draft comment:
There appears to be an accidental double space betweenborder-gray-200androunded-lgin the className. Consider using a single space to ensure consistency. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_hx1Yyie9UlEQvbO6
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
gm gm Guys, |
Overview
This PR adds Buy Now and Cart payment modes to the Commerce SDK, enabling single-product and multi-product checkout flows.
What I Worked On
Payment Modes
Testing
All contribution requirements met:
Important
Add 'Buy Now' and 'Cart' payment modes to Commerce SDK with updated components, tests, and configurations.
payment-modal-content.tsx.SecureIframeShellandPaymentModalContentto handle new payment modes.ProductandPaymentConfiginterfaces insecure-iframe-shell.tsx.complete-payment-flow.test.tsx.use-transfer-sol.test.tsxanduse-transfer-token.test.tsxfor new functionalities.PaymentConfigfor price and decimal overrides insecure-iframe-shell.tsx.index.tsxto export new types and functions.This description was created by
for 6c63e83. You can customize this summary. It will automatically update as commits are pushed.