edit method

Future<Response<RazorpayPayment>> edit({
  1. required String paymentId,
  2. required RazorpayPaymentUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayPayment>?
    )?,
})

Edit a payment given Payment ID (Update notes)

@param paymentId - The unique identifier of the payment. @param params - Contains the 'notes' to update.

Implementation

Future<Response<RazorpayPayment>> edit({
  required String paymentId,
  required RazorpayPaymentUpdateRequestBody
      params, // Use the specific update model
  void Function(RazorpayApiException?, Response<RazorpayPayment>?)? callback,
}) async {
  if (paymentId.isEmpty) {
    throw ArgumentError(ID_REQUIRED_MSG);
  }
  return api.patch<RazorpayPayment>(
    {
      'url': '$BASE_URL/$paymentId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayPayment.fromJson,
    callback: callback,
  );
}