otpResend method

Future<Response<RazorpayOtpResendResponse>> otpResend({
  1. required String paymentId,
  2. void callback(
    1. RazorpayApiException?,
    2. Response<RazorpayOtpResendResponse>?
    )?,
})

Resend OTP for S2S payments

@param paymentId - The unique identifier of the payment.

Implementation

Future<Response<RazorpayOtpResendResponse>> otpResend({
  required String paymentId,
  void Function(RazorpayApiException?, Response<RazorpayOtpResendResponse>?)?
      callback,
}) async {
  if (paymentId.isEmpty) {
    throw ArgumentError('paymentId is mandatory');
  }
  return api.post<RazorpayOtpResendResponse>(
    {'url': '$BASE_URL/$paymentId/otp/resend'},
    fromJsonFactory: RazorpayOtpResendResponse.fromJson,
    callback: callback,
  );
}