Use this file to discover all available pages before exploring further.
Render the Google Pay frame in your app and initiate a transaction with a quote signature. The quote must have executable: true. The provider mounts the frame as a react-native-webview.
Setup Google Pay
import { useMoonPay, type GooglePayEvent,} from "@moonpay/platform-sdk-react-native";export function GooglePayScreen({ quoteSignature,}: { quoteSignature: string;}) { const { client } = useMoonPay(); const start = async () => { const googlePayResult = await client.setupGooglePay({ quote: quoteSignature, onEvent: (event: GooglePayEvent) => { switch (event.kind) { case "ready": break; case "complete": console.log(event.payload.transaction); break; case "quoteExpired": // Fetch a new quote, then update the frame: // event.payload.setQuote(newQuote.signature); break; case "challenge": // Render the challenge frame at the provided URL // See: /platform/guides/handling-challenges console.log(event.payload.url); break; case "error": console.error(event.payload.kind, event.payload.message); break; case "unsupported": // Google Pay isn't available in this environment — fall back to another method. break; } }, }); if (!googlePayResult.ok) { // Handle error console.error(googlePayResult.error.kind, googlePayResult.error.message); return; } const googlePay = googlePayResult.value; }; // ...}
The transaction object returned on "complete". FrameTransaction is a discriminated union — the failure variant carries failureReason, the non-failure variant always carries id.
Field
Type
Required
Description
status
string
✅
The transaction status. On the failure variant, "failed".
id
string
Required on the non-failure variant; optional when status is "failed" (a transaction may not exist yet on early failure).
failureReason
string
Present only on the failure variant (status === "failed").