makePayment method
Future<PaymentResponse>
makePayment({
- required double amount,
- required MyPosCurrency currency,
- bool printMerchantReceipt = true,
- bool printCustomerReceipt = true,
- bool fixedPinPad = false,
- bool giftCardTransaction = false,
- String? eReceiptReceiverEmail,
- 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? eReceiptReceiverEmail,
String? reference,
}) async {
final Map<String, dynamic> args = {
'amount': amount,
'currency': currency.name,
'printMerchantReceipt': printMerchantReceipt,
'printCustomerReceipt': printCustomerReceipt,
'fixedPinpad': fixedPinPad,
'giftCardTransaction': giftCardTransaction,
'eReceiptReceiverEmail': eReceiptReceiverEmail,
'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 'FAILED':
return PaymentResponse.failed;
case 'UNKNOWN':
return PaymentResponse.unknown;
}
return PaymentResponse.unknown;
}