collectOtp static method

Future<String?> collectOtp({
  1. required Future<void> resendOTPSMS(),
  2. required Future<void> resendOTPWhatsapp(),
  3. int? otpLength,
  4. required double amount,
})

Implementation

static Future<String?> collectOtp({
  required Future<void> Function() resendOTPSMS,
  required Future<void> Function() resendOTPWhatsapp,
  int? otpLength,
  required double amount,
}) async {
  final otpLen = otpLength ?? 4;

  return await OtpCollectionV2.reveal(
    heading: 'Verify OTP',
    subheading:
        'You are generating brand card(s) worth ${amount.toIndianRupee()}\n\n'
        'Please enter the $otpLen digit OTP sent to your mobile number to confirm this transaction.',
    resendOTPSMS: resendOTPSMS,
    expectedOtpLength: otpLen,
    isNumberOfAttemptsLimited: false,
    isWhatsappEnabled: false,
  );
}