fetch method
Future<Response<RazorpayAccount> >
fetch({
- required String accountId,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayAccount> ?
Fetches an account given Account ID
@param accountId - The unique identifier of the account.
Implementation
Future<Response<RazorpayAccount>> fetch({
required String accountId,
void Function(RazorpayApiException?, Response<RazorpayAccount>?)? callback,
}) async {
if (accountId.isEmpty) {
throw ArgumentError('accountId is required');
}
return api.get<RazorpayAccount>(
{
'version': 'v2',
'url': '$BASE_URL/$accountId',
},
fromJsonFactory: RazorpayAccount.fromJson,
callback: callback,
);
}