Google Pay™
General Information
Google Pay™ is a fast and secure way for one-touch online purchases. A customer of the store can pay with any card saved in his Google account. For merchant this payment will be processed like a regular payment by card.
- If the purchase is made from a mobile device supporting Google Pay, the customer will be asked to confirm the payment using a password, fingerprint or face recognition.
- If the purchase is made from a device without the Google Pay app, the customer can select any saved card in his Google account and confirm payment by passing 3D Secure authentication.
note
All merchants must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
Integration
Mobile Apps
Check out Google Pay Android developer documentation. Ensure that all the required steps of Google Pay Android integration checklist are completed and Google Pay Android brand guidelines is followed.
For accepting payments in the Android mobile apps using the Google Pay payment button, follow these instructions for using the SDK.
Simplified integration (only for web-sites)
For web-sites using the web version of our checkout page, there is no additional configuration or activation required. Just contact account manager of ioka, and we will enable the Google Pay button on your payment form.
Standard integration (only for web-sites)
Standard integration refers to hosting checkout page with Google Pay on merchant's website. To make a payment, you need to receive a payment token from Google Pay and transfer it to the ioka payment gateway.
Before you begin the integration, make sure that:
- You have read with Google Pay API Overview;
- Your web-page supports HTTPS protocol and has a domain-validated TLS certificate;
- One of the following web browsers is being used: Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Edge, Opera, or UCWeb UC.
Upon completion of the integration, you must ensure that:
- You have completed all the required steps of Google Pay Web integration checklist;
- You followed Google Pay Web Brand Guidelines.
Integration steps
- Send a request for a standard Google Pay integration to account-manager of ioka and receive GATEWAY_MERCHANT_ID.
- Integrate Google Pay API following these instructions. During Payment Data Request pass following object to allowedPaymentMethods:
{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["MASTERCARD", "VISA"]
},
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "ioka",
"gatewayMerchantId": "GATEWAY_MERCHANT_ID"
}
}
}
note
In Card Parameters set billingAddressRequired to false as it is not required to process the transaction.
- Implement Google Pay Token Payment Request.
- Test your integration with the Google Pay API and ioka.
- Request production Google Pay access and receive a Google Merchant ID.
- Request production access to ioka API.
Payment Method Token
PaymentMethodToken is signed and encrypted payment methods returned from Google Pay API. Payloads store information about cards that consist of PAN, or tokenized cards that consist of device PAN and cryptograms.
Payment Data Response is a UTF-8 encoded, serialized JSON object with the following structure:
{
"protocolVersion":"ECv2",
"signature":"MEQCIH6Q4OwQ0jAceFEkGF0JID6sJNXxOEi4r+mA7biRxqBQAiAondqoUpU/bdsrAOpZIsrHQS9nwiiNwOrr24RyPeHA0Q\u003d\u003d",
"intermediateSigningKey":{
"signedKey": "{\"keyExpiration\":\"1542323393147\",\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\\u003d\\u003d\"}",
"signatures": ["MEYCIQCO2EIi48s8VTH+ilMEpoXLFfkxAwHjfPSCVED/QDSHmQIhALLJmrUlNAY8hDQRV/y1iKZGsWpeNmIP+z+tCQHQxP0v"]
},
"signedMessage":"{\"tag\":\"jpGz1F1Bcoi/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\\u003d\",\"ephemeralPublicKey\":\"BJatyFvFPPD21l8/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\\u003d\",\"encryptedMessage\":\"mKOoXwi8OavZ\"}"
}
note
More information about payment method token structure can be found here.
This object is expected to be passed to "google_pay" parameter of payment request.
One-click Payment Request
This method is used for creating order and immediate initiating payment with Google Pay.
Request:
amount
- order amount in minor monetary units (e.g. in tiyns, 1/100 of tenge)tool_type
- "GOOGLE_PAY"google_pay
- payment method token received from the Google Pay API on a web-site or app- other parameters optional, but may help describe order and payment process
- HTTP
- cURL
- Python
- PHP
POST /v2/orders/tool HTTP/1.1
Host: stage-api.ioka.kz
Content-Type: application/json
Content-Length: 547
{
"amount": 500,
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
curl --location --request POST 'https://stage-api.ioka.kz/v2/orders/tool' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 500,
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
'
import requests
import json
url = "https://stage-api.ioka.kz/v2/orders/tool"
payload = json.dumps({
"amount": 500,
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://stage-api.ioka.kz/v2/orders/tool');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"amount": 500,
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
Response:
info
To complete the payment for card with 3D Secure authentication you need to redirect a customer to the url specified in the corresponding parameter of action field.
After completing authentication customer will be redirected to the payment form, and you will be notified with webhook containing payment data.
- 3DS
- No 3DS
- 400
- 404
- 409
{
"id": "pay_test",
"order_id": "ord_test",
"status": "REQUIRES_ACTION",
"created_at": "2022-06-20T00:00:00.000000",
"approved_amount": 0,
"captured_amount": 0,
"refunded_amount": 0,
"processing_fee": 0,
"tds": true,
"payer": {
"pan_masked": "411111******1111",
"expiry_date": "12/24",
"holder": "holder",
"payment_system": null,
"emitter": null,
"email": null,
"phone": null,
"customer_id": null,
"card_id": null,
"iin": null
},
"acquirer": null,
"error": null,
"action": {
"url": "https://api.ioka.kz/v2/pay_test/check3ds"
}
}
{
"id": "pay_test",
"order_id": "ord_test",
"status": "CAPTURED",
"created_at": "2022-06-20T00:00:00.000000",
"approved_amount": 500,
"captured_amount": 500,
"refunded_amount": 0,
"processing_fee": 12.5,
"tds": false,
"payer": {
"pan_masked": "559999******9999",
"expiry_date": "12/24",
"holder": "holder",
"payment_system": null,
"emitter": null,
"email": null,
"phone": null,
"customer_id": null,
"card_id": null,
"iin": null
},
"acquirer": {
"name": "epay_v2",
"reference": "111111111111"
},
"error": null,
"action": null
}
{
"code": "InvalidPaymentToken",
"message": "Неверный платежный токен."
}
{
"code": "ShopConfigNotFound",
"message": "Конфигурации магазина не найдены."
}
{
"code": "OrderExists",
"message": "Заказ с указанным external_id уже существует."
}
Standard Payment Request
This method is used for initiating payment with Google Pay for pre-created order.
Request:
order_id
- id of pre-created order (e.g. ord_a1b2c3d4e5)
tool_type
- "GOOGLE_PAY"google_pay
- payment method token received from the Google Pay API on a web-site or app
- HTTP
- cURL
- Python
- PHP
POST /v2/orders/{order_id}/payments/tool HTTP/1.1
Host: stage-api.ioka.kz
Content-Type: application/json
Content-Length: 547
{
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
curl --location --request POST 'https://stage-api.ioka.kz/v2/orders/{order_id}/payments/tool' \
--header 'Content-Type: application/json' \
--data-raw '{
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
'
import requests
import json
url = "https://stage-api.ioka.kz/v2/orders/{order_id}/payments/tool"
payload = json.dumps({
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://stage-api.ioka.kz/v2/orders/{order_id}/payments/tool');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"tool_type": "GOOGLE_PAY",
"google_pay": {
"signature": "ME...",
"intermediateSigningKey": {
"signedKey": "{\"keyValue\":\"MF\...\",\"keyExpiration\":\"16...\"}",
"signatures": ["ME..."]
},
"protocolVersion": "ECv2",
"signedMessage": "{\"encryptedMessage\":\"oT...\",\"tag\":\"sm...\"}"
}
}
');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Content-Type' => 'application/json'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
Response:
info
To complete the payment for card with 3D Secure authentication you need to redirect a customer to the url specified in the corresponding parameter of action field.
After completing authentication customer will be redirected to the payment form, and you will be notified with webhook containing payment data.
- 3DS
- No 3DS
- 400
- 404
- 409
{
"id": "pay_test",
"order_id": "ord_test",
"status": "REQUIRES_ACTION",
"created_at": "2022-06-20T00:00:00.000000",
"approved_amount": 0,
"captured_amount": 0,
"refunded_amount": 0,
"processing_fee": 0,
"tds": true,
"payer": {
"pan_masked": "411111******1111",
"expiry_date": "12/24",
"holder": "holder",
"payment_system": null,
"emitter": null,
"email": null,
"phone": null,
"customer_id": null,
"card_id": null,
"iin": null
},
"acquirer": null,
"error": null,
"action": {
"url": "https://api.ioka.kz/v2/pay_test/check3ds"
}
}
{
"id": "pay_test",
"order_id": "ord_test",
"status": "CAPTURED",
"created_at": "2022-06-20T00:00:00.000000",
"approved_amount": 500,
"captured_amount": 500,
"refunded_amount": 0,
"processing_fee": 12.5,
"tds": false,
"payer": {
"pan_masked": "559999******9999",
"expiry_date": "12/24",
"holder": "holder",
"payment_system": null,
"emitter": null,
"email": null,
"phone": null,
"customer_id": null,
"card_id": null,
"iin": null
},
"acquirer": {
"name": "epay_v2",
"reference": "111111111111"
},
"error": null,
"action": null
}
{
"code": "InvalidPaymentToken",
"message": "Неверный платежный токен."
}
{
"code": "ShopConfigNotFound",
"message": "Конфигурации магазина не найдены."
}
{
"code": "OrderExists",
"message": "Заказ с указанным external_id уже существует."
}