fetch method

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

Fetches a stakeholder given Account ID and Stakeholder ID

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

Implementation

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