Skip to main content

Documentation

Creating a Google Pay™ Payment on a Customized Checkout Page

Create Google Pay™ payments on your customized hosted page via direct integration.

Using direct integration, merchants integrate Google Pay payment directly on the checkout page hosted on their servers.

Note that this direct integration is different from the direct integration described in Google online documentation.

Prerequisites
Direct Integration Procedure

To use direct integration to create Google Pay™ payments on a customized hosted page:

  1. Send the relevant API request to determine whether Google Pay™ is available.

    Google Pay™ sends a successful response.

    The merchant checkout page displays a Google Pay™ button.

  2. When a customer presses the Google Pay™ button, send a payment request to Google Pay™. Set the following values:

    • apiVersion - 2

    • apiVersionMinor - 0

    • allowedCardNetworks - MASTERCARD, VISA

    • allowedPaymentMethods.parameters.allowedAuthMethods - PAN_ONLY, CRYPTOGRAM_3DS

    • allowedPaymentMethods.tokenizationSpecification.type - PAYMENT_GATEWAY

    • allowedPaymentMethods.tokenizationSpecification.parameters.gateway - Rapyd

    • allowedPaymentMethods.tokenizationSpecification.parameters.gatewayMerchantId - The merchant's organization ID/access key.

    • billingAddress - Not required

    • merchantInfo.merchantId - Merchant ID provided by Google

    The Google Pay™ response contains the payment data, including the encrypted payment token.

  3. Send an INITIATE request to Rapyd to authorize the order. Include the payment data from the Google Pay™ response in paymentData . See PaymentDataRequest. In this example, replace the sample with the payment token from the Google Pay™ response.

    {  
      {  
        "apiVersionMinor": 0,  
        "apiVersion": 2,  
        "paymentMethodData": {  
            "description": "Mastercard  •••• 1111",  
            "tokenizationData": {  
                "type": "PAYMENT_GATEWAY",  
                "token": "{\"signature\":\"MEQCIBjQhjaZB76j...d}"  
            }  
        },  
        "type": "CARD",  
        "info": {  
            "cardNetwork": "MASTERCARD",  
            "cardDetails": "1111"  
        }  
    }

     

    Rapyd validates the data.

    • If 3DS authentication is required, Rapyd sends a URL for 3DS authentication to the merchant for the customer.

    • If 3DS authentication is not required, Rapyd screens for fraud. If successful, Rapyd processes the payment and sends a response to the merchant.

  4. Process the Rapyd response.

    • If 3DS authentication is required, provide the 3DS authentication URL to the customer.

    • If 3DS authentication is not required, complete the checkout payment process.

Create Payment with Google Pay™

Create the payment as described in Create Payment. Set the following values:

  • Set payment_method.type to the payment method type.

  • Set digital_wallet.type to google_pay.

  • Set payment_method.digital_wallet.details.token to the entire token object from Google Pay™, without any changes.