create method

Future<Response<RazorpayStakeholder>> create({
  1. required String accountId,
  2. required RazorpayStakeholderCreateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayStakeholder>?
    )?,
})

Creates a stakeholder

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

Implementation

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