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
The Flutter library helps you create seamless payment experiences in your dart mobile app. By connecting to our modal, you can start collecting payment in no time.
10
8
11
-
12
9
Available features include:
13
10
14
-
- Collections: Card, Account, Mobile money, Bank Transfers, USSD, Barter.
11
+
- Collections: Card, Account, Mobile money, Bank Transfers, USSD.
15
12
- Recurring payments: Tokenization and Subscriptions.
customization: Customization(title: "My Payment"),
78
72
isTestMode: true );
79
-
}
80
73
81
-
### Handling the response
74
+
final ChargeResponse response = await flutterwave.charge(context);
82
75
83
-
Calling the `.charge()` method returns a `Future` of `ChargeResponse` which we await for the actual response as seen above.
76
+
// Handle the response
77
+
if (response.success == true) {
78
+
// Payment was successful
79
+
} else {
80
+
// Payment failed or was cancelled
81
+
}
82
+
}
84
83
84
+
### Handling the response
85
85
86
+
Calling the `.charge()` method returns a `Future` of `ChargeResponse` which we await for the actual response as seen above.
86
87
87
-
final ChargeResponse response = await flutterwave.charge();
88
+
final ChargeResponse response = await flutterwave.charge(context);
88
89
89
-
Call the verify transaction [endpoint](https://developer.flutterwave.com/docs/verifications/transaction) with the `transactionID` returned in `response.transactionId` or the `txRef` you provided to verify transaction before offering value to customer
90
+
Call the verify transaction [endpoint](https://developer.flutterwave.com/docs/transaction-verification) with the `transactionID` returned in `response.transactionId` or the `txRef` you provided to verify transaction before offering value to customer
90
91
91
92
#### Note
92
93
93
94
-`ChargeResponse` can be null, depending on if the user cancels the transaction by pressing back.
94
-
- You need to confirm the transaction is successful. Ensure that the txRef, amount, and status are correct and successful. Be sure to [verify the transaction details](https://developer.flutterwave.com/docs/verifications/transaction) before providing value.
95
-
- Some payment methods are not instant, such a `Pay with Bank Transfers, Pay with Bank`, and so you would need to rely on [webhooks](https://developer.flutterwave.com/docs/integration-guides/webhooks) or call the transaction verification service using the [`transactionId`](https://developer.flutterwave.com/reference/endpoints/transactions#verify-a-transaction), or transaction reference you created(`txRef`)
95
+
- You need to confirm the transaction is successful. Ensure that the txRef, amount, and status are correct and successful. Be sure to [verify the transaction details](https://developer.flutterwave.com/docs/transaction-verification) before providing value.
96
+
- Some payment methods are not instant, such a `Pay with Bank Transfers, Pay with Bank`, and so you would need to rely on [webhooks](https://developer.flutterwave.com/docs/webhooks) or call the transaction verification service using the [`transactionId`](https://developer.flutterwave.com/reference/verify-transaction), or transaction reference you created(`txRef`)
96
97
- For such long payments like the above, closing the payment page returns a `cancelled` status, so your final source of truth has to be calling the transaction verification service.
97
98
98
99
## Support
@@ -119,8 +120,9 @@ Copyright (c) Flutterwave Inc.
0 commit comments