Skip to main content

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-sdk installed.
  • A backend endpoint that calls /client/init and 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.
  • returnInfo defines where the payment provider redirects the user after a redirect-based payment flow.

3. Handle payment outcomes

Use events.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 DropinStyles object to the styles property. See the Drop-in API Reference for the full type.
  • Payment method visibility: use paymentMethodsConfiguration to show or hide logos, stored instruments, and cardholder name. See the Drop-in API Reference.
  • Translations: pass a Translations object 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.

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 returns null 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 returns null 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.)

Pass returnInfo 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-native with version 4.2.0. Earlier versions may not be compatible.
  • Also install react-native-webview if it is not already installed in your project.
React Native
The button label is fixed to “Pay by bank with Al Tareq.” and cannot be overridden. Pass returnInfo on PayrailsProvider to redirect the user back to your app after the bank transfer completes.
React Native
For payment completion mode options (polling, background polling, return URLs), see Payment Completion Modes.
Last modified on September 30, 2026