otpSubmit method
Future<Response<RazorpayOtpSubmitResponse> >
otpSubmit({
- required String paymentId,
- required String otp,
- void callback(
- RazorpayApiException?,
- Response<
RazorpayOtpSubmitResponse> ?
Submit OTP for S2S payments
@param paymentId - The unique identifier of the payment. @param params - Contains the OTP: {'otp': '123456'}
Implementation
Future<Response<RazorpayOtpSubmitResponse>> otpSubmit({
required String paymentId,
required String otp,
void Function(RazorpayApiException?, Response<RazorpayOtpSubmitResponse>?)?
callback,
}) async {
if (paymentId.isEmpty) {
throw ArgumentError('paymentId is mandatory');
}
if (otp.isEmpty) {
throw ArgumentError('otp is mandatory');
}
return api.post<RazorpayOtpSubmitResponse>(
{
'url': '$BASE_URL/$paymentId/otp/submit',
'data': {'otp': otp},
},
fromJsonFactory: RazorpayOtpSubmitResponse.fromJson,
callback: callback,
);
}