Skip to main content
Easily implement Flutterwave for payments in your React Native appliction. This library supports both Android and iOS, and use the Flutterwave’s V3 API.
ios-previewandroid-preview

Table Of Content

What’s Inside?

  • Pay with Flutterwave button and checkout dialog.
  • Standard payment initialization function.
  • Flutterwave designed button.

:warning: If Using Version 2 API :warning:

This version of the library’s docs focuses on use cases with the Version 3 of Flutterwaves API, if you are still using the Version 2 API please use this documentation instead.

Installation

This library is available on npm, you can install it by running npm install --save flutterwave-react-native or yarn add flutterwave-react-native

Dependencies

In order to render the Flutterwave checkout screen this library depends on react-native-webview ensure you properly install this library before continuing.

Activity Indicator (only needed for android)

To display the Flutterwave styled activity indicator when the checkout screen is being loaded on Android you will need to add some modules in android/app/build.gradle. Skip this if you already have setup your app to support gif images.

:fire: MERCHANT PUBLIC KEY :fire:

In order to use this library you are required to use your merchant public key and not the secret key. See how to get your API Keys here

:fire: IMPORTANT INFORMATION :fire:

If the options property on PayWithFlutterwave changes, when next the user taps on the button a new payment will be initialized whether the last one was successful or not. Remember you cannot use the same transaction reference for two different payments, also remember to recreate the transaction reference before allowing the user initiate a new payment.

Usage

Below are a few examples showcasing how you can use the library to implement payment in your React Native app.

PayWithFlutterwave

preview View All Props Import PayWithFlutterwave from flutterwave-react-native and use it like so.

PayWithFlutterwave (with custom render)

preview View All Props Import PayWithFlutterwave from flutterwave-react-native and use it like so.

FlutterwaveButton (Flutterwave styled button)

preview View All Props Import FlutterwaveButton from flutterwave-react-native and use it like so.

FlutterwaveInit

When called, this function returns a Promise which resolves to a string on success and rejects if an error occurs. See all config options Import FlutterwaveInit from flutterwave-react-native and use it like so.

Aborting Payment Initialization

:wave: Hi, so there are cases where you have already initialized a payment with FlutterwaveInit but might also want to be able to cancel the payment initialization should in case your component is being unmounted or you want to allow users cancel the action before the payment is initialized, we have provided a way for you to do this… continue reading

Props

FlutterwaveInitOptions

See Interface

PayWithFlutterwaveProps

See Interface

FlutterwaveButton Props

See Interface

Types

CustomButtonProps

RedirectParams

FlutterwaveInitError

FlutterwavePaymentMeta

FlutterwaveInitCustomer

FlutterwaveInitCustomizations

FlutterwaveInitSubAccount

FlutterwaveInitOptions Interface

PayWithFlutterwaveProps Interface

FlutterwaveButtonProps Interface