checkout method

dynamic checkout(
  1. CheckoutRequest request,
  2. dynamic callback(
    1. PaymentResponse response
    )
)

Implementation

checkout(CheckoutRequest request,
    Function(PaymentResponse response) callback) async {
  _stream().listen((response) {
    print(response.id);
    callback.call(response);
  });

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