edit method

Future<RazorpayItem> edit({
  1. required String itemId,
  2. required RazorpayItemUpdateRequestBody params,
})

Edit an item given Item ID

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

Implementation

Future<RazorpayItem> edit({
  required String itemId,
  required RazorpayItemUpdateRequestBody params,
}) async {
  if (itemId.isEmpty) {
    throw ArgumentError('`item_id` is mandatory');
  }
  return api.patch<RazorpayItem>(
    {
      'url': '/items/$itemId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayItem.fromJson,
  ).then((value) => value.data!);
}