Google Payβ
| Feature | Description |
|---|---|
| Payment Logo-Usage Guidelines | |
| Integration Methods |
|
| Recommended Regions | Global |
| Virtual Industry Support | β |
| Subscription Support | β Varies by industry |
| Supported SaaS | All integrated SaaS platforms |
| Supported Open-Source Platforms |
|
Integration Methodβ
Oceanpayment supports the following Google Pay integration methods:
| Integration Method | Description |
|---|---|
| Embedded | Merchants are not required to enroll in the Google Developer Program. Oceanpayment handles Merchant Validation and payment processing. |
| Server-to-Server | Merchants must enroll in the Google Developer Program, obtain the Google Pay Payment Token, and submit payment requests through Oceanpayment's server-side API. |
Embeddedβ
1. Integrationβ
Google Pay will be displayed as a payment option on the checkout page when available.
- Initiate Payment
- Create QuickPay
Use the Embedded Integration solution to complete the payment processing.
Use the Embedded Integration solution to complete QuickPay ID creation for the subscription payment scenario.
Server to Serverβ
To use this integration mode, you need to become an official Google Pay developer.
Google Pay developer registration supports business entities from multiple regions. However, availability of full merchant onboarding and live payment processing may vary depending on the registered country or region. For China (CN) entities, registration is supported, but certain payment capabilities (such as merchant onboarding and settlement) may be subject to Google Pay regional eligibility and approval requirements. It is recommended to use a supported region entity (e.g., HK/SG/EU/US) for production payment processing where applicable.
1. Google Pay Developer Account Registration and Configurationβ
- Visit https://pay.google.com/about/business.
- Register using your company's Gmail/Google Workspace.
- Choose a business account.
2. Create Merchant IDβ
- After registration, a Merchant ID will be generated, which can be viewed in Google Pay Console β API access β Merchant Info.
3. Configure Google Pay API Keyβ
- Create a project in the Google Cloud Console.
- Enable Google Pay API for Web/Android.
- Get the API Key.
4. Configure Merchant Domain Verificationβ
- Sign in to Google Developer β Google Pay API β Web integration.
- Add the domain to the allowlist and submit screenshots of the payment flow.
5. Obtain the Payment Tokenβ
After the customer completes the payment authorization, retrieve the Google Pay Payment Token. Please refer to the Google Pay complete example for details.
The pay_accountNumber parameter is used to carry the Google Pay Payment Token obtained from paymentData.paymentMethodData.tokenizationData.token. When submitting a payment request to Oceanpayment, pass the JSON content of the token field from the Payment Token object below as the value of the pay_accountNumber parameter.
{
"apiVersion": 2,
"apiVersionMinor": 0,
"paymentMethodData": {
"type": "CARD",
"description": "Visaββ’β’β’β’β1111",
"info": {
"cardNetwork": "VISA",
"cardDetails": "1111"
},
"tokenizationData": {
"type": "DIRECT",
"token": "{\"signature\":\"MEQCIB...\",\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"...\\\",\\\"ephemeralPublicKey\\\":\\\"...\\\",\\\"tag\\\":\\\"...\\\"}\"}"
}
}
}
6. card_type Mappingβ
When submitting a payment request to Oceanpayment, the card_type parameter is used to identify the card network returned in paymentMethodData.info.cardNetwork. Merchants must map the value of paymentMethodData.info.cardNetwork to a supported Oceanpayment card_type enumeration before submitting the payment request.
paymentMethod.network | card_type |
|---|---|
| VISA | VISA |
| MASTERCARD | MASTERCARD |
| MAESTRO | MAESTRO |
| JCB | JCB |
| ELO | ELO |
| DISCOVER | DISCOVER |
| CHINAUNIONPAY | CHINAUNIONPAY |
| CARTESBANCAIRES | CARTESBANCAIRES |
| AMEX | AMEX |
- Request
-d 'card_type=VISA' \
7. Integrationβ
- Initiate Payment
- Create QuickPay
Submit the Google Pay Payment Token to Oceanpayment via the pay_accountNumber parameter when calling the Server-to-Server Payment API.
The merchantInfo parameter can be configured with an Oceanpayment MID. If required, please contact Oceanpayment Technical Support to obtain the MID. In this case, the Merchant Domain whitelist mentioned in Step 4 will be configured by Oceanpayment developers.
const paymentsClient = new google.payments.api.PaymentsClient({ environment: 'TEST' });
const request = {
apiVersion: 2,
apiVersionMinor: 0,
allowedPaymentMethods: [{
type: 'CARD',
parameters: {
allowedAuthMethods: ['PAN_ONLY', 'CRYPTOGRAM_3DS'],
allowedCardNetworks: ['VISA', 'MASTERCARD'],
},
tokenizationSpecification: {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'oceanpayment',
'gatewayMerchantId': 'oceanpayment',
},
},
}],
merchantInfo: {
merchantName: 'OceanPayment',
merchantId: 'BCR2DN4TWW...',
},
transactionInfo: {
totalPriceStatus: 'FINAL',
totalPrice: '10.00',
currencyCode: 'USD',
},
};
paymentsClient.loadPaymentData(request).then(paymentData => {
const token = paymentData.paymentMethodData.tokenizationData.token;
//Send token to the server for transaction processing.
});
Pass the Payment Token to Oceanpayment through the pay_accountNumber parameter to create a QuickPay ID for subscription-based quick payment scenarios.