Handle the decryption
Requirements
To decrypt Google Pay tokens on your own, you must:- Have a Google Pay merchant ID.
- Be PCI-compliant to handle unencrypted card details.
- Have an API-only integration.
Decryption process
To decrypt Google Pay tokens, follow the steps outlined on the Google developer portal. Overview:- Fetch the Google root signing keys.
- Verify that the signature of the intermediate signing key is valid by any of the root signing keys that is not expired.
- Verify that the intermediate signing key of the payload is not expired.
- Verify that the signature of the payload is valid by the intermediate signing key.
- Decrypt the contents of the payload after you verify the signature.
- Verify that the message isn’t expired. This requires you to check that the current time is earlier than the
messageExpirationfield in the decrypted contents. - Use the payment method details you just decrypted to make the payment.
API reference
The parameters listed in this section are specific to using decrypted Google Pay tokens. For descriptions of other parameters go to /payments. The parameters you must send in the request are different for cards stored as FPAN and cards stored as DPAN. FPAN payments may trigger 3D Secure 2, which requires additional fields. You can handle 3D Secure 2 for FPAN in a similar way to other scheme payment methods described here.- FPAN
- DPAN
Payment request with FPAN
