makePayment method
Future<PaymentResponse>
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<PaymentResponse> 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<String>('makePayment', args);
switch (res) {
case 'SUCCESS':
return PaymentResponse.success;
case 'CANCEL':
return PaymentResponse.cancel;
case 'ERROR':
return PaymentResponse.error;
case 'TIMEOUT':
return PaymentResponse.timeout;
case 'DECLINED':
return PaymentResponse.declined;
case 'UNKNOWN':
return PaymentResponse.unknown;
}
return PaymentResponse.unknown;
}