Package com.vonage.client.verify
Class BaseRequest
java.lang.Object
com.vonage.client.verify.BaseRequest
- Direct Known Subclasses:
Psd2Request,VerifyRequest
public class BaseRequest extends java.lang.Object
Base request class for
VerifyRequest and Psd2Request- Since:
- 5.5.0
-
Constructor Summary
Constructors Modifier Constructor Description BaseRequest(java.lang.String number, java.lang.Integer length, java.util.Locale locale)protectedBaseRequest(java.lang.String number, java.lang.Integer length, java.util.Locale locale, java.lang.String country, java.lang.Integer pinExpiry, java.lang.Integer nextEventWait) -
Method Summary
Modifier and Type Method Description java.lang.StringgetCountry()The country for the destination phone number.java.lang.StringgetDashedLocale()java.lang.IntegergetLength()java.util.LocalegetLocale()java.lang.IntegergetNextEventWait()java.lang.StringgetNumber()java.lang.IntegergetPinExpiry()voidsetCountry(java.lang.String country)Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestvoidsetLength(java.lang.Integer length)Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestvoidsetLocale(java.util.Locale locale)Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestvoidsetNextEventWait(java.lang.Integer nextEventWait)Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestvoidsetPinExpiry(java.lang.Integer pinExpiry)Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestjava.lang.StringtoString()
-
Constructor Details
-
BaseRequest
-
BaseRequest
protected BaseRequest(java.lang.String number, java.lang.Integer length, java.util.Locale locale, java.lang.String country, java.lang.Integer pinExpiry, java.lang.Integer nextEventWait)
-
-
Method Details
-
getNumber
- Returns:
- the recipient's phone number provided in the constructor, in E.164 format.
-
getLength
- Returns:
- the length of the verification code to be sent to the user, specified in some
VerifyRequestconstructors.-1indicates the default length will be used.
-
setLength
Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification request- Parameters:
length- the length of the verification code to be sent to the user. Options are either 4 or 6.
-
getLocale
- Returns:
- the default locale used for verification. If this value is
null, the locale will be determined from the country code included innumber
-
setLocale
Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification request- Parameters:
locale- Override the default locale used for verification. By default the locale is determined from the country code included innumber
-
getDashedLocale
- Returns:
- the default locale used for verification in snake case.
Ex:
en-gbIf this value isnull, the locale will be determined from the country code included innumber
-
getCountry
The country for the destination phone number.- Returns:
- a String containing a 2-character country code
-
setCountry
Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestThe country for the destination phone number.If you wish to used localised number formats or you are not sure if number is correctly formatted, set this to a two-character country code. For example, GB, US. Verify will work out the international phone number for you.
- Parameters:
country- a String containing a 2-character country code
-
getPinExpiry
- Returns:
- PIN expiry time in seconds
-
setPinExpiry
Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification request- Parameters:
pinExpiry- PIN expiry time in seconds.
-
getNextEventWait
- Returns:
- the wait time between attempts to deliver the PIN. An Integer between 600-900, or null.
-
setNextEventWait
Deprecated.since 5.5.0 useVerifyRequest.Builderto create a 2FA verification request orPsd2Request.Builderto create a PSD2 verification requestSet the wait time between attempts to deliver the PIN.- Parameters:
nextEventWait- An Integer value between 60 and 900 seconds, or null to use the default duration.
-
toString
- Overrides:
toStringin classjava.lang.Object
-