checkout method

  1. @override
Future<CheckoutResponse> checkout(
  1. BuildContext context,
  2. CheckoutMethod checkoutmethod,
  3. String identifier, {
  4. String? bvn,
  5. String? nin,
})
override

Implementation

@override
Future<CheckoutResponse> checkout(
  BuildContext context,
  CheckoutMethod checkoutmethod,
  String identifier, {
  String? bvn,
  String? nin,
}) async {
  // assert(() {
  //   _validateChargeAndKey(charge);
  //   return true;
  // }());
  _performChecks();
  controller.checkoutmethod = checkoutmethod;
  controller.identifier = identifier;
  if (bvn != null && bvn.isNotEmpty) {
    controller.directcheckout = true;
    controller.bvnController.text = bvn;
    controller.stage = 1;
  }
  if (nin != null && nin.isNotEmpty) {
    controller.directcheckout = true;
    controller.bvnController.text = nin;
    controller.stage = 1;
  }
  CheckoutResponse? response = await showDialog(
    barrierDismissible: false,
    context: context,
    builder: (BuildContext context) => CheckoutWidget(),
  );
  controller.directcheckout = false;
  return response!;
}