{"title":"Decrypt Google Pay tokens if you are PCI-compliant","category":"default","creationDate":1776961628,"content":"<p>A Google Pay token contains encrypted card details that a shopper has stored in their Google Pay wallet. Google Pay tokens let you securely pass the data of your shoppers to a payment service provider, like Adyen, to process payments.<\/p>\n<p>If you are <a href=\"\/pt\/get-started-with-adyen\/adyen-glossary\/#pci-compliance\">PCI-compliant<\/a> you can handle the token decryption and pass raw card details to Adyen.<\/p>\n<p>A benefit of handling the decryption is that auditing transactions is easier when you have more information, such as the shopper name. See <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/resources\/payment-data-cryptography\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google's documentation<\/a> for the full list of details in a decrypted token.<\/p>\n<p>Only handle the token decryption on your own in advanced setup scenarios, like when you have to submit Merchant Plug-In (MPI) data in a Google Pay request.<\/p>\n<h2>Handle the decryption<\/h2>\n<h3>Requirements<\/h3>\n<p>To decrypt Google Pay tokens on your own, you must:<\/p>\n<ul>\n<li>Have a <a href=\"https:\/\/developers.google.com\/pay\/api\/web\/guides\/setup#registration\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Google Pay merchant ID<\/a>.<\/li>\n<li>Be PCI-compliant to handle unencrypted card details.<\/li>\n<li>Have an API-only integration.<\/li>\n<\/ul>\n<h3>Decryption process<\/h3>\n<p>To decrypt Google Pay tokens, follow the <a href=\"https:\/\/developers.google.com\/pay\/api\/android\/guides\/resources\/payment-data-cryptography\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">steps outlined on the Google developer portal<\/a>.<\/p>\n<p>Overview:<\/p>\n<ol>\n<li>Fetch the Google root signing keys.<\/li>\n<li>Verify that the signature of the intermediate signing key is valid by any of the root signing keys that is not expired.<\/li>\n<li>Verify that the intermediate signing key of the payload is not expired.<\/li>\n<li>Verify that the signature of the payload is valid by the intermediate signing key.<\/li>\n<li>Decrypt the contents of the payload after you verify the signature.<\/li>\n<li>Verify that the message isn't expired. This requires you to check that the current time is earlier than the <code>messageExpiration<\/code> field in the decrypted contents.<\/li>\n<li>Use the payment method details you just decrypted to make the payment.<\/li>\n<\/ol>\n<p>Depending on whether the card is stored as FPAN or DPAN, you get the following output:<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Output for FPAN'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"paymentMethodDetails\\\": {\\n        \\\"authMethod\\\": \\\"PAN_ONLY\\\",\\n        \\\"pan\\\": &lt;GOOGLE_PAY_PAN&gt;,\\n        \\\"expirationMonth\\\": &lt;GOOGLE_PAY_EXP_MONTH&gt;,\\n        \\\"expirationYear\\\": &lt;GOOGLE_PAY_EXP_YEAR&gt;\\n        }\\n }\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Output for DPAN'\" :id=\"''\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"\",\"content\":\"{\\n    \\\"paymentMethodDetails\\\": {\\n        \\\"authMethod\\\": \\\"CRYPTOGRAM_3DS\\\",\\n        \\\"pan\\\": &lt;PAN&gt;,\\n        \\\"expirationMonth\\\": &lt;expiry month&gt;,\\n        \\\"expirationYear\\\": &lt;expiry year&gt;,\\n        \\\"cryptogram\\\": &lt;CRYPTOGRAM&gt;,\\n        \\\"eciIndicator\\\": &lt;eciIndicator&gt;\\n        }\\n }\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h3>API reference<\/h3>\n<p>The parameters listed in this section are specific to using decrypted Google Pay tokens. For descriptions of other parameters go to  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/payments\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/payments<\/a>.<\/p>\n<p>The parameters you must send in the request are different for cards stored as FPAN and cards stored as DPAN.<\/p>\n<div class=\"notices green\">\n<p>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 <a href=\"\/pt\/online-payments\/3d-secure\/\">here<\/a>.<\/p>\n<\/div>\n\n<div id=\"tabb85qA\">\n    <div data-component-wrapper=\"tabs\">\n        <tabs\n                        :items=\"[{&quot;title&quot;:&quot;FPAN&quot;,&quot;content&quot;:&quot;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th&gt;Parameter name&lt;\\\/th&gt;\\n&lt;th&gt;Required&lt;\\\/th&gt;\\n&lt;th&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-type\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.type&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;scheme&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-number\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.number&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;pan&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-expiryMonth\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;expiryMonth&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;expirationMonth&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-expiryYear\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;expiryYear&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;expirationYear&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-brand\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.brand&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;googlepay&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt;&lt;code&gt;additionalData.paymentdatasource.type&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;googlepay&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt;&lt;code&gt;additionalData.paymentdatasource.tokenized&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;false&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-shopperInteraction\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;shopperInteraction&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Ecommerce&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Payment request with FPAN&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;json\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;{\\\\n    \\\\\\&quot;PaymentMethod\\\\\\&quot;: {\\\\n        \\\\\\&quot;type\\\\\\&quot;: \\\\\\&quot;scheme\\\\\\&quot;,\\\\n        \\\\\\&quot;number\\\\\\&quot;: &amp;lt;PAN&amp;gt;\\\\n        \\\\\\&quot;expiryMonth\\\\\\&quot;: &amp;lt;expiry month&amp;gt;,\\\\n        \\\\\\&quot;expiryYear\\\\\\&quot;: &amp;lt;expiry year&amp;gt;,\\\\n        \\\\\\&quot;brand\\\\\\&quot;: \\\\\\&quot;googlepay\\\\\\&quot;\\\\n    },\\\\n    \\\\\\&quot;additionalData\\\\\\&quot;: {\\\\n        \\\\\\&quot;paymentdatasource.type\\\\\\&quot;: \\\\\\&quot;googlepay\\\\\\&quot;,\\\\n        \\\\\\&quot;paymentdatasource.tokenized\\\\\\&quot;: \\\\\\&quot;false\\\\\\&quot;\\\\n    },\\\\n    \\\\\\&quot;shopperInteraction\\\\\\&quot; \\\\\\&quot;Ecommerce\\\\\\&quot;\\\\n}\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;fpan_0_1&quot;,&quot;relation&quot;:&quot;&quot;},{&quot;title&quot;:&quot;DPAN&quot;,&quot;content&quot;:&quot;\\n&lt;table&gt;\\n&lt;thead&gt;\\n&lt;tr&gt;\\n&lt;th&gt;Parameter name&lt;\\\/th&gt;\\n&lt;th&gt;Required&lt;\\\/th&gt;\\n&lt;th&gt;Description&lt;\\\/th&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/thead&gt;\\n&lt;tbody&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-type\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.type&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;scheme&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-number\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.number&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;pan&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-expiryMonth\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;expiryMonth&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;expirationMonth&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-expiryYear\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;expiryYear&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;expirationYear&lt;\\\/code&gt; from the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-fundRecipient-paymentMethod-brand\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;paymentMethod.brand&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;googlepay&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-mpiData-directoryResponse\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;directoryResponse&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Y&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-mpiData-authenticationResponse\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;authenticationResponse&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Y&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-mpiData-cavv\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;cavv&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;cryptogram&lt;\\\/code&gt;. Pass the exact value in the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-mpiData-eci\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;eci&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;The &lt;code&gt;eciIndicator&lt;\\\/code&gt;. Pass the exact value in the decrypted payload.&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt;&lt;code&gt;additionalData.paymentdatasource.type&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;googlepay&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt;&lt;code&gt;additionalData.paymentdatasource.tokenized&lt;\\\/code&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;true&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;tr&gt;\\n&lt;td&gt; &lt;a href=\\&quot;https:\\\/\\\/docs.adyen.com\\\/api-explorer\\\/Checkout\\\/latest\\\/post\\\/payments#request-shopperInteraction\\&quot; class=\\&quot;codeLabel  external-link no-image\\&quot; target=\\&quot;_blank\\&quot; rel=\\&quot;nofollow noopener noreferrer\\&quot;&gt;shopperInteraction&lt;\\\/a&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;img title=\\&quot;-white_check_mark-\\&quot; alt=\\&quot;-white_check_mark-\\&quot; class=\\&quot;smileys\\&quot; src=\\&quot;\\\/user\\\/data\\\/smileys\\\/emoji\\\/white_check_mark.png\\&quot; \\\/&gt;&lt;\\\/td&gt;\\n&lt;td&gt;&lt;span translate=\\&quot;no\\&quot;&gt;&lt;strong&gt;Ecommerce&lt;\\\/strong&gt;&lt;\\\/span&gt;&lt;\\\/td&gt;\\n&lt;\\\/tr&gt;\\n&lt;\\\/tbody&gt;\\n&lt;\\\/table&gt;\\n&lt;div data-component-wrapper=\\&quot;code-sample\\&quot;&gt;\\n    &lt;code-sample :title=\\&quot;&#039;Payment request with DPAN&#039;\\&quot; :id=\\&quot;&#039;&#039;\\&quot; :code-data=&#039;[{\\&quot;language\\&quot;:\\&quot;json\\&quot;,\\&quot;tabTitle\\&quot;:\\&quot;\\&quot;,\\&quot;content\\&quot;:\\&quot;{\\\\n    \\\\\\&quot;PaymentMethod\\\\\\&quot;: {\\\\n        \\\\\\&quot;type\\\\\\&quot;: \\\\\\&quot;scheme\\\\\\&quot;,\\\\n        \\\\\\&quot;number\\\\\\&quot;: &amp;lt;PAN&amp;gt;\\\\n        \\\\\\&quot;expiryMonth\\\\\\&quot;: &amp;lt;expiry month&amp;gt;,\\\\n        \\\\\\&quot;expiryYear\\\\\\&quot;: &amp;lt;expiry year&amp;gt;,\\\\n        \\\\\\&quot;brand\\\\\\&quot;: \\\\\\&quot;googlepay\\\\\\&quot;\\\\n    },\\\\n    \\\\\\&quot;mpiData\\\\\\&quot;: {\\\\n        \\\\\\&quot;directoryResponse\\\\\\&quot;: \\\\\\&quot;Y\\\\\\&quot;,\\\\n        \\\\\\&quot;authenticationResponse\\\\\\&quot;: \\\\\\&quot;Y\\\\\\&quot;,\\\\n        \\\\\\&quot;cavv\\\\\\&quot;: &amp;lt;CRYPTOGRAM&amp;gt;, \\\\\\\/\\\\\\\/ Pass the exact value in the decrypted payload\\\\n        \\\\\\&quot;eci\\\\\\&quot;: &amp;lt;eciIndicator&amp;gt; \\\\\\\/\\\\\\\/ Pass the exact value in the decrypted payload\\\\n    },\\\\n    \\\\\\&quot;additionalData\\\\\\&quot;: {\\\\n        \\\\\\&quot;paymentdatasource.type\\\\\\&quot;: \\\\\\&quot;googlepay\\\\\\&quot;,\\\\n        \\\\\\&quot;paymentdatasource.tokenized\\\\\\&quot;: \\\\\\&quot;true\\\\\\&quot;\\\\n    },\\\\n    \\\\\\&quot;Shopperinteraction\\\\\\&quot; \\\\\\&quot;Ecommerce\\\\\\&quot;\\\\n}\\&quot;}]&#039; :enable-copy-link-to-code-block=\\&quot;true\\&quot; :code-sample-card-size=\\&quot;&#039;fullsize&#039;\\&quot;&gt;&lt;\\\/code-sample&gt;\\n&lt;\\\/div&gt;\\n&quot;,&quot;altTitle&quot;:null,&quot;oldTabId&quot;:&quot;dpan_1_2&quot;,&quot;relation&quot;:&quot;&quot;}]\"\n            :should-update-when-url-changes='false'>\n        <\/tabs>\n    <\/div>\n<\/div>\n","url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/api-only\/google-pay-token-decryption","articleFields":{"description":"Learn how to decrypt Google Pay tokens.","id":"42833055","type":"page","_expandable":{"operations":""},"status":"current","feedback_component":true},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/api-only\/google-pay-token-decryption","title":"Decrypt Google Pay tokens if you are PCI-compliant","content":"A Google Pay token contains encrypted card details that a shopper has stored in their Google Pay wallet. Google Pay tokens let you securely pass the data of your shoppers to a payment service provider, like Adyen, to process payments.\nIf you are PCI-compliant you can handle the token decryption and pass raw card details to Adyen.\nA benefit of handling the decryption is that auditing transactions is easier when you have more information, such as the shopper name. See Google's documentation for the full list of details in a decrypted token.\nOnly handle the token decryption on your own in advanced setup scenarios, like when you have to submit Merchant Plug-In (MPI) data in a Google Pay request.\nHandle the decryption\nRequirements\nTo decrypt Google Pay tokens on your own, you must:\n\nHave a Google Pay merchant ID.\nBe PCI-compliant to handle unencrypted card details.\nHave an API-only integration.\n\nDecryption process\nTo decrypt Google Pay tokens, follow the steps outlined on the Google developer portal.\nOverview:\n\nFetch the Google root signing keys.\nVerify that the signature of the intermediate signing key is valid by any of the root signing keys that is not expired.\nVerify that the intermediate signing key of the payload is not expired.\nVerify that the signature of the payload is valid by the intermediate signing key.\nDecrypt the contents of the payload after you verify the signature.\nVerify that the message isn't expired. This requires you to check that the current time is earlier than the messageExpiration field in the decrypted contents.\nUse the payment method details you just decrypted to make the payment.\n\nDepending on whether the card is stored as FPAN or DPAN, you get the following output:\n\n    \n\n\n    \n\nAPI reference\nThe parameters listed in this section are specific to using decrypted Google Pay tokens. For descriptions of other parameters go to  \/payments.\nThe parameters you must send in the request are different for cards stored as FPAN and cards stored as DPAN.\n\nFPAN 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.\n\n\n\n    \n        \n        \n    \n\n","type":"page","locale":"pt","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Google Pay","lvl3":"Google Pay for API only","lvl4":"Decrypt Google Pay tokens if you are PCI-compliant"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay","lvl3":"https:\/\/docs.adyen.com\/pt\/payment-methods\/google-pay\/api-only","lvl4":"\/pt\/payment-methods\/google-pay\/api-only\/google-pay-token-decryption"},"levels":5,"category":"Payment method","category_color":"green","tags":["Decrypt","Google","tokens","PCI-compliant"]}}
