edit method

Future<Response<RazorpayAccount>> edit({
  1. required String accountId,
  2. required RazorpayAccountUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayAccount>?
    )?,
})

Update an account

@param accountId - The unique identifier of the account. @param params - Check doc for required params

Implementation

Future<Response<RazorpayAccount>> edit({
  required String accountId,
  required RazorpayAccountUpdateRequestBody params,
  void Function(RazorpayApiException?, Response<RazorpayAccount>?)? callback,
}) async {
  if (accountId.isEmpty) {
    throw ArgumentError('accountId is required');
  }
  return api.patch<RazorpayAccount>(
    {
      'version': 'v2',
      'url': '$BASE_URL/$accountId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayAccount.fromJson,
    callback: callback,
  );
}