Get started with the SDK
Include the SDK
You can install the SDK with your favorite package manager (e.g.,npm, yarn):
React Native
Initialize the SDK
Initialize a Payrails client as shown below, with configuration:React Native
Optional: custom return URLs for redirect payments
If your integration uses redirect-based payment methods such as Lean or Generic Redirect, you can also passreturnInfo to PayrailsProvider.
React Native
-
If
returnInfois omitted, the SDK uses its default hosted return URLs instead. - 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. Redirection does not emit terminal SDK callbacks such asonAuthorizeSuccess,onAuthorizeFailure, oronAuthorizeCancel.