cancelPayment method

dynamic cancelPayment(
  1. CancelRequest request,
  2. dynamic callback(
    1. PaymentResponse response
    )
)

Implementation

cancelPayment(CancelRequest request,
    Function(PaymentResponse response) callback) async {
  _stream().listen((PaymentResponse response) {
    if (response.status == "ENTERED") {
      print(response.id);
      callback.call(response);
    } else {
      print(response.status);
    }
  });

  var uri = _generateCancelUri(request);
  await _messagesChannel!.invokeMethod('reversal', {"uri": uri});
}