For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create Card - Google Pay Wallet Decryption

Overview

CMP supports Google Pay Wallet Decryption, allowing merchants to submit an encrypted Google Pay payment token directly to CMP during card creation. CMP decrypts the token using VGS-managed encryption keys, extracts the DPAN or FPAN, creates and securely stores the card, and returns the card object and wallet metadata in the API response.

This feature is designed for merchants who have already obtained the encrypted Google Pay payment token from their checkout integration and want CMP to handle decryption and card creation.

The encrypted wallet token must be generated through the standard Google Pay payment flow before calling the Create Card API.

If you need guidance on generating encrypted Google Pay tokens for testing, see the Google Pay Wallet Decryption Testing Guide.

The pan field in the response contains the decrypted DPAN or FPAN. Tokenization behavior remains consistent with CMP: PCI-scoped clients receive both the PAN and PAN alias, while non-PCI clients receive only the PAN alias.

Benefits

  • No need to build or maintain Google Pay decryption services.

  • Reduced exposure to sensitive card information.

  • VGS-managed encryption keys and key rotation.

  • Standardized handling of Google Pay wallet metadata.

  • Continued access to CMP vaulting and card fingerprinting.

Google Pay Wallet Decryption Flow

After the customer authorizes the payment using Google Pay, the encrypted payment token can be submitted to CMP for decryption and card creation.

Flow Overview

  • The customer selects Google Pay during checkout.

  • The merchant frontend initializes the Google Pay payment request.

  • Google Pay displays the payment sheet, and the customer selects an eligible card.

  • Google Pay returns an encrypted ECv2 payment token to the merchant frontend.

  • The merchant backend receives the encrypted payment token.

  • The merchant backend submits the encrypted Google Pay payload to CMP using the Create Card API.

  • CMP verifies Google's signatures and decrypts the payment token using VGS-managed keys.

  • CMP extracts the DPAN or FPAN and associated wallet details.

  • CMP creates and securely stores the card.

  • CMP returns the card object and applicable wallet metadata.

Setting Up Google Pay with VGS

To use Google Pay Wallet Decryption, VGS must enable the feature for the merchant's CMP account.

Unlike Apple Pay Wallet Decryption, merchants do not need to generate or upload payment processing certificates to VGS.

VGS manages the Google Pay gateway encryption keys for both sandbox and production environments.

Google Pay Gateway Configuration

Configure Google Pay with PAYMENT_GATEWAY tokenization and the VGS gateway parameters.

Parameter

Description

type

Must be PAYMENT_GATEWAY.

gateway

Must be verygoodsecurity.

gatewayMerchantId

A unique identifier generated and provided by VGS for the merchant's Google Pay integration.

The gatewayMerchantId is provided by VGS. It is not the Google-issued Merchant ID.

This identifier is used in the Google Pay configuration and is not sent as a separate field in the CMP Create Card request.

For additional setup information, see the Google Pay API Tutorial.

Google Pay Encryption Keys

VGS manages the encryption keys required to decrypt Google Pay payment tokens.

  • VGS creates separate encryption key pairs for sandbox and production.

  • VGS securely stores the private keys and registers the corresponding public keys with Google.

  • Google encrypts payment data using the registered gateway keys.

  • VGS manages key rotation before the keys expire.

Merchants do not need to generate, store, exchange, or rotate these keys.

Generate an Encrypted Google Pay Payment Token

To receive an encrypted Google Pay token, the merchant must integrate the Google Pay API into the checkout experience.

A typical Google Pay payment flow includes:

  • Initialize the Google Pay PaymentsClient.

  • Configure the supported card networks and authentication methods.

  • Configure PAYMENT_GATEWAY tokenization using the VGS gateway parameters.

  • Display the Google Pay button.

  • Call loadPaymentData() when the customer selects Google Pay.

  • Receive the encrypted payment token from the Google Pay response.

  • Send the payment token to the merchant backend for submission to CMP.

Google Pay returns the encrypted token in:

paymentMethodData.tokenizationData.token

The token contains the Google Pay ECv2 payment data required for decryption.

For detailed implementation instructions, refer to:

Create Card Request

To use Google Pay Wallet Decryption, create a service account with the required card access scopes and generate a JWT access token.

Use this token to authenticate the Create Card API request, submitting the encrypted Google Pay payment token instead of a decrypted PAN.

Endpoint: POST /cards

Content-Type: application/vnd.api+json

Authentication: Bearer token

Submit the encrypted Google Pay ECv2 fields under data.attributes.encrypted_payment_data.

Google Pay Token to CMP Field Mapping

When constructing the Create Card request, map the fields from Google's paymentMethodData.tokenizationData.token as follows:

Google Pay token field

CMP API field

Description

—

wallet_type

Set to google_pay.

protocolVersion

protocolVersion

Must be ECv2.

signature

signature

Google Pay payment token signature.

intermediateSigningKey.signedKey

intermediateSigningKey.signedKey

Serialized JSON string containing the intermediate signing key details.

intermediateSigningKey.signatures

intermediateSigningKey.signatures

Array of intermediate signing key signatures.

signedMessage

signedMessage

Serialized JSON string containing the encrypted payment data.

paymentMethodData.info

payment_method

Optional payment method details mapped to CMP's supported fields.

Important: The signedKey and signedMessage values must be sent exactly as received from Google Pay. Do not modify or reserialize these strings.

Example Format of thCreate Card Request Format

The request above illustrates the field structure. Replace the placeholders with the complete encrypted values received from Google Pay.

The signedKey and signedMessage fields are serialized JSON strings, not nested JSON objects.

If payment_method is included, all three fields (display_name, network, and type) must be provided.

Supported Encryption Version

CMP supports Google Pay payment tokens using the ECv2 encryption protocol.

Create Card Response

After successful decryption, CMP returns a card object containing the decrypted DPAN or PAN and associated Google Pay wallet metadata.

The response includes applicable fields such as:

  • wallet_type

  • token_type

  • pan_alias

  • wallet_details.payment_data_type

  • wallet_details.auth_method

  • wallet_details.message_id

  • wallet_details.cryptogram for DPAN transactions

  • wallet_details.payment_method, if provided in the request

  • Card attributes and fingerprint information

The clear pan is returned only when the client has the required PCI card-read permissions.

Response Behavior

  • 201 Created: A new card is created successfully.

  • 200 OK: When Allow Duplicate Cards is disabled and the decrypted card already exists, CMP returns the existing card object. However, the wallet_details in the Create Card response reflect the current Google Pay decryption request.

  • Card classification: DPAN cards return token_type: dpan, while PAN_ONLY transactions return token_type: pan.

  • PAN access: Clients with the required PCI card-read permissions receive the clear PAN and PAN alias. Other clients receive only the PAN alias.

When duplicate cards are not allowed, each Create Card response includes the wallet details from the current request, including the applicable single-use cryptogram for DPAN transactions.

DPAN Response — CRYPTOGRAM_3DS

For DPAN transactions, CMP returns the card details along with a single-use cryptogram for payment authorization.

The following example shows selected fields from data.attributes:

The cryptogram type and ECI depend on the card network and payment data. The values above are illustrative.

PAN Response — PAN_ONLY

For PAN_ONLY transactions, CMP returns the card details without a cryptogram.

The following example shows selected fields from data.attributes:

No cryptogram is returned for PAN_ONLY transactions.

Cryptogram Handling

For DPAN transactions, the Create Card response includes the payment cryptogram returned by Google Pay.

Cryptogram behavior:

  • The cryptogram is single-use.

  • It is intended for the current payment authorization.

  • It must be passed to the payment processor together with the required authorization data.

  • It cannot be reused for another payment.

  • It is not stored by CMP.

The ECI indicator is returned when provided by Google Pay and supported by the card network.

Retrieve Card — GET /cards/{id}

After card creation, merchants can retrieve the stored Google Pay card using the standard Get Card API.

The response includes the stored card details and applicable Google Pay wallet metadata.

When Allow Duplicate Cards is disabled, multiple Google Pay decryption requests for the same card return the existing card object. Each Create Card response includes the wallet details from the current request. However, GET /cards/{id} returns the stored wallet details, which may include the message_id from a previous request.

Important: The cryptogram and its ECI are single-use and are not stored or returned by the Get Card API.

Merchants must use the cryptogram from the current Create Card response for the corresponding payment authorization.

Validation and Error Handling

CMP performs the following checks when processing the encrypted Google Pay payment token:

  • Verifies the JWT and access to the requested account and environment.

  • Confirms that Google Pay Wallet Decryption is enabled.

  • Validates the request fields and ECv2 format.

  • Verifies the Google Pay signatures.

  • Checks the intermediate signing key expiration.

  • Checks payment token integrity and expiration.

  • Verifies that the token corresponds to the configured gateway merchant identifier.

If validation or decryption fails, CMP rejects the request.

Testing Google Pay Wallet Decryption

For mock testing, sandbox testing, and production setup, refer to the Google Pay Wallet Decryption Testing Guide.

Last updated