edit method

Future<Response<RazorpayPaymentLink>> edit({
  1. required String paymentLinkId,
  2. required RazorpayPaymentLinkUpdateRequestBody params,
  3. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayPaymentLink>?
    )?,
})

Edit a paymentLink given paymentLink ID

@param paymentLinkId - The unique identifier of the paymentlink. @param params - Check doc for required params.

Implementation

Future<Response<RazorpayPaymentLink>> edit({
  required String paymentLinkId,
  required RazorpayPaymentLinkUpdateRequestBody params,
  void Function(RazorpayApiException?, Response<RazorpayPaymentLink>?)?
      callback,
}) async {
  if (paymentLinkId.isEmpty) {
    throw ArgumentError(MISSING_ID_ERROR);
  }
  return api.patch<RazorpayPaymentLink>(
    {
      'url': '$BASE_URL/$paymentLinkId',
      'data': params.toJson(),
    },
    fromJsonFactory: RazorpayPaymentLink.fromJson,
    callback: callback,
  );
}