makePayment method
Future<MyPosPaymentResponse>
makePayment({
- required double amount,
- required MyPosCurrency currency,
- bool printMerchantReceipt = true,
- bool printCustomerReceipt = true,
- bool fixedPinPad = false,
- bool giftCardTransaction = false,
- String? eReceiptReceiver,
- String? reference,
override
Implementation
@override
Future<MyPosPaymentResponse> makePayment({
required double amount,
required MyPosCurrency currency,
bool printMerchantReceipt = true,
bool printCustomerReceipt = true,
bool fixedPinPad = false,
bool giftCardTransaction = false,
String? eReceiptReceiver,
String? reference,
}) async {
final Map<String, dynamic> args = {
'amount': amount,
'currency': currency.name,
'printMerchantReceipt': printMerchantReceipt,
'printCustomerReceipt': printCustomerReceipt,
'fixedPinpad': fixedPinPad,
'giftCardTransaction': giftCardTransaction,
'eReceiptReceiver': eReceiptReceiver,
'reference': reference,
};
final res = await methodChannel.invokeMethod('makePayment', args);
try {
return MyPosPaymentResponse.fromMap(Map<String, dynamic>.from(res));
} catch (e) {
print('Error parsing makePayment response: $e');
return const MyPosPaymentResponse(status_text: 'UNKNOWN');
}
}