edit method

Future<Response<RazorpayItem>> edit({
  1. required String itemId,
  2. required RazorpayItemUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayItem>?
    )?,
})

Edit an item given Item ID

@param itemId - The unique identifier of the item. @param params - Check doc for required params

Implementation

Future<Response<RazorpayItem>> edit({
  required String itemId,
  required RazorpayItemUpdateRequestBody params,
  void Function(RazorpayApiException?, Response<RazorpayItem>?)? callback,
}) async {
  if (itemId.isEmpty) {
    throw ArgumentError('`item_id` is mandatory');
  }
  return api.patch<RazorpayItem>(
    {
      'url': '/items/$itemId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayItem.fromJson,
    callback: callback,
  );
}