Skip to content

Conversation

@NatElkins
Copy link

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().
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.

2 participants