You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Easily implement Flutterwave for payments in your React Native appliction. This library supports both Android and iOS, and use the Flutterwave's V3 API.
6
+
7
+
Easily implement Flutterwave for payments in your React Native appliction. This library supports both Android and iOS, and use the Flutterwave's V3 API.
@@ -45,51 +46,61 @@ Easily implement Flutterwave for payments in your React Native appliction. This
45
46
-[Contributing](./CONTRIBUTING.md)
46
47
47
48
## What's Inside?
49
+
48
50
- Pay with Flutterwave button and checkout dialog.
49
51
- Standard payment initialization function.
50
52
- Flutterwave designed button.
51
53
52
54
## :warning: If Using Version 2 API :warning:
55
+
53
56
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](./README.v2.md) instead.
54
57
55
58
## Installation
59
+
56
60
This library is available on npm, you can install it by running `npm install --save flutterwave-react-native` or `yarn add flutterwave-react-native`
57
61
58
62
### Dependencies
63
+
59
64
In order to render the Flutterwave checkout screen this library depends on [react-native-webview](https://github.com/react-native-community/react-native-webview) ensure you properly install this library before continuing.
60
65
61
66
### Activity Indicator (only needed for android)
67
+
62
68
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`.
63
-
***Skip this if you already have setup your app to support gif images.***
64
-
````javascript
69
+
**_Skip this if you already have setup your app to support gif images._**
70
+
71
+
```javascript
65
72
dependencies {
66
73
// If your app supports Android versions before Ice Cream Sandwich (API level 14)
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](https://developer.flutterwave.com/v3.0/docs/api-keys)
76
84
77
85
### :fire: IMPORTANT INFORMATION :fire:
86
+
78
87
If the `options` property on [PayWithFlutterwave](#paywithflutterwaveprops-interface) changes, when next the user taps on the button a new payment will be initialized whether the last one was successful or not.
79
88
80
89
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.
81
90
82
-
83
91
## Usage
92
+
84
93
Below are a few examples showcasing how you can use the library to implement payment in your React Native app.
When called, this function returns a Promise which resolves to a string on success and rejects if an error occurs. [See all config options](#flutterwaveinitoptions)
191
207
192
208
Import `FlutterwaveInit` from `flutterwave-react-native` and use it like so.
: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](./docs/AbortingPaymentInitialization.md)
| authorization | Yes | string |**REQUIRED**| Your merchant public key, see how to get your [API Keys](https://developer.flutterwave.com/v3.0/docs/api-keys)|
225
245
| tx_ref | Yes | string |**REQUIRED**| Your transaction reference. This MUST be unique for every transaction.|
@@ -235,8 +255,9 @@ try {
235
255
| customizations | No |[FlutterwaveInitCustomizations](#flutterwaveinitcustomizations)| undefined | This is an object that contains title, logo, and description you want to display on the modal `E.g. {'title': 'Pied Piper Payments', 'description': 'Middleout isn't free. Pay the price', 'logo': 'https://assets.piedpiper.com/logo.png'}`|
| style | No | object | undefined | Used to apply styling to the button.|
242
263
| onRedirect | Yes | function |**REQUIRED**| Called when a payment is completed successfully or is canceled. The function will receive [redirect params](#redirectparams) as an argument.|
@@ -249,51 +270,58 @@ try {
249
270
| alignLeft | No | boolean | undefined | This aligns the content of the button to the left. |
0 commit comments