otpGenerate method

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

Generate OTP for S2S payments

@param paymentId - The unique identifier of the payment.

Implementation

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