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
If the `options` property on the [FlutterwaveButton](flutterwavebuttonprops-interface) changes, when next the user taps on the button a new payment will be initialized whether the last one was successful or not.
66
+
If the `options` property on the [PayWithFlutterwaveV2](flutterwavebuttonprops-interface) changes, when next the user taps on the button a new payment will be initialized whether the last one was successful or not.
67
67
68
68
Remember you cannot use the same transaction reference for two different payments, remember to recreate the transaction reference before allowing the user initiate a new payment.
69
69
70
70
71
71
## Usage
72
72
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)
140
+
### FlutterwaveInitV2
141
+
When called, this function returns a Promise which resolves to a string on success and rejects if an error occurs. [See all config options](#flutterwaveinitv2options)
143
142
144
143
Import `FlutterwaveInitV2` from `react-native-flutterwave` and use it like so.
// or import FlutterwaveInitV2 from 'react-native-flutterwave/v2';
146
+
// or import FlutterwaveInitV2 from 'react-native-flutterwave/FlutterwaveInitV2';
148
147
149
148
// initialize a new payment
150
149
constpayment=awaitFlutterwaveInitV2({
@@ -168,12 +167,12 @@ handlePaymentError(
168
167
);
169
168
````
170
169
### Aborting Payment Initialization
171
-
Hi :wave:, 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/v2/AbortingPaymentInitialization.md)
170
+
Hi :wave:, so there are cases where you have already initialized a payment with `FlutterwaveInitV2` 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/v2/AbortingPaymentInitialization.md)
| PBFPubKey | Yes | string |**REQUIRED**| Your merchant public key, see how to get your [API Keys](https://developer.flutterwave.com/v2.0/docs/api-keys)|
@@ -193,10 +192,10 @@ Hi :wave:, so there are cases where you have already initialized a payment with
193
192
| custom_title | No | string | undefined | Text to be displayed as the title of the payment modal. |
194
193
| custom_description | No | string | undefined | Text to be displayed as a short modal description. |
195
194
| custom_logo | No | string | undefined | Link to the Logo image. |
196
-
| meta | No | array of [FlutterwavePaymentMeta](#flutterwavepaymentmeta)| undefined | Any other custom data you wish to pass. |
195
+
| meta | No | array of [FlutterwavePaymentMetaV2](#flutterwavepaymentmetav2)| undefined | Any other custom data you wish to pass. |
| style | No | object | undefined | Used to apply styling to the button.|
@@ -205,20 +204,17 @@ Hi :wave:, so there are cases where you have already initialized a payment with
205
204
| onDidInitialize | No | function | undefined | This is called when a new payment link has been successfully initialized.|
206
205
| onInitializeError | No | function | undefined | This is called if an error occurred while initializing a new pyment link. The function will receive [FlutterwaveInitError](#flutterwaveiniterror)|
207
206
| onAbort | No | function | undefined | This is called if a user aborts a transaction, a user can abort a transaction when they click on the dialog's backdrop and choose cancel when prompted to cancel transaction. |
208
-
| options | Yes |**[FlutterwaveInitOptions](#flutterwaveinitoptions)**|**REQUIRED**| The option passed here is used to initialize a payment. |
207
+
| options | Yes |**[FlutterwaveInitOptions](#flutterwaveinitv2options)**|**REQUIRED**| The option passed here is used to initialize a payment. |
209
208
| customButton | No | function | undefined | This is used to render a custom button. The function a prop argument structured like [CustomButtonProps](#custombuttonprops), this function should return a valid React node. |
210
209
| alignLeft | No | boolean | undefined | This aligns the content of the button to the left. |
211
210
212
-
### DefaultButtonProps
213
-
[See Interface](#defaultbuttonprops-interface)
211
+
### FlwButton Props
212
+
[See Interface](#flwbuttonprops-interface)
214
213
| Name | Required | Type | Default | Description |
| style | No |object| undefined |Used to apply styling to the button.|
217
-
| onPress | Yes | function | undefined | This |
215
+
| style | No |ViewStyle| undefined |This component uses the same style properties that are applicable to react-native's View component style.|
216
+
| onPress | Yes | function | undefined | This property receive a function that is called on button press. |
218
217
| disabled | No | boolean | undefined | This disables button, and causes onPress not to be fired.|
219
-
| isBusy | No | boolean | undefined | This puts the button in a busy state, making the content look faded.|
220
-
| onSizeChange | No | (ev: {width: number; height: number}) => void | undefined | If provided this function is fired whenever the size(height or width) of the button changes |
221
-
| children | Yes | ReactElement | undefined | This will be the content rendered within the button, if string is to be direct decendant, remember to put string in the Text component. |
222
218
| alignLeft | No | boolean | undefined | This aligns the content of the button to the left. |
0 commit comments