This document provides comprehensive guidance for integrating Google Pay™ with the Neolink payment gateway. Google Pay™ offers a secure, fast payment method that improves conversion by allowing customers to check out without manually entering card details.
Before proceeding with integration, please review these Google Pay™ documents:
Neolink payment gateway supports the following features with Google Pay™:
When integrating Google Pay™ into your website or application, you must adhere to Google's branding requirements:
Correct usage examples:
Incorrect usage examples:
When displaying the Google Pay button in your checkout flow, use the official assets:
<button type="button" class="gpay-button">Buy with Google Pay</button>
For detailed branding requirements, consult the Google Pay Web Brand Guidelines or Google Pay Android Brand Guidelines depending on your platform.
Integration OptionsNeolink offers two methods for integrating Google Pay™:
The table below compares these integration methods:
Feature Hosted Payment Page Server-to-Server API Implementation complexity Low High Google Pay™ button hosting Neolink Merchant Google Pay API implementation Not required Required 3DS handling Automatic Manual implementation Customization Limited Full control Google registration required No Yes Hosted Payment Page IntegrationThe hosted payment page option is the simplest way to implement Google Pay™, as Neolink handles all Google Pay™ integration details.
Integration StepsCreate a payment session using the standard Neolink API:
POST /orders/create HTTP/1.1
Authorization: Basic cHJvamVjdDpwYXNzd29yZA==
Content-Type: application/json
{
"amount": "99.99",
"currency": "USD",
"description": "Order #12345",
"options": {
"google_pay_enabled": 1
}
}
Note: The Authorization
header contains Base64-encoded credentials in the format project:password
. In this example, "cHJvamVjdDpwYXNzd29yZA==" is the Base64 encoding of "project:password".
The google_pay_enabled
parameter ensures Google Pay™ is available when supported.
The Server-to-Server integration provides complete control over the checkout experience but requires implementing the Google Pay™ API directly.
PrerequisitesConfigure Google Pay™ API: Set up the Google Pay™ API client on your website/app
Set up tokenization specifications:
const tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'neolinkprocessing',
'gatewayMerchantId': 'YOUR_NEOLINK_MERCHANT_ID'
}
};
Configure allowed payment methods:
const allowedCardNetworks = ['VISA', 'MASTERCARD'];
const allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];
Billing Address Configuration:
Note: Neolink does not require billing address information for processing Google Pay™ transactions. The BillingAddressParameters configuration is optional and not used for address verification purposes.
If you still want to collect billing address information for your own purposes, you can configure it as follows:
const paymentDataRequest = {
billingAddressParameters: {
format: 'MIN',
phoneNumberRequired: false
}
};
Handle payment token: Send the encrypted Google Pay™ token to Neolink API
Process the payment: Use the token_pay endpoint to complete the transaction
const googlePayClient = new google.payments.api.PaymentsClient({
environment: 'PRODUCTION'
});
const button = googlePayClient.createButton({
onClick: onGooglePayButtonClicked,
buttonType: 'pay'
});
document.getElementById('google-pay-container').appendChild(button);
Payment Processing
When a customer selects Google Pay™, send the payment token to your server, then forward it to Neolink:
function onGooglePayButtonClicked() {
googlePayClient.loadPaymentData(paymentDataRequest)
.then(function(paymentData) {
fetch('/process-google-pay', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({googlePayToken: paymentData.paymentMethodData.tokenizationData.token})
});
});
}
app.post('/process-google-pay', (req, res) => {
const { googlePayToken } = req.body;
const encodedToken = Buffer.from(JSON.stringify(googlePayToken)).toString('base64');
const response = await fetch('https://api.neolink.io/orders/token_pay', {
method: 'POST',
headers: {
'Authorization': 'Basic cHJvamVjdDpwYXNzd29yZA==',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: '99.99',
currency: 'USD',
description: 'Order #12345',
dsrp: {
type: 'google_pay',
token: encodedToken
},
location: {
ip: customerIpAddress
}
})
});
});
API Request Example
POST /orders/token_pay HTTP/1.1
Authorization: Basic cHJvamVjdDpwYXNzd29yZA==
Content-Type: application/json
{
"amount": "99.99",
"currency": "USD",
"description": "Order #12345",
"dsrp": {
"type": "google_pay",
"token": "BASE64_ENCODED_GOOGLE_PAY_TOKEN"
},
"location": {
"ip": "customer.ip.address"
}
}
Note: The Google Pay token must be base64 encoded before sending to the gateway. The original token structure looks like:
{
"signature": "MEQCID2+6F+VWOVFl0WzEWmJLQ+Yyu6hvKfmLfau+Vhcn15jAiB5lXB4qS9tj+smxM6CYpS6D5Jy9Uk7iIfblV+qDrBs+Q==",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErfdKolfpy1W9Kfz8b/4eczsrJ1Zm2wTHbznpWFKbPxbPSQDV2o//7+62yPHKckqPJR7Gs/yiTLaWIq6L9M4x1w\\u003d\\u003d\",\"keyExpiration\":\"1751582620000\"}",
"signatures": [
"MEUCIENG3AXKnawqRnKgWK0VwCZX8TGUzwZH8daLf3VVAoAJAiEAhM1LtT0XCP5idLvHoxaWjp55yEfwA7ZcGINBV0XWYxM="
]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"N+D5mrmv/pPUyCBNoUMR0oX9ypV5pIJ2pjdNm0Qvqg6j2BA9IxYmTVkmVNA445SS9YLxk/Et4QDjGTnOx8VYg9FDRkOccuidOz5mNPlbQblpkqBV4TN0aVnm0GkBd6+oIHCj2juFkxzuN9UoJndoFVcHloodCnMoXA3hdVeQpM1WOZNvwYpGV51VLa/NCu58Ob9+Ky3AuDYLc53b5IBUEFzj/SGBWW0voLQyyZ9M++6u5fnvGA29gJYtrUTKfdPijSTU7Jj3hZ1wzAqxrUGyhSsLEKghmu+5zlo0ikAltVHm3ylCwewn03rvOvM8yLIDO4SZ6UMUfv9d9HWuUEGGm47SAqnPxS8t8f/dgHI9rVdGqmfUl3+uBpeDAO4qvmsMv6MWaUDIP4PsbxIteaHZ2Ur0d3ehF5zPel+Lq2zEQXb1woJrHVS73DuBbiYLzd1Ol6wIET8vPBtcEkdKGvcp13HfBHDzPNqEuM/ukiDHA7qCUooKrTEbeJPzwqOo7kZ2pR3O2F61wEpsc/vcONToVV+AekH64rqRiGnEZZhXy089Qsfa/VYcYD8\\u003d\",\"ephemeralPublicKey\":\"BMvyISANVvctFeCWhibFZOrBL3eRT3ZblvZbNhIxkufGixQWnzdbewpqwpxayS+uZX138xoDpl6QdF6ftAFHXYc\\u003d\",\"tag\":\"aQAcUBB5sHKF1S/sm2cow0VLzwAIBarTJA99yp2M3z0\\u003d\"}"
}
This entire structure should be base64 encoded before sending to the gateway.
3D Secure AuthenticationNote: Your API endpoint may be different based on your specific integration. The endpoint could be like
api.{domain}.com
. Your specific endpoints will be provided during the onboarding process.
3D Secure (3DS) enhances payment security and may be required depending on the card type used with Google Pay™.
3DS Requirements by Card TypeGoogle Pay™ supports two types of card credentials:
PAN_ONLY: Physical card details stored in Google Pay™
CRYPTOGRAM_3DS: Tokenized virtual card stored on device
When processing a PAN_ONLY card through Google Pay™, you may need to handle 3DS authentication:
If the payment requires 3DS authentication, the API will return a response with 3DS details:
{
"orders": [{
"id": "60391976929806541",
"status": "prepared",
"form3d": {
"threeDSSessionData": "NjAzOTE5NzY5Mjk4MDY1NDE=",
"method": "POST",
"action": "https://checkout.neolink.io/complete/secure3d20"
},
"form3d_html": "<form id=\"form3d\" method=\"POST\" action=\"https://checkout.neolink.io/complete/secure3d20\"><input type=\"hidden\" name=\"threeDSSessionData\" value=\"NjAzOTE5NzY5Mjk4MDY1NDE=\"></form><script>window.onload = function() {document.forms['form3d'].submit();}</script>",
"secure3d": {
"dsrp": "0",
"scenario": "unknown",
"reason": "force3d",
"eci": "0",
"version": "2"
}
}]
}
Note: The checkout domain in the example above may be different based on your specific integration. It could be like
checkout.{domain}.com
. Your specific endpoints will be provided during the onboarding process.
You need to:
Before going live, thoroughly test your Google Pay™ integration using a combination of Google's test environment and Neolink's testing tools.
Google Pay Test EnvironmentGoogle Pay™ provides a dedicated test environment that automatically displays mock test cards in the payment sheet. To use this environment, set the environment parameter to 'TEST':
const googlePayClient = new google.payments.api.PaymentsClient({
environment: 'TEST'
});
When the environment is set to 'TEST', the Google Pay payment sheet will display a suite of test cards specifically for integration testing, without requiring you to add actual cards to your Google account.
Mock Test CardsYour integration will use Google's mock test cards when in the TEST environment. These mock cards provide:
PAN_ONLY
authentication methodThe tokens generated with these mock cards can be processed by Neolink's test environment, as it accepts any valid card format.
Testing ProcessWhen testing your Google Pay™ integration with Neolink, you can use a streamlined approach:
UI and Payment Flow Testing:
End-to-End Testing:
If you encounter issues during testing:
gateway: 'neolinkprocessing'
)For persistent issues, contact Neolink support.
Troubleshooting Common Issues Issue Possible Cause Solution Google Pay™ button not displaying Device/browser not supported Check if the browser is on the supported list "Payment method not supported" error Incorrect card network configuration Ensure you're only requesting VISA and Mastercard networks Payment declined Test card or incorrect amount format Check card details and ensure amount is formatted correctly 3DS authentication fails Incorrect 3DS implementation Review 3DS flow implementation Token_pay API errors Malformed request Verify all required parameters are included and formatted correctly Error Response Examples{
"failure_type": "validation",
"failure_message": "Validation failed",
"order_id": null
}
For persistent issues, contact Neolink support with:
For additional assistance with your Google Pay™ integration, please contact Neolink support.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4