WalletConstants

public final class WalletConstants extends Object

Collection of constant values used by the ClientLibrary.

Nested Class Summary

@interface WalletConstants.BillingAddressFormat The Google Pay API will collect the billing address for you if required. 
@interface WalletConstants.CardClass Card class indicates whether it is a credit, debit, or prepaid card. 
@interface WalletConstants.CardNetwork Credit card networks. 
@interface WalletConstants.PaymentMethod The payment methods you support. 
@interface WalletConstants.PaymentMethodTokenizationType Payment method tokenization types. 
@interface WalletConstants.TotalPriceStatus The status of the total price used in TransactionInfo

Constant Summary

String ACTION_ENABLE_WALLET_OPTIMIZATION This constant was deprecated. No longer supported.
int BILLING_ADDRESS_FORMAT_FULL When this format is used, the billing address returned will be the full address.
int BILLING_ADDRESS_FORMAT_MIN When this format is used, the billing address returned will only contain the minimal info, including name, country code, and postal code.
int CARD_CLASS_CREDIT A credit card.
int CARD_CLASS_DEBIT A debit card.
int CARD_CLASS_PREPAID A prepaid or gift card.
int CARD_CLASS_UNKNOWN
int CARD_NETWORK_AMEX Card network American Express.
int CARD_NETWORK_DISCOVER Card network Discover.
int CARD_NETWORK_INTERAC Card network Interac.
int CARD_NETWORK_JCB Card network JCB.
int CARD_NETWORK_MASTERCARD Card network Mastercard.
int CARD_NETWORK_OTHER This shouldn't be passed as part of a request but it can be used as a sentinel value when applying logic related to card networks.
int CARD_NETWORK_VISA Card network Visa.
int ENVIRONMENT_PRODUCTION Environment constant for running in production with the most stringent application / merchant requirements.
int ENVIRONMENT_SANDBOX This constant was deprecated. use ENVIRONMENT_TEST instead.
int ENVIRONMENT_STRICT_SANDBOX This constant was deprecated. use ENVIRONMENT_TEST instead.
int ENVIRONMENT_TEST Environment constant for running in the test environment with relaxed application / merchant requirements.
int ERROR_CODE_AUTHENTICATION_FAILURE Not immediately recoverable error.
int ERROR_CODE_BUYER_ACCOUNT_ERROR Not immediately recoverable error.
int ERROR_CODE_DEVELOPER_ERROR
int ERROR_CODE_INTERNAL_ERROR
int ERROR_CODE_INVALID_PARAMETERS Not immediately recoverable error.
int ERROR_CODE_INVALID_TRANSACTION Not immediately recoverable error.
int ERROR_CODE_MERCHANT_ACCOUNT_ERROR Not immediately recoverable error.
int ERROR_CODE_SERVICE_UNAVAILABLE Not immediately recoverable error.
int ERROR_CODE_SPENDING_LIMIT_EXCEEDED This constant was deprecated. Unused.
int ERROR_CODE_UNKNOWN Not immediately recoverable error.
int ERROR_CODE_UNSUPPORTED_API_VERSION Not immediately recoverable error.
String EXTRA_ERROR_CODE Extra for retrieving an error code from the Intent passed to onActivityResult
String EXTRA_FULL_WALLET Extra for retrieving a FullWallet from the Intent passed to onActivityResult
String EXTRA_IS_READY_TO_PAY Extra for retrieving a boolean indicating with high, but not complete, confidence that the user is capable of making a payment using Google Pay
String EXTRA_IS_USER_PREAUTHORIZED Extra for retrieving a boolean indicating if the user has pre-authorized your app or not
String EXTRA_MASKED_WALLET Extra for retrieving a MaskedWallet from the Intent passed to onActivityResult
String EXTRA_MASKED_WALLET_REQUEST Extra for retrieving the masked wallet request from the Bundle passed to onStateChanged(com.google.android.gms.wallet.fragment.WalletFragment, int, int, android.os.Bundle) when transitioning to PROCESSING.
String METADATA_TAG_WALLET_API_ENABLED Name of the metadata tag that is a signal from your application that it uses Wallet APIs.
int PAYMENT_METHOD_CARD This payment method represents a credit or debit card, which contains the card number, and the expiration date.
int PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT When this type is used the payment method selected by the buyer will be returned directly to the integrator.
int PAYMENT_METHOD_TOKENIZATION_TYPE_NETWORK_TOKEN When this type is used the card selected by the buyer will be tokenized using network token APIs.
int PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY When this type is used the payment method selected by the buyer will be tokenized using the payment gateway API.
int PAYMENT_METHOD_TOKENIZED_CARD This payment method represents the tokenized card in Google Pay, which contains a card number and cryptogram associated with the device and the token expiration date.
int PAYMENT_METHOD_UNKNOWN Unknown payment method.
int RESULT_ERROR Response code passed to onActivityResult in the case of an error
int THEME_DARK Theme constant passed to setTheme(int) to use a dark theme for Wallet on Android OS with SDK_INT >= HONEYCOMB.
int THEME_HOLO_DARK This constant was deprecated. use THEME_DARK
int THEME_HOLO_LIGHT This constant was deprecated. use THEME_LIGHT
int THEME_LIGHT Theme constant passed to setTheme(int) to use a light theme for Wallet on Android OS with SDK_INT >= HONEYCOMB.
int TOTAL_PRICE_STATUS_ESTIMATED The total price is an estimated price.
int TOTAL_PRICE_STATUS_FINAL The total price is the final total price of the transaction, and will not change based on the selection made by the buyer.
int TOTAL_PRICE_STATUS_NOT_CURRENTLY_KNOWN The total price is not known currently.

Inherited Method Summary

Constants

public static final String ACTION_ENABLE_WALLET_OPTIMIZATION

This constant was deprecated.
No longer supported.

Name of an action to use in an IntentFilter for a BroadcastReceiver that is a signal from your application that it uses Wallet, and thus the system should make the appropriate optimizations. Example of using the action:

...

Constant Value: "com.google.android.gms.wallet.ENABLE_WALLET_OPTIMIZATION"

public static final int BILLING_ADDRESS_FORMAT_FULL

When this format is used, the billing address returned will be the full address.

Only select this format when it's required to process the order since it can increase friction during the checkout process and can lead to a lower conversion rate.

Constant Value: 1

public static final int BILLING_ADDRESS_FORMAT_MIN

When this format is used, the billing address returned will only contain the minimal info, including name, country code, and postal code.

Note that some countries do not use postal codes, so the postal code field will be empty in those countries.

Constant Value: 0

public static final int CARD_CLASS_CREDIT

A credit card.

Constant Value: 1

public static final int CARD_CLASS_DEBIT

A debit card.

Constant Value: 2

public static final int CARD_CLASS_PREPAID

A prepaid or gift card.

Constant Value: 3

public static final int CARD_CLASS_UNKNOWN

Constant Value: 0

public static final int CARD_NETWORK_AMEX

Card network American Express.

Constant Value: 1

public static final int CARD_NETWORK_DISCOVER

Card network Discover.

Constant Value: 2

public static final int CARD_NETWORK_INTERAC

Card network Interac.

Constant Value: 6

public static final int CARD_NETWORK_JCB

Card network JCB.

Constant Value: 3

public static final int CARD_NETWORK_MASTERCARD

Card network Mastercard.

Constant Value: 4

public static final int CARD_NETWORK_OTHER

This shouldn't be passed as part of a request but it can be used as a sentinel value when applying logic related to card networks.

Constant Value: 1000

public static final int CARD_NETWORK_VISA

Card network Visa.

Constant Value: 5

public static final int ENVIRONMENT_PRODUCTION

Environment constant for running in production with the most stringent application / merchant requirements.

  1. Requires the application is uploaded to the Google Play Store.
  2. Requires a Google Pay Developer Profile to be used to enable Google Pay for the app.
Constant Value: 1

public static final int ENVIRONMENT_SANDBOX

This constant was deprecated.
use ENVIRONMENT_TEST instead.

Constant Value: 0

public static final int ENVIRONMENT_STRICT_SANDBOX

This constant was deprecated.
use ENVIRONMENT_TEST instead.

Constant Value: 2

public static final int ENVIRONMENT_TEST

Environment constant for running in the test environment with relaxed application / merchant requirements. This environment is suggested for early development and for easily testing the Wallet SDK.

  1. Does not require the application to be uploaded to the Google Play Store.
  2. Does not require a Google Pay Developer Profile.
  3. It uses production data, but at the end of the transaction you will receive a fake and non chargeable payment credential.
  4. The user will see a warning message that the app is not recognized/verified.
Constant Value: 3

public static final int ERROR_CODE_AUTHENTICATION_FAILURE

Not immediately recoverable error. There was a failure in retrieving an authentication token for the buyer's Google Account. This could be because Google's AbstractAccountAuthenticator is not installed or failed to respond, or could be due to an invalid Google account, or could be caused by some internal error. Note however that this error will NOT be returned if authentication failed because of a network error or because the buyer cancelled the operation.

Constant Value: 411

public static final int ERROR_CODE_BUYER_ACCOUNT_ERROR

Not immediately recoverable error. There are problems with the buyer's account (e.g closed account, unsupported country)

Constant Value: 409

public static final int ERROR_CODE_DEVELOPER_ERROR

Constant Value: 10

public static final int ERROR_CODE_INTERNAL_ERROR

See Also
Constant Value: 8

public static final int ERROR_CODE_INVALID_PARAMETERS

Not immediately recoverable error. The request had missing or invalid parameters.

Constant Value: 404

public static final int ERROR_CODE_INVALID_TRANSACTION

Not immediately recoverable error. loadFullWallet or changeMaskedWallet was called outside the context of a transaction. For example, loadFullWallet was called without a successful call to loadMaskedWallet.

Constant Value: 410

public static final int ERROR_CODE_MERCHANT_ACCOUNT_ERROR

Not immediately recoverable error. Your app needs to be enabled for access to this API, please see documentation for instructions on how to get access.

Constant Value: 405

public static final int ERROR_CODE_SERVICE_UNAVAILABLE

Not immediately recoverable error. The service is temporarily off-line for all requests.

Constant Value: 402

public static final int ERROR_CODE_SPENDING_LIMIT_EXCEEDED

This constant was deprecated.
Unused.

Constant Value: 406

public static final int ERROR_CODE_UNKNOWN

Not immediately recoverable error. An unknown type of error has occurred.

Constant Value: 413

public static final int ERROR_CODE_UNSUPPORTED_API_VERSION

Not immediately recoverable error. The server API version of the request is no longer supported. This error is not recoverable and should be treated as fatal.

Constant Value: 412

public static final String EXTRA_ERROR_CODE

Extra for retrieving an error code from the Intent passed to onActivityResult

Constant Value: "com.google.android.gms.wallet.EXTRA_ERROR_CODE"

public static final String EXTRA_FULL_WALLET

Extra for retrieving a FullWallet from the Intent passed to onActivityResult

Constant Value: "com.google.android.gms.wallet.EXTRA_FULL_WALLET"

public static final String EXTRA_IS_READY_TO_PAY

Extra for retrieving a boolean indicating with high, but not complete, confidence that the user is capable of making a payment using Google Pay

Constant Value: "com.google.android.gms.wallet.EXTRA_IS_READY_TO_PAY"

public static final String EXTRA_IS_USER_PREAUTHORIZED

Extra for retrieving a boolean indicating if the user has pre-authorized your app or not

Constant Value: "com.google.android.gm.wallet.EXTRA_IS_USER_PREAUTHORIZED"

public static final String EXTRA_MASKED_WALLET

Extra for retrieving a MaskedWallet from the Intent passed to onActivityResult

Constant Value: "com.google.android.gms.wallet.EXTRA_MASKED_WALLET"

public static final String EXTRA_MASKED_WALLET_REQUEST

Extra for retrieving the masked wallet request from the Bundle passed to onStateChanged(com.google.android.gms.wallet.fragment.WalletFragment, int, int, android.os.Bundle) when transitioning to PROCESSING.

Constant Value: "com.google.android.gms.wallet.EXTRA_MASKED_WALLET_REQUEST"

public static final String METADATA_TAG_WALLET_API_ENABLED

Name of the metadata tag that is a signal from your application that it uses Wallet APIs. Note: In future versions this metadata tag will be required in your application manifest to use Wallet APIs in your app.

Example of using the tag: ...

Constant Value: "com.google.android.gms.wallet.api.enabled"

public static final int PAYMENT_METHOD_CARD

This payment method represents a credit or debit card, which contains the card number, and the expiration date.

Constant Value: 1

public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT

When this type is used the payment method selected by the buyer will be returned directly to the integrator.

Note this type is currently only available if integrating with the Google Pay API loadPaymentData(PaymentDataRequest).

Optionally the integrator can also request the payment method information to be returned in encrypted format. If that is the case, PaymentMethodTokenizationParameters will need to contain a "publicKey" parameter containing an Elliptic Curve public key suitable for using with the NIST P-126 curve. This public key will used to encrypt the returned token. Please refer to the documentation for more information regarding publicKey generation, decryption and parsing of the encrypted payment token.

The integrator will be responsible for parsing the data depending on the selected payment method and handling how to charge it.

  • For PAYMENT_METHOD_CARD, this payload will contain the card's PAN (personal account number) and its expiration date.
  • For PAYMENT_METHOD_TOKENIZED_CARD, this payload will contain the tokenized cards's DPAN (device personal account number), cryptogram, and the tokenized card's expiration date. Note that the expiration date of the card that backs a tokenized card will not necessarily match the expiration of the tokenized card itself.

The full spec for the format in which the payment methods get serialized can be found in documentation.

Also note that PAYMENT_METHOD_TOKENIZED_CARD can only be returned when the integrator opts into encrypting the payload. If the integrator specified support for PAYMENT_METHOD_TOKENIZED_CARD and doesn't specify the encryption parameters described above (e.g. publicKey) then an error will be returned.

Constant Value: 3

public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_NETWORK_TOKEN

When this type is used the card selected by the buyer will be tokenized using network token APIs.

PaymentMethodTokenizationParameters will need to contain a "publicKey" parameter containing an Elliptic Curve public key suitable for using with the NIST P-126 curve.

getPaymentMethodToken() will contain in getToken() the JSON representation of an encrypted payment credential containing the network token, cryptogram, expiration and CVV.

Please refer to the documentation for more information regarding "publicKey" generation, decryption and parsing of the encrypted payment credential.

Deprecated. Use PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT instead if integrating with the Google Pay API loadPaymentData(PaymentDataRequest).

Constant Value: 2

public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY

When this type is used the payment method selected by the buyer will be tokenized using the payment gateway API. In this case the corresponding PaymentData will contain the token that the integrator can then use directly with their gateway to process the charge. See PaymentMethodTokenizationParameters for more details.

Constant Value: 1

public static final int PAYMENT_METHOD_TOKENIZED_CARD

This payment method represents the tokenized card in Google Pay, which contains a card number and cryptogram associated with the device and the token expiration date.

Constant Value: 2

public static final int PAYMENT_METHOD_UNKNOWN

Unknown payment method.

This shouldn't be passed as part of a request but it can be used as a sentinel value when applying logic related to payment methods.

Constant Value: 0

public static final int RESULT_ERROR

Response code passed to onActivityResult in the case of an error

Constant Value: 1

public static final int THEME_DARK

Theme constant passed to setTheme(int) to use a dark theme for Wallet on Android OS with SDK_INT >= HONEYCOMB. This will provide the dark version of either Holo or Material based on the API level of the device.

Constant Value: 0

public static final int THEME_HOLO_DARK

This constant was deprecated.
use THEME_DARK

Theme constant passed to setTheme(int) to use Holo Dark theme for Wallet on Android OS with SDK_INT >= HONEYCOMB.

Constant Value: 0

public static final int THEME_HOLO_LIGHT

This constant was deprecated.
use THEME_LIGHT

Theme constant passed to setTheme(int) to use Holo Light theme for Wallet on Android OS with SDK_INT >= HONEYCOMB.

Constant Value: 1

public static final int THEME_LIGHT

Theme constant passed to setTheme(int) to use a light theme for Wallet on Android OS with SDK_INT >= HONEYCOMB. This will provide the light version of either Holo or Material based on the API level of the device.

Constant Value: 1

public static final int TOTAL_PRICE_STATUS_ESTIMATED

The total price is an estimated price. The final price may still change depending on the selected shipping address.

Constant Value: 2

public static final int TOTAL_PRICE_STATUS_FINAL

The total price is the final total price of the transaction, and will not change based on the selection made by the buyer.

Constant Value: 3

public static final int TOTAL_PRICE_STATUS_NOT_CURRENTLY_KNOWN

The total price is not known currently.

Constant Value: 1