# Google Pay Google Pay allows your customers to store payment methods in their own Google account for faster and more secure payments. ## How it works When the customer clicks the Google Pay payment button, the payment methods saved to their Google account are displayed. The customer can quickly select the desired payment method and optionally fill in additional purchase information. After this interaction with Google Pay, these same data will be sent / processed by the Carat Portal for payment flow. [block:image] { "images": [ { "image": [ "https://files.readme.io/3882eaee066044c374f69fbfd26ddfc9969a8f26b0cd15d0cdf6ed782ca04074-googlepay-EN.png", null, null ], "align": "center" } ] } [/block] > Google Pay is supported by Carat Portal, however it is not supported by all acquirers and is not enabled by default in your account. Contact a member of our support team for more information. > > **Attention**: By using Google Pay through Carat Portal, the merchant must be aware of and adhere to the [Acceptable Use Policy](https://payments.developers.google.com/terms/aup) and accept the [Google Pay API Terms of Service](https://payments.developers.google.com/terms/sellertos). *** ## REST Payment ### Integrate with Google Pay To start processing payments with Google Pay, you need to integrate with Google via [Web](https://developers.google.com/payments/web/setup) or [Android](https://developers.google.com/payments/setup). During the integration you will see that some parameters are required to process Google Pay through Carat Portal: - The `gatewayMerchantId` parameter must be populated with the merchant's merchant_id in Carat Portal; - The `gateway` parameter must be filled with` softwareexpress`; Below is an excerpt of integration via web that needs to be configured with Carat Portal data: ```javascript const tokenizationSpecification = { type: 'PAYMENT_GATEWAY', parameters: { gateway: 'softwareexpress', gatewayMerchantId: '', }, }; ``` Below is an excerpt of integration via Android that needs to be configured with Carat Portal data: ```java .setPaymentMethodTokenizationType(WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY) .addParameter("gateway", "softwareexpress") .addParameter("gatewayMerchantId", "") ``` The following _card networks_ available on Google Pay are supported by Carat Portal: `VISA`, `ELECTRON`, `MASTERCARD`, `MAESTRO`, `ELO`, `ELO_DEBIT`, `AMEX`, `DISCOVER` and `JCB`. The following _authorization methods_ available on Google Pay are supported by Carat Portal: `PAN_ONLY` and `3DS_CRYPTOGRAM`. Contact our support team to activate the proper settings for your merchant. In addition, the store must follow Google Pay layout guidelines. See the [Google Pay documentation](https://developers.google.com/pay/api) for brand guidelines. The screens below shows a [Web](https://developers.google.com/pay/api/web/guides/brand-guidelines) buy flow recommended by Google Pay. ![](https://files.readme.io/9277a2818928aedf537c5ec6aaee642c5d54d40f7124c22c44115aca2a849759-googlepay_web-buy-flow.png) The screens below shows an [Android](https://developers.google.com/pay/api/android/guides/brand-guidelines) buy flow recommended by Google Pay. ![](https://files.readme.io/c086b42ef7f7035c5378e3d8fafad1765d3149caa01eb816eed46bd8b7e249c8-googlepay_android-shopping-cart.png) ### Send data to Carat Portal When you complete your integration with Google, you will have all the information you need to make a payment with Carat Portal. Google will respond with the PaymentData response, which includes the encrypted load (token). From the Google response containing the customer information, extract the _token_, following the [API reference](https://developers.google.com/pay/api/web/reference/response-objects) to properly extract the _token_ from the response. Currently, the token can be extracted from `paymentData.paymentMethodData.tokenizationData.token`. Use this token on [payment effectuation](pagamento-rest-dopayment.md) request in the `card.wallet_transaction_id` field. Additionally this, will be necessary to send the field `paymentData.paymentMethodData.info.cardNetwork` to the field `wallet_returned_card_brand`. Below is an example of this request: > The content of `paymentData.paymentMethodData.tokenizationData.token` is equivalent to a JSON, but there is no need to handle this content. Pass the value obtained without performing any treatment to the `card.wallet_transaction_id` field. To use this example, don't forget to define the variable `{{url}}` with the value
**** ```bash curl -X POST \ https://esitef-homologacao.softwareexpress.com.br/e-sitef/api/v1/payments/ \ --header "Content-Type: application/json" \ --header "merchant_id: " \ --header "merchant_key: " \ --data-binary '{ "authorizer_id": "405", "card": { "wallet_transaction_id": "{\"signatures\":\"MEUCIH1PBdMmbWMvaR/ArH08R/OT41Or2yfLqbzj2JG9VGfJAiEA+6NPKT6sAKZeaLacm29wIS8v2tUwPE281JuRBf81imo\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEm1j1auejJXFzexs/H3TasImWFERsifrx93W7wxZb0dpLxk/FaK8hQN6Ypwep8DaYrEKSp6zvxeE4ezDrssf/Bg\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1576347458323\\\"}\",\"signatures\":[\"MEYCIQCbAolg3/K2yD0/p3K7gRFhXva79STrj+rZcYp/3vi6ogIhANGT/9GkO9S1lJtnu3C6QQ/kFSR2wxtPJRGfuqSKs9FE\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"Dcm8wxtB6Bp7CyHV1OBqTskStqX3K5x7I0fV/2V0KsMLkZHP5nn+IXC+HBLkZtPF0Ov6uBD1eLbOB2KQd1cVmBPm7f4xSsB4DaYTktfk2AaLpR0BZlb9errv4jl4QAxSLdxw8Hk3EKicSmvsUNE2SzFBOONPrvv1qe03ZnzB3Q0ID1ocsBJ09PQ/2jft0WY/Py6iAA4sccZKmxLdo83NJJc1VrfcGLcqwy5InUV4nSxmXrnr/eNQDIx9p4Yf3RSVlS6/t+bEpUjpUSwSNoHwzhlWOve3/Gm+yt+OKheXOWSsXiHJL1rV1ENgDroR2uMUb85OZCF1ulStb6U8xocRVKSKkhAxFVUehz568huQdlEjns+5MMWdZkNgH3cXMgTQxZ6DiUYxMthUhdT8HINXCUYxaT/od/Njh2JZHJb2R4u4HsfViUoIVRHojSaepXP3KI2z4G9hPwKX/MWeEMyiZRUiCHHe0VJoU/8xxg\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BG0eCJ8xbPN55ht7b3oDZgFgwG4rZxkRWrOFnmW9wwxUrZS0A6oeMAySLKThMydaGuoTbbiAwK38zx8pnNKgirA\\\\u003d\\\",\\\"tag\\\":\\\"uPvitOn+aGk48RlrwzYSKgDicO5oYtmMEWXzj5rUewo\\\\u003d\\\"}\"}" }, "wallet_returned_card_brand" : "MASTER" }' ``` In the example above, it was set `authorizer_id` field with the value `405`, which corresponds to select Google Pay as payment method; and was set `wallet_transaction_id` field with the value of the Google Pay _token_. Successful execution of the above command will return a JSON similar to the one below. ```json { "code": "0", "message": "OK. Transaction successful.", "payment": { "authorizer_code": "000", "authorizer_message": "Transacao OK", "status": "CON", "nit": "", "order_id": "13034649671", "customer_receipt": "====RECEIPT BUYER====", "merchant_receipt": "====RECEIPT MERCHANT====", "authorizer_id": "405", "acquirer_id": "1005", "acquirer_name": "Redecard", "authorizer_date": "28/02/2020T08:57", "authorization_number": "132030", "merchant_usn": "13034649671", "esitef_usn": "170713097340300", "sitef_usn": "132030", "host_usn": "999132030", "payment_date": "13/07/2017T15:52", "amount": "1000", "payment_type": "C", "issuer": "2", "authorizer_merchant_id": "" } } ``` For more details, see [Carat Portal REST payment](pagamento-rest-fluxo.md). *** ## REST Card Storage (Vault) Card storage is possible, with some exceptions depending on how the Google Pay _ token _ was generated. Contact our support team to make the necessary configurations to enable this storage. REST card storage works just like storing any other card, but with the following precautions: - Instead of sending card numbers, send the `wallet_transaction_id` field. - The `authorizer_id` field must be sent according to the card network. See the table below to submit the correct value: | Google Pay Card Network | `authorizer_id` | | ----------------------- | --------------- | | VISA | 1 | | ELECTRON | 221 | | MASTERCARD | 2 | | MAESTRO | 286 | | ELO | 41 | | ELO_DEBIT | 288 | | AMEX | 3 | | DISCOVER | 44 | | JCB | 43 | For more details, see [Carat Portal REST store](armazenamento-rest-fluxo). *** ## HTML Payment To use Google Pay with HTML payment, please contact a member of our support team to perform the necessary setup. You can determine which card networks will be accepted on Google Pay in HTML integration.