makePayment method

  1. @override
Future<Map<String, dynamic>> makePayment({
  1. required String amount,
  2. required String currencyCode,
  3. required String customerName,
  4. required String customerEmail,
  5. String? customerPhoneNumber,
  6. required String paymentReference,
  7. required String paymentDescription,
  8. required PaymentMethod paymentMethod,
})
override

Implementation

@override
Future<Map<String, dynamic>> makePayment(
    {required String amount,
    required String currencyCode,
    required String customerName,
    required String customerEmail,
      String? customerPhoneNumber,
    required String paymentReference,
    required String paymentDescription,
    required PaymentMethod paymentMethod}) async {

  final map = PaymentModel(
          amount: amount,
          currencyCode: currencyCode,
          customerName: customerName,
          paymentDescription: paymentDescription,
          paymentReference: paymentReference,
          customerEmail: customerEmail,
          customerPhoneNumber: customerPhoneNumber,
          paymentMethod: paymentMethod)
      .toMap();

  try {

    final result = await methodChannel.invokeMapMethod<String, String>(
        AppStrings.makeMonnifyPayment, map);

    return await Future.value(result);

  } catch (error) {

    rethrow;
  }
}