Skip to content

Commit dba0f72

Browse files
committed
updated to react 18
1 parent 73a6e01 commit dba0f72

File tree

7 files changed

+6054
-73
lines changed

7 files changed

+6054
-73
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ import { useFlutterwave } from 'flutterwave-react-v3';
6868
payment_options: 'card,mobilemoney,ussd',
6969
customer: {
7070
71-
phonenumber: '07064586146',
72-
name: 'joel ugwumadu',
71+
phone_number: '070********',
72+
name: 'john doe',
7373
},
7474
customizations: {
7575
title: 'my Payment Title',
@@ -107,8 +107,8 @@ export default function App() {
107107
payment_options: 'card,mobilemoney,ussd',
108108
customer: {
109109
110-
phonenumber: '07064586146',
111-
name: 'joel ugwumadu',
110+
phone_number: '070********',
111+
name: 'john doe',
112112
},
113113
customizations: {
114114
title: 'My store',
@@ -152,8 +152,8 @@ export default function App() {
152152
payment_options: 'card,mobilemoney,ussd',
153153
customer: {
154154
155-
phonenumber: '07064586146',
156-
name: 'joel ugwumadu',
155+
phone_number: '070********',
156+
name: 'john doe',
157157
},
158158
customizations: {
159159
title: 'my Payment Title',
@@ -205,8 +205,8 @@ export default function App() {
205205
payment_plan="3341",
206206
customer: {
207207
208-
phonenumber: '07064586146',
209-
name: 'joel ugwumadu',
208+
phone_number: '070********',
209+
name: 'john doe',
210210
},
211211
meta = { counsumer_id: "7898", consumer_mac: "kjs9s8ss7dd" },
212212
customizations: {
@@ -254,7 +254,7 @@ Read more about our parameters and how they can be used [here](https://developer
254254
| payment_options | True | This specifies the payment options to be displayed e.g - card, mobilemoney, ussd and so on. |
255255
| payment_plan | False | This is the payment plan ID used for Recurring billing |
256256
| redirect_url | False | URL to redirect to when a transaction is completed. This is useful for 3DSecure payments so we can redirect your customer back to a custom page you want to show them. |
257-
| customer | True | This is an object that can contains your customer details: e.g - 'customer': {'email': '[email protected]','phonenumber': '08012345678','name': 'Takeshi Kovacs' } |
257+
| customer | True | This is an object that can contains your customer details: e.g - 'customer': {'email': '[email protected]','phone_number': '08012345678','name': 'Takeshi Kovacs' } |
258258
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
259259
| meta | False | This is an object that helps you include additional payment information to your request e.g {'consumer_id': 23,'consumer_mac': '92a3-912ba-1192a' } |
260260
| customizations | True | 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' } |

dist/types.d.ts

+16-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export interface FlutterWaveProps {
3131
* This is an object that can contains your customer details.
3232
* e.g {
3333
* 'email': 'example@gmail.com',
34-
* 'phonenumber': '08012345678',
34+
* 'phone_number': '08012345678',
3535
* 'name': 'Takeshi Kovacs'
3636
* }
3737
*/
3838
customer: {
3939
email: string;
40-
phonenumber: string;
40+
phone_number: string;
4141
name: string;
4242
};
4343
/**
@@ -70,6 +70,19 @@ export interface FlutterWaveProps {
7070
*/
7171
onclose: () => void;
7272
public_key: string;
73+
/**
74+
* An array of objects containing the subaccount IDs to split the payment into.
75+
* e.g subaccounts: [
76+
{
77+
id: "RS_A8EB7D4D9C66C0B1C75014EE67D4D663",
78+
transaction_split_ratio: 2,
79+
transaction_charge_type: "flat_subaccount",
80+
transaction_charge: 4200,
81+
},
82+
]
83+
* Check out {@link https://developer.flutterwave.com/docs/collecting-payments/split-payments/} for more information on subaccounts.
84+
*/
85+
subaccounts?: Array<unknown>;
7386
}
7487
export interface FlutterwaveConfig {
7588
public_key: FlutterWaveProps['public_key'];
@@ -82,6 +95,7 @@ export interface FlutterwaveConfig {
8295
redirect_url?: FlutterWaveProps['redirect_url'];
8396
payment_plan?: FlutterWaveProps['payment_plan'];
8497
payment_options: FlutterWaveProps['payment_options'];
98+
subaccounts?: FlutterWaveProps['subaccounts'];
8599
}
86100
export interface InitializeFlutterwavePayment {
87101
onClose: FlutterWaveProps['onclose'];

example/src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function App() {
1111
payment_options: 'card,mobilemoney,ussd',
1212
customer: {
1313
14-
phonenumber: '08102909304',
14+
phone_number: '08102909304',
1515
name: 'test user',
1616
},
1717

example/src/dist/types.d.ts

+16-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export interface FlutterWaveProps {
3131
* This is an object that can contains your customer details.
3232
* e.g {
3333
* 'email': 'example@gmail.com',
34-
* 'phonenumber': '08012345678',
34+
* 'phone_number': '08012345678',
3535
* 'name': 'Takeshi Kovacs'
3636
* }
3737
*/
3838
customer: {
3939
email: string;
40-
phonenumber: string;
40+
phone_number: string;
4141
name: string;
4242
};
4343
/**
@@ -70,6 +70,19 @@ export interface FlutterWaveProps {
7070
*/
7171
onclose: () => void;
7272
public_key: string;
73+
/**
74+
* An array of objects containing the subaccount IDs to split the payment into.
75+
* e.g subaccounts: [
76+
{
77+
id: "RS_A8EB7D4D9C66C0B1C75014EE67D4D663",
78+
transaction_split_ratio: 2,
79+
transaction_charge_type: "flat_subaccount",
80+
transaction_charge: 4200,
81+
},
82+
]
83+
* Check out {@link https://developer.flutterwave.com/docs/collecting-payments/split-payments/} for more information on subaccounts.
84+
*/
85+
subaccounts?: Array<unknown>;
7386
}
7487
export interface FlutterwaveConfig {
7588
public_key: FlutterWaveProps['public_key'];
@@ -82,6 +95,7 @@ export interface FlutterwaveConfig {
8295
redirect_url?: FlutterWaveProps['redirect_url'];
8396
payment_plan?: FlutterWaveProps['payment_plan'];
8497
payment_options: FlutterWaveProps['payment_options'];
98+
subaccounts?: FlutterWaveProps['subaccounts'];
8599
}
86100
export interface InitializeFlutterwavePayment {
87101
onClose: FlutterWaveProps['onclose'];

0 commit comments

Comments
 (0)