makePayment method

  1. @override
Future<MyPosPaymentResponse> makePayment({
  1. required double amount,
  2. required MyPosCurrency currency,
  3. bool printMerchantReceipt = true,
  4. bool printCustomerReceipt = true,
  5. bool fixedPinPad = false,
  6. bool giftCardTransaction = false,
  7. String? eReceiptReceiver,
  8. 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');
  }
}