How to Integrate Drop-in
Drop-in is a pre-built UI that bundles all your payment methods into a single, ready-to-mount component. No per method integration required.Prerequisites
@payrails/react-native-sdkinstalled.- A backend endpoint that calls
/client/initand returns the session response. - See the Getting Started guide for provider setup.
Steps
1. Mount the Drop-in
Pass the full/client/init response to config. The Drop-in will not render without a valid config.
React Native
2. Configure return URLs
-
If you use
returnInfo, the base return URLs must also be configured in the Payrails Admin Portal. Contact the Payrails team for that setup. -
returnInfodefines where the payment provider redirects the user after a redirect-based payment flow.
3. Handle payment outcomes
Useevents.onAuthorizeSuccess and events.onAuthorizeFailure to navigate or show feedback. Always confirm the final payment status server-side via webhook — do not rely solely on client callbacks.
Customise the Drop-in
- Styles: pass a
DropinStylesobject to thestylesproperty. See the Drop-in API Reference for the full type. - Payment method visibility: use
paymentMethodsConfigurationto show or hide logos, stored instruments, and cardholder name. See the Drop-in API Reference. - Translations: pass a
Translationsobject to localise all labels. See the Drop-in API Reference.
How to Use Elements
Each Element handles a single payment method — drop it anywhere in your UI for full control over layout and placement.-
Elements must be rendered inside a
PayrailsProvider. See the Getting Started guide for provider setup. - For configuration options for each element, see the Elements API Reference.
How to Pay with a Stored Card
React Native
How to Pay with a New Card
React Native
How to Add Apple Pay
Apple Pay renders a native button on iOS and returnsnull on Android.
Prerequisites: Apple Pay must be configured in your Apple Developer account, and the device must have at least one card added.
React Native
How to Add Google Pay
Google Pay renders a native button on Android and returnsnull on iOS.
React Native
How to Add PayPal
React Native
How to Pay with a Stored PayPal Account
React Native
How to Add Generic Redirect (iDeal, pix, yape, etc.)
PassreturnInfo on PayrailsProvider so the payment provider redirects the user back to your app via deep link or universal link after payment.
React Native
How to Add Lean (Bank Transfer, UAE)
Prerequisites- Lean requires the peer dependency
lean-react-nativewith version4.2.0. Earlier versions may not be compatible. - Also install
react-native-webviewif it is not already installed in your project.
React Native
returnInfo on PayrailsProvider to redirect the user back to your app after the bank transfer completes.
React Native