getPayments method

Future<List<InvoicePaymentModel>> getPayments(
  1. int invoiceId, {
  2. required Object authorization,
})

Parameters:

  • int invoiceId (required):

  • Object authorization:

Implementation

Future<List<InvoicePaymentModel>> getPayments(
  int invoiceId, {
  required Object authorization,
}) async {
  final response = await _getPaymentsWithHttpInfo(
    invoiceId,
    authorization: authorization,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  final responseBody = await _decodeBodyBytes(response);
  return (await apiClient.deserializeAsync(
          responseBody, 'List<InvoicePaymentModel>') as List)
      .cast<InvoicePaymentModel>()
      .toList(growable: false);
}