Skip to content

Conversation

@NatElkins
Copy link
Contributor

Summary

  • Use useProducts hook to fetch available products dynamically
  • Show product checkout buttons only when products exist
  • Single product button displays actual product name
  • Multi-product button appears only when 2+ products available
  • Graceful fallback to amount-only checkout if no products or API fails

Related PRs

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().
@f3r10 f3r10 merged commit b478884 into main Jan 20, 2026
1 of 2 checks passed
@NatElkins
Copy link
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.

@f3r10
Copy link
Collaborator

f3r10 commented Jan 20, 2026

oh sorry, it compiled with the latest mdk changes, so assume it was ready @NatElkins

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