fetch method
Future<Response<RazorpayStakeholder> >
fetch({
- required String accountId,
- required String stakeholderId,
- void callback(
- RazorpayApiException?,
- 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,
);
}