Render the Apple Pay frame and start a transaction.
client.setupApplePay() is deprecated. Use the
<MoonPayApplePayButton>
component instead — it renders the Apple Pay button inline exactly where you
place it in your layout. The imperative method presents the frame in a
full-screen modal, which is rarely the right UX for a payment button.
Render the Apple Pay frame and initiate a transaction with a quote signature.
The quote must have executable: true. The provider presents the frame in a
full-screen native modal.
Apple Pay availability inside a WebView depends on iOS WebKit support. The
frame emits "unsupported" when Apple Pay isn’t available in the current
environment — surface a fallback payment method.
Setup Apple Pay
import { useMoonPay, type ApplePayEvent,} from "@moonpay/platform-sdk-react-native";export function ApplePayScreen({ quoteSignature }: { quoteSignature: string }) { const { client } = useMoonPay(); const start = async () => { const applePayResult = await client.setupApplePay({ quote: quoteSignature, onEvent: (event: ApplePayEvent) => { 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 "error": console.error(event.payload.kind, event.payload.message); break; case "unsupported": // Apple Pay isn't available in this environment — fall back to another method. break; } }, }); if (!applePayResult.ok) { // Handle error console.error(applePayResult.error.kind, applePayResult.error.message); return; } const applePay = applePayResult.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").
"oneTapApplePaySecondFactorRequired" is emitted on the 1TAP Apple Pay flow when MoonPay needs a second authentication factor — typically because the device is new or the customer hasn’t completed a recent challenge. Hand off to the full connect flow with client.connect(), then retry.Apple Pay being unavailable in the environment is signalled separately through the "unsupported" event, not as an error.
Setup errors cover frame initialization only (for example, a handshake
timeout). Quote problems, second-factor requirements, and Apple Pay
availability are reported through onEvent after setup succeeds — as the
"error", "quoteExpired", and "unsupported" events respectively.