fetch method

Future<Response<RazorpayAccount>> fetch({
  1. required String accountId,
  2. void callback(
    1. RazorpayApiException?,
    2. 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,
  );
}