Class ConsumerInfo

java.lang.Object
com.thalesgroup.gemalto.d1.paymentpasskey.ConsumerInfo

public final class ConsumerInfo extends Object
Represents the consumer information for Payment Passkey operations.

This class encapsulates the consumer contact information that can be used during Payment Passkey enrollment and authentication flows. It supports two types of consumer identification:

  • Email-based: Using the consumer's email address.
  • Phone-based: Using the consumer's phone number with country code.

Usage Examples:


 // Create ConsumerInfo with email
 ConsumerInfo consumerInfo = new ConsumerInfo("user@example.com");
 
 // Create ConsumerInfo with phone number
 ConsumerInfo consumerInfo = new ConsumerInfo("1234567890", "+1");
 
 // Update consumer information
 consumerInfo.setEmail("newemail@example.com");
 consumerInfo.setPhoneNumber("9876543210");
 consumerInfo.setPhoneNumberCountryCode("+44");
 
  • Constructor Details

    • ConsumerInfo

      public ConsumerInfo(@NonNull String email)
      Constructs a new ConsumerInfo instance.
      Parameters:
      email - The consumer's email address.
    • ConsumerInfo

      public ConsumerInfo(@NonNull String phoneNumber, @NonNull String phoneNumberCountryCode)
      Constructs a new ConsumerInfo instance.
      Parameters:
      phoneNumber - The phone number without a country code.
      phoneNumberCountryCode - The country code of the phone number.
  • Method Details

    • getEmail

      @Nullable public String getEmail()
      Gets the consumer's email address.
      Returns:
      The email address, or null if it is not provided.
    • getPhoneNumber

      @Nullable public String getPhoneNumber()
      Gets the phone number without a country code.
      Returns:
      The phone number, or null if it is not provided.
    • getPhoneNumberCountryCode

      @Nullable public String getPhoneNumberCountryCode()
      Gets the country code of the phone number.
      Returns:
      The phone number country code, or null if it is not provided.
    • setEmail

      public void setEmail(@Nullable String email)
      Sets the consumer's email address.
      Parameters:
      email - The email address of the consumer.
    • setPhoneNumber

      public void setPhoneNumber(@Nullable String phoneNumber)
      Sets the phone number without a country code.
      Parameters:
      phoneNumber - The phone number without a country code.
    • setPhoneNumberCountryCode

      public void setPhoneNumberCountryCode(@Nullable String phoneNumberCountryCode)
      Sets the country code of the phone number.
      Parameters:
      phoneNumberCountryCode - The country code of the phone number.