Skip to main content
<MoonPayChallenge> renders a 3DS or identity challenge frame inline in your layout. It is the declarative alternative to client.setupChallenge(). Mount this component when a payment component such as <MoonPayBuyButton> emits a "challenge" event. Pass the url from the event payload directly. Unmounting the component disposes the frame and stops event delivery.
PaymentScreen.tsx

Props

ChallengeEvent

Use event.kind to handle each event. CompleteResult is a discriminated union on flow: With resume, a buy sends "resolved" or "complete", never both. After "resolved", the transaction arrives on your buy button’s "complete" when the customer taps it again. If the frame can’t hand the purchase back, it finishes in its own payment sheet and emits "complete", so keep that handler. sessionUpgraded: true is present after a guest checkout recovery: create a new session and check the connection again. It is never on "resolved". Cancellation is a discriminated union on flow: On "cancelled", carry transactionId and challengeToken to resume the transaction if needed. On a "guest_checkout_limit_upgrade" "complete", read status. upgraded means the customer’s guest limit is raised, so request the quote again to get one with executable: true. rejected means verification failed and running the upgrade again does not change it. See Upgrade a guest account.