import create_otp from "../services/otps/rave.create"; import validate_otp from "../services/otps/rave.validate"; import { CreateOTPPayload, ValidateOTPPayload } from "../services/otps/types"; import RaveBase from "./rave.base"; /** * This class has methods necessary for creating and managing custom-generated OTPs with FLutterwave. */ export default class Otp { private rave: RaveBase; constructor(arg: RaveBase) { this.rave = arg; } /** * This endpoints helps you to generate an OTP via Flutterwave for any validation. * * @link https://developer.flutterwave.com/reference/endpoints/otp#create-an-otp */ create (data: CreateOTPPayload) { return create_otp(data, this.rave); } /** * This section describes how to validate OTPs generated by the create() method. * * @link https://developer.flutterwave.com/reference/endpoints/otp#validate-an-otp */ validate(data: ValidateOTPPayload) { return validate_otp(data, this.rave); } }