PrimerCheckoutProvider, then render the prebuilt PrimerCheckoutSheet or build your own layout from the components and hooks below. Import everything from @primer-io/react-native.
Core API
Card form
Payment methods
Theming
Common objects
Provider and hooks pattern
Every integration has onePrimerCheckoutProvider. The components and hooks below it share its checkout session. You customize the checkout by choosing which components to render and by building your own UI with the hooks.
The quickest integration renders the prebuilt sheet inside the provider:
PrimerCardFormProvider around the card form, and the card payment method started with usePrimerPaymentMethod('PAYMENT_CARD'):
usePrimerCheckout().paymentOutcome. See Handle the payment result.
Where each hook works
A hook called outside the provider it needs throws an error that names the missing provider.
See also
PrimerCheckoutProvider
Start a checkout session and wrap your checkout UI.
PrimerCheckoutSheet
Run the whole checkout in a prebuilt bottom sheet.
usePrimerCheckout
Read the checkout state and the payment outcome.
Handle the payment result
React to successful, pending and failed payments.