getListPaymentMethod method

Future<void> getListPaymentMethod({
  1. required dynamic onSuccess(
    1. Map<String, dynamic>
    ),
  2. required dynamic onError(
    1. String
    ),
})

Implementation

Future<void> getListPaymentMethod({
  required Function(Map<String, dynamic>) onSuccess,
  required Function(String) onError,
}) async {
  try {
    final result = await _invokeMethod('getListPaymentMethod');
    if (result is Map) {
      onSuccess(Map<String, dynamic>.from(result));
    } else {
      onError('Invalid data format');
    }
  } catch (e) {
    onError('Error fetching payment methods: $e');
  }
}