Conversation
Use useProducts hook to fetch available products and conditionally render product checkout buttons. Single product button shows product name, multi-product button appears only when 2+ products exist. Gracefully falls back to amount-only checkout if no products.
- Update .gitignore to allow local-packages/*.tgz - Include local @moneydevkit/core and @moneydevkit/nextjs packages - Update package.json to reference local packages - Update Dockerfile to copy local-packages directory
Updated the local package to include the fix for accessing product.prices with optional chaining (product.prices?.[0]) to avoid potential runtime errors when prices array is undefined.
…dition The webhook handler was creating a new node instance and immediately calling receivePayments() without syncing first. This caused payments to be missed when the webhook arrived before the node had synced with the blockchain state. This fix: - Calls syncWallets() before receivePayments() to ensure node has latest state - Adds detailed logging to help debug webhook processing - Preserves default handler behavior for non-webhook requests
The webhook handler now retries up to 5 times with increasing delays (1s, 2s, 3s, 5s, 8s) to give the node time to sync and receive payments. Each attempt creates a fresh node instance and calls syncWallets() before receivePayments().
Contributor
Author
|
@f3r10 Oops did you test this? This was something I made a while ago but I wasn't quite ready to merge it in. |
Collaborator
|
oh sorry, it compiled with the latest mdk changes, so assume it was ready @NatElkins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
useProductshook to fetch available products dynamicallyRelated PRs