fetchAccountDoc method

Future<Response<RazorpayAccountDocuments>> fetchAccountDoc({
  1. required String accountId,
  2. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayAccountDocuments>?
    )?,
})

Fetches account documents

@param accountId - The unique identifier of the account.

Implementation

Future<Response<RazorpayAccountDocuments>> fetchAccountDoc({
  required String accountId,
  void Function(RazorpayApiException?, Response<RazorpayAccountDocuments>?)?
      callback,
}) async {
  if (accountId.isEmpty) {
    throw ArgumentError('accountId is required');
  }
  return api.get<RazorpayAccountDocuments>(
    {
      'version': 'v2',
      'url': '$BASE_URL/$accountId/documents',
    },
    fromJsonFactory: RazorpayAccountDocuments.fromJson,
    callback: callback,
  );
}