Class AuthenticationParameter


  • public class AuthenticationParameter
    extends Object
    Parameter set required for user authentication (during a payment transaction).
    Since:
    2.0.0
    • Constructor Detail

      • AuthenticationParameter

        public AuthenticationParameter​(@NonNull
                                       Activity activity,
                                       @NonNull
                                       String title,
                                       @NonNull
                                       String subTitle,
                                       @NonNull
                                       String description,
                                       @NonNull
                                       String negativeBtnText,
                                       @NonNull
                                       DeviceAuthenticationCallback callback)
        Constructs the authentication params object.
        Parameters:
        activity - The host activity where the authentication occurs.
        title - The title to display on the system authentication screen.
        subTitle - The sub-title to display on the system authentication screen.
        description - The description to display on the system authentication screen.
        negativeBtnText - The negative button to show on system authentication screen.
        callback - The callback to inform the user about the authentication status.
    • Method Detail

      • getActivity

        @NonNull
        public Activity getActivity()
        Retrieves the host activity of the payment transaction.
        Returns:
        The payment activity.
      • getTitle

        @NonNull
        public String getTitle()
        Retrieves the custom title of the authentication screen.
        Returns:
        The custom title of the authentication screen.
      • getSubTitle

        @NonNull
        public String getSubTitle()
        Retrieves the custom sub-title of the authentication screen.
        Returns:
        The custom sub-title of the authentication screen.
      • getDescription

        @NonNull
        public String getDescription()
        Retrieves the custom description of the authentication screen.
        Returns:
        The custom description of the authentication screen.
      • getNegativeButtonText

        @NonNull
        public String getNegativeButtonText()
        Retrieves the custom description of the negative button on the authentication screen.
        Returns:
        The custom description of the negative button.
      • setVerificationMethod

        public void setVerificationMethod​(@NonNull
                                          VerificationMethod method)
        Sets the expected verification method for this authentication.

        By default, the verification method is decided internally by D1 Pay. This API provides an option for the mobile app to fallback to other authentication method. For example, fallback to VerificationMethod.DEVICE_KEYGUARD if VerificationMethod.BIOMETRICS is not working.

        Parameters:
        method - The expected verification method.
      • getVerificationMethod

        @Nullable
        public VerificationMethod getVerificationMethod()
        Retrieves the expected verification method (if there is any).
        Returns:
        The verification method.