Last updated:
0 purchases
flutterwave web client
flutterwave_web_client #
A Flutter wrapper of the Flutterwave inline payment
A Flutter plugin for making payments via Flutterwave Payment Gateway. Supports web only
🚀 Installation #
To use this plugin, add flutterwave_web_client as
a dependency in your pubspec.yaml file.
Then initialize the plugin preferably in the initState of your widget.
import 'package:flutterwave_web_client/flutterwave_web_client.dart';
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
FlutterwaveWebClient.initialize(
'PUBLIC KEY GOES HERE');
super.initState();
}
}
copied to clipboard
Web #
Include the Flutterwave JS script in your index.html file
<script src="https://checkout.flutterwave.com/v3.js"></script>
copied to clipboard
Usage #
void _makePayment() async {
final customer =
FlutterwaveCustomer('[email protected]', '08102894804', 'Lazarus');
final charge = new Charge()
..amount = 100
..reference = 'test'
..currency = 'NGN'
..country = 'NG'
..customer = customer;
final response = await FlutterwaveWebClient.checkout(charge: charge);
if (response.status) {
print('Successful, Transaction ref ${response.tx_ref}');
} else {
print('Transaction failed');
}
}
copied to clipboard
It is recommended that when FlutterwaveWebClient.checkout() returns, the
payment should be verified on your backend.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.