flutterwave_checkout_lbtech 0.0.10

SDKflutter
Platformandroidioswindowsmacosweb

A Flutter project for Flutterwave checkout. It implements the flutterwave html checkout (https://developer.flutterwave.com/docs/html-checkout).

Introduction

The Flutter package helps you create seamless payment experiences in your dart mobile app. It implements the flutterwave html checkout for payment collection. Kindly note this a community package; flutterwave_standard is the official package developed by the flutter wave team.

Supported Platforms

  • Android
  • iOS

Installation

  1. Add the dependency to your project. In your pubspec.yaml file add: flutterwave_checkout_lbtech: latest
  2. Run flutter pub get

Usage

Create an object of FlwCheckoutRequest. It parameters are as tabulated below:

ParameterData typeDescription
redirectUrlStringredirect_url form field
amountnumamount form field
emailStringcustomer email form field
transactionRefStringtx_ref form field
customerNameStringcustomer name form field
currencyStringcurrency form field e.g NGN, USD etc check flutterwave documentation for possible value
publicKeyStringpublic_key form field
onErrorvoid Function (String message)?callback action if any http error is encountered
import 'package:flutterwave_checkout_lbtech/models/flw_checkout_request.dart';
final FlwCheckoutRequest flwCheckoutRequest = FlwCheckoutRequest(
        redirectUrl: "https://mysite.com",// ensure it is a valid url 
        amount: 2000.50,
        email: "mail@gmail.com",
        transactionRef: DateTime.now().millisecondsSinceEpoch.toString(),
        customerName: "Solomon Oluwafemi",
        currency: "NGN",
        onError: (String message) {
          
        },
        publicKey: "FLWPUBK_TEST-gigiggjgjgjggjgjgvvnvn-X");

Call the static checkout method of FlutterwaveChecoutLbtech class. It returns an object of the ResultFromFlwCheckout class if successful and null otherwise. It takes the parameter below:

  • FlwCheckoutRequest
  • BuildContext.
import 'package:flutterwave_checkout_lbtech/flutterwave_checkout_lbtech.dart';
import 'package:flutterwave_checkout_lbtech/models/result_from_flw_checkout.dart';

final ResultFromFlwCheckout? resultFromFlwCheckout = await FlutterwaveChecoutLbtech.checkout(
            checkoutRequest: flwCheckoutRequest, context: context);

ResultFromFlwCheckout

ParameterData typeDescription
referenceNumberStringtransaction reference number
statusStringtransaction status

Key Note

As advised by the flutterwave team, kindly verify the status of any payment using their verify transaction endpoint. Click here for more info.

Built using

Flutterwave API References

Author contact

For issues or suggestions kindly send a mail to solotechblast@gmail.com