<MoonPayBuyButton> renders a card payment button inline in your layout. It
is the declarative alternative to
client.setupBuyButton().
BuyButtonSection.tsx
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
quote | string | ✅ | — | Quote signature from getQuote(). Reactive — updating this prop pushes the new signature into the frame without a remount. |
onEvent | (event: BuyButtonEvent) => void | — | Callback for buy button lifecycle events. See BuyButtonEvent. | |
style | ViewStyle | height: 48 | Container style. |
BuyButtonEvent
Use event.kind to handle each event.
| kind | Payload | When you receive it |
|---|---|---|
"complete" | { transaction: FrameTransaction } | The payment finished. Inspect FrameTransaction for the outcome. |
"challenge" | { kind: "frame"; url: string } | Verification required. Render <MoonPayChallenge> with the provided URL. |
"error" | { code: string; message: string } | The flow encountered an error. |
"error" event with
code: "quoteExpired". Fetch a new quote and update the quote prop to retry.