edit method

Future<Response<RazorpayRefund>> edit({
  1. required String refundId,
  2. required RazorpayRefundUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayRefund>?
    )?,
})

Edit a refund given Refund ID (Update notes)

@param refundId - The unique identifier of the refund. @param params - Check doc for required params (only notes).

Implementation

Future<Response<RazorpayRefund>> edit({
  required String refundId,
  required RazorpayRefundUpdateRequestBody params,
  void Function(RazorpayApiException?, Response<RazorpayRefund>?)? callback,
}) async {
  if (refundId.isEmpty) {
    throw ArgumentError('refundId is mandatory');
  }
  return api.patch<RazorpayRefund>(
    {
      'url': '/refunds/$refundId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayRefund.fromJson,
    callback: callback,
  );
}