<MoonPayGooglePayButton> renders a Google Pay button inline in your layout.
It is the declarative alternative to
client.setupGooglePay().
Google Pay availability depends on the device and environment. The component
emits
"unsupported" when Google Pay isn’t available — surface a fallback
payment method.GooglePaySection.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. |
externalTransactionId | string | — | Partner-assigned identifier for this transaction attempt. Mount-time only. | |
onEvent | (event: GooglePayEvent) => void | — | Callback for Google Pay lifecycle events. See GooglePayEvent. | |
style | ViewStyle | height: 48 | Container style. |
GooglePayEvent
Use event.kind to handle each event.
| kind | Payload | When you receive it |
|---|---|---|
"ready" | — | The Google Pay UI is rendered and ready. |
"complete" | { transaction: FrameTransaction } | The payment finished. Inspect FrameTransaction for the outcome. |
"challenge" | { kind: "frame"; url: string } | Verification required. Render <MoonPayChallenge> with the provided URL. |
"quoteExpired" | { setQuote: (signature: string) => void } | The quote expired. Fetch a new quote and update the quote prop, or call payload.setQuote(...) directly. |
"error" | { kind: string; message: string } | The flow encountered an error. See error kinds below. |
"unsupported" | — | Google Pay isn’t available in the user’s environment. |
"error" kinds: "configurationError" | "invalidQuote" |
"quoteExpired" | "genericError"
Google Pay unavailability is signalled separately through the "unsupported"
event, not as an error.