Google Pay
Accept Google Pay on S2S with type GOOGLE_PAY — pass the client wallet token in data.token.
Google Pay
Version: 3.0.0
Generate API Key for S2S channel. Navigate to Developers → API Keys → Add new API key → Select S2S in the Channel Dropdown. IP whitelist applies.
Google Pay lets customers pay with cards or payment methods saved in their Google account. On S2S, your Android app or website collects the Google Pay token on the client; your server sends that token to PayOrc with type: "GOOGLE_PAY" — you never handle raw card number or CVV.
When to use
- Native Android checkout with Google Pay button
- Web checkout using Google Pay API for Web
- Customers who prefer Google’s saved payment methods over manual card entry
How it works
- Customer authorizes payment in Google Pay on the device.
- Your client receives the Google Pay
paymentMethodDatatoken object. - Your server calls
POST /s2s/v1/paymentwithclass: "ECOM",type: "GOOGLE_PAY", and the token indata.token(plus standard order fields). - PayOrc processes the payment using your merchant MID and routing configuration.
- Direct success — webhook-shaped response when payment completes immediately.
- 3DS redirect — if authentication is required, response includes
data.redirect_url(order_status: AWAIT_3DS). Redirect the customer to complete 3DS; final status arrives via webhook.
Use data.token for the Google Pay object. Do not use card_details or top-level payment_token. Google Pay must be enabled on your merchant MID for the order currency.
Endpoint
| Method | URL |
|---|---|
| POST | https://api.payorc.com/s2s/v1/payment |
Please use the test credentials for sandbox testing.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
merchant-key | String | Yes | Your merchant API key |
merchant-secret | String | Yes | Your merchant API secret |
Content-Type | String | Yes | Must be application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
data.action | String | Yes | SALE or AUTH |
data.class | String | Yes | Must be ECOM |
data.capture_method | String | Yes when AUTH | AUTOMATIC or MANUAL |
data.type | String | Yes | Must be GOOGLE_PAY |
data.token | Object | Yes | Google Pay token from the client SDK |
data.customer_details | Object | Yes | Same as S2S Payment |
data.order_details | Object | Yes | m_order_id, amount, currency, return_url, etc. |
data.items | Array | Yes | Line items |
data.billing_details | Object | Yes | Billing address |
data.shipping_details | Object | Yes | Shipping address |
data.urls | Object | No | Redirect and webhook URLs — see S2S Payment URLs |
Do not send card_details with GOOGLE_PAY. Only data.token is used for the wallet payload.
Example request
{
"data": {
"action": "SALE",
"class": "ECOM",
"capture_method": "AUTOMATIC",
"type": "GOOGLE_PAY",
"customer_details": {
"m_customer_id": "1234",
"name": "John Doe",
"email": "[email protected]",
"mobile": "9876543210",
"code": "971"
},
"order_details": {
"m_order_id": "ORD-GPAY-001",
"amount": "100",
"currency": "AED",
"convenience_fee": "0",
"description": "Google Pay order",
"return_url": "https://merchant.example.com/return"
},
"items": [
{
"title": "Product",
"quantity": 1,
"unit_price": "100.00",
"discount_amount": "0.00",
"is_refundable": true
}
],
"billing_details": {
"address_line1": "Po Box 12322",
"address_line2": "",
"city": "Dubai",
"province": "Dubai",
"country": "AE",
"pin": "54044"
},
"shipping_details": {
"shipping_name": "John Doe",
"shipping_email": "[email protected]",
"shipping_code": "971",
"shipping_mobile": "9876543210",
"address_line1": "Po Box 12322",
"address_line2": "",
"city": "Dubai",
"province": "Dubai",
"country": "AE",
"pin": "54044",
"shipping_currency": "AED",
"shipping_amount": "0"
},
"token": {
"apiVersion": 2,
"apiVersionMinor": 0,
"paymentMethodData": {
"description": "Visa •••• 1234",
"tokenizationData": {
"type": "PAYMENT_GATEWAY",
"token": "GOOGLE_PAY_TOKEN_JSON_STRING"
},
"type": "CARD"
}
},
"urls": {
"success": "",
"cancel": "",
"failure": "",
"webhook_url": "https://merchant.example.com/webhook"
}
}
}Response types
Direct success and 3DS redirect both use the S2S envelope (status, code, message, data). The data object is webhook-shaped — see Webhook notifications for the full field list.
Direct success (no 3DS)
When payment completes immediately, data.order_status is CAPTURED (for SALE) or AUTHORISED (for AUTH). data.status is always SUCCESS on a successful payment.
{
"status": "success",
"code": "00",
"message": "Payment completed successfully.",
"data": {
"action": "CAPTURE",
"status": "SUCCESS",
"status_code": "00",
"order_status": "CAPTURED",
"m_order_id": "ORD-GPAY-001",
"p_order_id": "1000015110",
"p_request_id": "1000015201",
"psp_ref_id": "8902218",
"transaction_id": "1000021942",
"is_live": false,
"currency": "AED",
"amount": "100.00",
"payment_method": "GOOGLE_PAY",
"apm_name": "GOOGLE_PAY",
"apm_identifier": "google_pay",
"customer_details": {
"name": "John Doe",
"email": "[email protected]",
"code": "971",
"mobile": "9876543210",
"m_customer_id": "1234"
}
}
}3DS redirect
When authentication is required, data.order_status is AWAIT_3DS, data.action is AWAIT_3DS, and data.redirect_url points to the PayOrc checkout page for the customer to complete 3DS:
{
"status": "success",
"code": "00",
"message": "Redirection URL generated successfully",
"data": {
"action": "AWAIT_3DS",
"status": "SUCCESS",
"order_status": "AWAIT_3DS",
"m_order_id": "ORD-GPAY-001",
"p_order_id": "1000015110",
"p_request_id": "1000015201",
"transaction_id": "1000021942",
"currency": "AED",
"amount": "100.00",
"payment_method": "GOOGLE_PAY",
"apm_name": "GOOGLE_PAY",
"apm_identifier": "google_pay",
"redirect_url": "https://checkout.payorc.com/s2s/payment/{checkout_token}"
}
}Redirect the customer to data.redirect_url. Final status is delivered via webhook when payment completes.
Response fields (key)
| Field | Description |
|---|---|
status | API envelope: success or failed |
code | Response code (e.g. 00) |
message | Payment completed successfully. or Redirection URL generated successfully |
data.status | SUCCESS when the request was accepted (including AWAIT_3DS) |
data.order_status | CAPTURED, AUTHORISED, AWAIT_3DS, or FAILED |
data.transaction_id | PayOrc transaction ID (string) |
data.redirect_url | Present only for 3DS redirect flow |
data.apm_name | GOOGLE_PAY |
Common errors
| Message | Cause |
|---|---|
token is missing or not a valid object for GOOGLE_PAY | Missing or invalid data.token |
card_details is not required for GOOGLE_PAY | Sent card_details with wallet type |
| Google Pay integration is not configured | Google Pay not enabled on merchant MID |