executeApplePayButton method

Future<MFGetPaymentStatusResponse> executeApplePayButton(
  1. MFExecutePaymentRequest? executePaymentRequest,
  2. dynamic onInvoiceCreated(
    1. String invoiceId
    )?
)

Implementation

Future<MFGetPaymentStatusResponse> executeApplePayButton(
    MFExecutePaymentRequest? executePaymentRequest,
    Function(String invoiceId)? onInvoiceCreated) async {
  if (onInvoiceCreated != null) {
    eventChannel.receiveBroadcastStream().listen((invoiceId) {
      onInvoiceCreated(invoiceId);
    });
  }

  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      MFConstants.channelName.executeApplePayButton, codec,
      binaryMessenger: _binaryMessenger);
  final List<Object?>? replyList =
      await channel.send(<Object?>[executePaymentRequest]) as List<Object?>?;
  return modelParser<MFGetPaymentStatusResponse>(replyList);
}