edit method

Future<Response<RazorpayProduct>> edit({
  1. required String accountId,
  2. required String productId,
  3. required RazorpayProductUpdateRequestBody params,
  4. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayProduct>?
    )?,
})

Update a Product Configuration

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

Implementation

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