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
Onboard with the Rapyd Client Portal. See Get Started.
Customize Hosted pages with Google Pay. See Customizing Hosted Pages with Google Pay™.
For Google Pay on the web: A JavaScript library. Follow the Google Pay Web brand guidelines and the Google Pay Web integration checklist.
For Google Pay on Android: The mobile SDK provided by Google Pay. Follow the Google Pay Android brand guidelines and the Google Pay Android integration checklist.
Direct Integration Procedure
To use direct integration to create Google Pay™ payments on a customized hosted page:
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.
When a customer presses the Google Pay™ button, send a payment request to Google Pay™. Set the following values:
apiVersion
- 2apiVersionMinor
- 0allowedCardNetworks
- MASTERCARD, VISAallowedPaymentMethods.parameters.allowedAuthMethods
- PAN_ONLY, CRYPTOGRAM_3DSallowedPaymentMethods.tokenizationSpecification.type
- PAYMENT_GATEWAYallowedPaymentMethods.tokenizationSpecification.parameters.gateway
- RapydallowedPaymentMethods.tokenizationSpecification.parameters.gatewayMerchantId
- The merchant's organization ID/access key.billingAddress
- Not requiredmerchantInfo.merchantId
- Merchant ID provided by Google
The Google Pay™ response contains the payment data, including the encrypted payment token.
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.
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.