> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/guides/payment-methods/google-pay/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Google Pay ## About Google Pay allows users to pay securely in Android apps and on websites using cards saved in their Google Wallet.
Region International
Currencies See the [currencies](/guides/currencies) page for details
[Refunds](/guides/refunds) Yes, within 11 months
[Disputes](/guides/disputes) Yes
Preauthorization No
[Recurring payments](#recurring-payments) Yes
## Activation To offer Google Pay with Mangopay you need to integrate Google Pay on your side. See the [Google Pay documentation](https://developers.google.com/pay/api) for full details about integration in your [website](https://developers.google.com/pay/api/web/overview) or [Android app](https://developers.google.com/pay/api/android/overview). The configuration for your Google Pay API call in the payment flow is given below. If not using Mangopay's Checkout SDK, you also need to adhere to their design guidelines. ## Flow diagram The overall flow of a one-times Google Pay payment is given in the diagram below. ## One-time payments #### Present Google Pay to user The user selects Google Pay at the checkout on your app or website and confirms payment. #### Request payment data from Google Pay When making payment requests to the Google Pay API, use the following values: * `gateway` - The payment gateway used: in this case, `whenthen`. * `gatewayMerchantId` - Your platform’s `ClientId` provided by Mangopay. * `allowedAuthMethods` - The supported authentication methods: * `PAN_ONLY`, meaning the card is registered in the user’s Google account and requires additional 3DS authentication * `CRYPTOGRAM_3DS`, meaning the card is enrolled in the customer’s Google Wallet and authentication is handled by Google, with no 3DS redirection and no liability for the platform. * `allowedCardNetworks` - The card networks supported by Mangopay on Google Pay: only `VISA` and `MASTERCARD`. **`Google Pay configuration example`** ```json Google Pay configuration example { "type": "CARD", "parameters": { "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "allowedCardNetworks": ["MASTERCARD", "VISA"] }, "tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "whenthen", "gatewayMerchantId": "your-mangopay-client-id" } } } ``` #### Request the pay-in from Mangopay Call the [POST Create a Google Pay PayIn](/api-reference/google-pay/create-google-pay-payin) endpoint, including the `PaymentData` string as recieved from Google Pay. The amount and currency of your pay-in request must match your Google Pay request. **`Google Pay payment data in Mangopay API request`** ```json Google Pay payment data in Mangopay API request { // ... "PaymentData":"{\"signature\":\"MEUCIQDc49/Bw1lTk8ok2fUe4UT2q955C01N2av40WJ28pMt0QIgBxiXHZbccHuqEQHyNJJw8SM337fxd8A3kJFqhsf4pHo\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8bX5bzBELcoJ1pPhEHtTIhpZQsRgVIMtRf9R5yRyC9c9WH8bvgxIx40qH4aQ+btVM/rwKuDE8cs+dERH2gjUjw\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1688804022772\\\"}\",\"signatures\":[\"MEUCIF2OifAlN5PG+isU+xxX8/OU5MTk81hBulSmp9bu8caDAiEAkdRqb8uo4CUx4kMiA317A1b+5BxRUc/8+QMyc9Ikjfg\\u003d\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"tsTuUpytOkm8ENo1PpyzsHk6jxGDus/sSNQwqZeoPNw/NMQX2LJxJ6OTS4Yt+iNM7v4iuFC0eUWiy58xCQHKANeO/y66GJWMaDjPW2FBqBksb1WHXxP5KmgglACSqXtOMmjuYxVT6MeO4EfdsT4vGHRP0adP+Lkfj1tfjM1K0HyRWbLcwU9YXU0j83wV3PW28oxdFY5F4DC+Bhk7J5bZhIf5jymRXy3sR0kDoE/Qi4fUIdvgoHzi6MvppxCaEgwCygvfxu+vddP/7dshnL9+OFaDpoAp6is8I4UYbscNHkLosfBPwyUtndLMkDfNKUJ3yus92KSfbcK0iif3kXSMmV6ZrN873S7f27bsCsHhAlywOFpACorBNO8FzX/ediCsSi+n5kWOxe9oewGOeME2RNTsoy8an23be8yTek3YKajIhJRFW/9OtVnNmKOqwgw0F8nPFTjuSVPZbkinYS46Tr+KjOcr5aznEElkmk6OWgX1xSVkHZPpoW8XZdhB6Vs/5eWP6URncDZYN2EWtpWuz1+CAVKEjD95gcQGvzhmlPB0duiV76psDik8ojf2B6QfPJxV\\\",\\\"ephemeralPublicKey\\\":\\\"BJ0QIVwltj1vH2NAmYgUYBRrNymcOtTTP3QJnSc+enFGigIhNS87PZyA0PZ4iT/tifOqBj6barpJMwSQeO3nbJ0\\\\u003d\\\",\\\"tag\\\":\\\"R0iTOk4bogyVkf0STTvdiFq4kebJS7GN5/zxoBuCNNs\\\\u003d\\\"}\"}", // ... } ``` You also need to define the `SecureModeReturnURL` to which the user will be returned after redirection (if required). #### Redirect the user (if required) Redirect the user to the `SecureModeRedirectURL` value to complete strong customer authentication with the issuer, unless the value is `null`. You can also use the `SecureModeNeeded` boolean to determine this redirection behavior. On Google Pay, redirection is not required if the user's card was enrolled in their Google Wallet and Google's `CRYPTOGRAM_3DS` authentication could be used. #### Return the user (if they were redirected) In a redirection scenario, after the user completes authentication, they are returned to the `SecureModeReturnURL` which you defined. #### Handle the outcome The transaction is complete when the pay-in status changes from `CREATED` to `SUCCEEDED` or `FAILED`, indicating the outcome. Set up [webhooks](/webhooks) for the `PAYIN_NORMAL_SUCCEEDED` and `PAYIN_NORMAL_FAILED` [event types](/webhooks/event-types) to be notified of this. ## Recurring payments Recurring payments with Google Pay requires a pay-in registration object to set up the recurrence, before your platform can request pay-ins linked to the registration. The first pay-in, a **customer-initiated transaction (CIT)**, requires the user to be on session. Once the first payment is successful, your platform can then request subsequent pay-ins without the user present, known as **merchant-initiated transactions (MITs)**, at the frequency and amount agreed by the user. ### Payment flow The steps are as follows: #### Request the payment from Google Pay In the recurring flow, you need to obtain the `PaymentData` from Google Pay before calling the Mangopay API. #### Set up the recurring registration Call the [POST Create a Recurring PayIn Registration](/api-reference/recurring-payin-registrations/create-recurring-payin-registration) to register details about the user, the wallet, and the payments. Set the `PaymentType` to `GOOGLE_PAY` and provide the tokenized `PaymentData` string retrieved from the Google Pay API. The registration object contains the amount of the first transaction and details about the recurrence. It is also possible to specify the amount of subsequent transactions, but this can be overridden when requesting subsequent pay-ins. In the response, the `RecurringPayinRegistrationId` allows you to link the recurring pay-ins to this registration object. The `Status` of the registration object is `CREATED`. #### Process the customer-initiated transaction (CIT) Call the [POST Create a Recurring Google Pay PayIn](/api-reference/google-pay/create-recurring-google-pay-payin) with the CIT payload to initiate the first transaction. When the first transaction is initiated, the `Status` of the registration object becomes `AUTHENTICATION_NEEDED`. If 3DS authentication is required (not handled by Google Pay), you need to redirect the user to the `SecureModeRedirectURL` so they can complete strong customer authentication and validate the first transaction. Once the user authenticates and the first payment is successfully authorized, the registration object `Status` becomes `IN_PROGRESS` to indicates that you can debit subsequent payments without the user present. Set up a [webhook](/webhooks) for the `RECURRING_REGISTRATION_IN_PROGRESS` [event type](/webhooks/event-types) to be notified of this. #### Process merchant-initiated transactions (MIT) For subesequent payments, call the [POST Create a Recurring Google Pay PayIn](/api-reference/google-pay/create-recurring-google-pay-payin) with the MIT payload to initiate the pay-in. ### Reauthentication If at any point reauthentication is required by the issuer, the Registration object `Status` changes to `AUTHENTICATION_NEEDED`, which you can be notified of thanks to the `RECURRING_REGISTRATION_AUTH_NEEDED` [event type](/webhooks/event-types). In this case, you need to: 1. Obtain a new `PaymentData` string from Google Pay 2. Call the [PUT Update a Recurring PayIn Registration](/api-reference/recurring-payin-registrations/update-recurring-payin-registration) with the new data 3. Process a new CIT payment with the user on session to authenticate ### Ending the recurrence The registration object `Status` can be set to `ENDED` to indicate that it can no longer be used. You can do this using the [PUT Update a Recurring PayIn Registration](/api-reference/recurring-payin-registrations/update-recurring-payin-registration) endpoint. Set up a [webhook](/webhooks) for the `RECURRING_REGISTRATION_ENDED` [event type](/webhooks/event-types) to be notified of this. ## Related resources #### [Endpoint](/api-reference/google-pay/google-pay-payin-object) The Google Pay PayIn object #### [Testing](/testing/payment-methods#google-pay) Learn about testing Google Pay