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