Drop-in API Reference
PayrailsDropin
Properties
Events
Style
Pass aDropinStyles object to the styles property.
Payment Methods Configuration
Controls how individual payment methods appear and behave within the Drop-in.Translations
All UI strings are localised through thetranslations prop.
Elements API Reference
All Elements must be rendered inside aPayrailsProvider. For usage examples, see How to Use Elements.
PayWithCardButton
Renders a payment button for a stored card instrument.
The button displays the card network icon and masked card number automatically. It is disabled while a payment request is in progress.
Hooks
PayWithNewCardButton
Renders the submit button for a new card payment. Must be placed inside a TokenizationForm.
The button is automatically disabled until all card fields pass validation.
Related hooks
ApplePay
Renders the native Apple Pay button on iOS. Returns null on Android and when Apple Pay is unavailable.
Hooks
GooglePay
Renders the native Google Pay button on Android. Returns null on iOS and when Google Pay is unavailable.
Hooks
PayPal
Renders a PayPal payment button. Works on both iOS and Android.
Hooks
GenericRedirect
Renders a redirect-based payment button for methods such as iDEAL, Pix, Yape, MercadoPago, and others.
paymentMethodCode must match the payment method code from your configuration exactly, including case.
RedirectModes
Lean
Renders a bank transfer payment button for the UAE, powered by the Lean SDK checkout dialog.
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
translations.
LeanCustomization
For payment completion options, see Payment Completion Modes.
Event Callbacks
All Elements share the same callback contract. See the React Native event glossary for full type definitions.Stop a payment after wallet approval
For Apple Pay and Google Pay,onRequestStart runs after the shopper approves in the sheet and before the SDK sends the authorization request. Resolve false to stop the payment. A callback that rejects stops it too. The SDK then skips the authorization request and calls onAuthorizeFailure with VALIDATION_FAILED. Resolve true to continue. The SDK waits for the promise with no timeout.
onRequestStart also runs for stored Apple Pay and Google Pay instruments, generic redirect and Lean payments, right after the button tap and before the authorization request.
onAuthorizeRequestStart is a notification that fires once the authorization request starts, so it doesn’t fire when onRequestStart stops the payment.
useExecuteApplePayPayment and useExecuteGooglePayPayment don’t read callbacks set on PayrailsProvider. The ApplePay and GooglePay components accept it as a prop or from PayrailsProvider, and stop at the first handler that returns false.
PayPal and card payments don’t call onRequestStart. Use onAuthorizeStart to gate those.
On iOS, the Apple Pay sheet shows a success state once the shopper approves, before the SDK calls onRequestStart. If you stop the payment, show your own error.