edit method

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

Update a stakeholder

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

Implementation

Future<Response<RazorpayStakeholder>> edit({
  required String accountId,
  required String stakeholderId,
  required RazorpayStakeholderUpdateRequestBody params,
  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.patch<RazorpayStakeholder>(
    {
      'version': 'v2',
      'url': '$BASE_URL/$accountId/stakeholders/$stakeholderId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayStakeholder.fromJson,
    callback: callback,
  );
}