executeDirectPayment method
Future<MFDirectPaymentResponse>
executeDirectPayment(
- MFDirectPaymentRequest directPaymentRequest,
- String lang,
- dynamic onInvoiceCreated(
- String invoiceId
Implementation
Future<MFDirectPaymentResponse> executeDirectPayment(
MFDirectPaymentRequest directPaymentRequest,
String lang,
Function(String invoiceId)? onInvoiceCreated) async {
if (onInvoiceCreated != null) {
eventChannel.receiveBroadcastStream().listen((invoiceId) {
onInvoiceCreated(invoiceId);
});
}
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
MFConstants.channelName.executeDirectPayment, codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList = await channel
.send(<Object?>[directPaymentRequest, lang]) as List<Object?>?;
return modelParser<MFDirectPaymentResponse>(replyList);
}