fetchStakeholderDoc method

Future<Response<RazorpayStakeholderDocuments>> fetchStakeholderDoc({
  1. required String accountId,
  2. required String stakeholderId,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayStakeholderDocuments>?
    )?,
})

Fetches stakeholder documents

@param accountId - The unique identifier of the account. @param stakeholderId - The unique identifier of the stakeholder.

Implementation

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