Google Pay Integration Guide
1. Introduction
Google Pay™ is the fast, simple way that allows you to make card payments without entering card details for each payment. The card data is safely stored by Google. This payment method is available for all devices (mobile phones and computers), regardless of the operating system and web browser.
2. Connection via Portmone.com page
Preconditions
-
You should sign an agreement with Portmone.com.
-
You need to agree with Google Pay Terms of Service.
Description
With this connection method, you do not need to perform additional integrations. The Google Pay button will be displayed on Portmone.com payment page. You can manage payment methods and the order in which the payment instruments (including Google Pay) are displayed using JSON-request (see section 3.2 of documentation) or contacting the cooperation manager.

3. Connection with Google Pay API
Preconditions
- You should register with Google Pay API.
- Your website should use HTTPS and support TLS protocol.
- To integrate your website or mobile application with the Google Pay, proceed according to the following instructions:
• API documentation:
b) for website
• Brand guidelines
b) for website
How it works?

- You request the encrypted payment data from your application.
- Google Pay returns the encrypted data after buyer authentication.
- You send the encrypted payment data to your server.
- You send an JSON-request to Portmone.com containing the encrypted data.
- We send you the payment response
- You inform the buyer of the outcome
How to integrate the Google Pay method?
Step 1. Use Google Pay API to get PaymentData.
Settings parameters:
a. allowPaymentMethods : CARD
b. tokenizationSpecification = { "type": "PAYMENT_GATEWAY"}
allowedCardNetworks = ['MASTERCARD', 'VISA'];
allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];
c. gateway = portmonecom
d. gatewayMerchantId - A unique identifier of the online shop. Assigned to each partner individually when connected to the Portmone.com system.
An example of dataset returned by Google Pay:
{
"apiVersionMinor":0,
"apiVersion":2,
"paymentMethodData":{
"description":"Mastercard •••• 5179",
"tokenizationData":{
"type":"PAYMENT_GATEWAY",
"token":{"signature":"MEYCIQC+IHxUu9Wwra2Vu6tBa2wJPCMT3pWtN1VphLGYtNVLLwIhAOkdbNje//eLrXVc+n6LOlc4PqxWOUcqwrmki/CNA1ur","intermediateSigningKey":{"signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwhRrvGB0kZ1248MEJAPwX0YfrQInhyyRM7nyGFjQuzGSViZG3QC9NMvXR9Zd6uVcVzAz+6K/+NEGIWbX8zbk6A\\u003d\\u003d\",\"keyExpiration\":\"1571208568000\"}","signatures":["MEUCIQCR6vIEiyHB8qmlho4/tLd7W8CIGrZDJlCI48CBHeFPvQIgLZJIe4cZv6pYtYYa56QCI/vvg1GqXTP3bTBjO49r5mI\u003d"]},"protocolVersion":"ECv2","signedMessage":"{\"encryptedMessage\":\"k85CGUMmd5PaGmQlHFqHc0HrDZmjM1yG82rFB/p31ZyUleN5nihzjOZif/BKXwg3XA2oLXqBSSWcAdfZwXxCEOqvAQE+kpTC7qVO4wTPip6RruraT6vO9M9FtIf0kcqzYSAN7pl1SUA5jC9rHrqucPoh0/FSspup78SWBt8TnmVKC9O3sQhIZ3SMoGOG4mdjtIrgCwWH2cbrxUH0dHAqOe5ANGOY/mII4nTEp7xaKu41hK/kFE15zVyqgPJXP9bPxzMVk/ozEZSfhSzVTS+9stjkU/kT5EibKB3O1bbxyybKcGQ5vxBOtNOBKKd/NuqNmN2eEK3UbSKb1M3gv45gT9cCeEvlzO7Wg0N100vUBp9RPDN9TH4tj4w578sWFKfTi6FsSrZB27SGWcU0EaKHO9buo94mRBY5yqffF3bKg5mAMPzjDhyHSujqWKAs9C5fBzMEuEr2z7A23kfLqBceH5uS9LJMiZ/yVKCwfpY9u2XyCjKdp7I\\u003d\",\"ephemeralPublicKey\":\"BAMDAtfgcPNuzItrwGLigGj3rtxmyHhZLwx1B4RJZ2oo11jpFf3SA6a3utryCMmlCEcqLfLn6WDH2ArrNBGn+Ew\\u003d\",\"tag\":\"T/qhZ/XY5/3Fe4QBKafm6NqS6EzwVeiKXhRlp8NeWrA\\u003d\"}"}
},
"type":"CARD",
"info":{
"cardNetwork":"MASTERCARD",
"cardDetails":"5179"
}
}
}
The data obtained from token should be send to the API Portmone.com using gPayToken request parameter.
Important: The cryptogram obtained from Google Pay must be used only once within a single transaction. Reusing the same cryptogram may result in the payment being declined by the acquiring bank. A new cryptogram must be obtained from Google Pay for each new transaction.
Method: GPay
URL: https://www.portmone.com.ua/r3/api/gateway.
Request parameters:
| Parameter | Description | Required |
|---|---|---|
| login | The Online Store login to access account management | Yes |
| password | The Online Store password | Yes |
| gPayToken | Token received from the Google Pay system | Yes |
| payeeId | A unique identifier of the Online Store. Assigned to each Partner individually when connected to the Portmone.com system | Yes |
| billAmount | Amount of the payment. The decimal separator is the dot symbol. For example: "10.21" | Yes |
| description | Payment description (comment to the order / payment details) | No |
| shopOrderNumber | Number of paid order (bill) in the Online Store system | No |
| emailRecipient | E-mail address of the client | No |
| preauthFlag | Payment pre-authorization flag (value "Y" indicates that this payment is carried out using the pre-authorization procedure, value "N" is a regular payment without pre-authorization) | No |
| billCurrency | Currency of the payment. Possible values: UAH (default value), USD, EUR, GBP, KZT | No |
| shop_site_id | Payment channel in the Portmone system | No |
| threeDs | Section of parameters used to specify the merchant URL (termUrl or appUrl) to which the client will be redirected after successfully passing the 3D Secure check | No |
| termUrl | Set "Y" or not use this parameter | No |
| appUrl | An appUrl of the merchant (when integrating mobile application with Google Pay) | No |
| clientIp | The value of the IP address of the payer | No |
An example of request:
{
"method":"GPay",
"params": {
"data":{
"login":"wdishop",
"password":"wdi451",
"gPayToken":{"signature":"MEUCIQD+9/PnFvB+Lo6d/eHpgqQrMvmRDZdW1AcjQKavHrcPmQIgeVjR1hXqH7hkCn+VZqx/kjdofMIYbyL15Xp52mR9+2s\u003d","intermediateSigningKey":{"signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBOHyOhwWk6SK5nqhFBBI1hSvWHAaOO0Ukbrl56zx7fPNttFFKs2U10f6EWbdhULrv4QT4qMNbyVAq8ig1jdsYA\\u003d\\u003d\",\"keyExpiration\":\"1570945959000\"}","signatures":["MEYCIQCe6t42U5OemtGGdYC6npBNbVxe1HbTF8pUkSD7mO+CWAIhAI/0M/XQuW6i8reT0LCNHKoNfgWYwOWHBoj2wpZdgKHh"]},"protocolVersion":"ECv2","signedMessage":"{\"encryptedMessage\":\"U9ChAIukmQ85TdZKAU/26mJUwUt3cVpJmx/JtFi350F/KiRNiIEGi1CmkgVe+ohzikkKLo37Ty3YQjyjVHNTHmF3AyNVTIJCL7qYybt+aFNI1XFlpv3ArWU+fH8Bi190tl7lLyyeNjWx8L402spsLpuUe9OLLjazIq0Vfjw3wRZ2B2+ybUrnoz5Iydapn8B7c/QqR7w53n6svIK58q7eL159Ano0GyfLpUOLLQ949MhP1ze***UzapUGtMd0k0c/4Nnkfs2TnN6ETEtP8y9J29hYKGVOCo79rRSN2xLsYXGNawIiPc6082HWB82JyuW2bfWAL1R0W+2iql2dBWY\\u003d\",\"ephemeralPublicKey\":\"BPYYpVT5INyXSwoNbP/HuGkjQnfnUwUPMH2bCp6Od3EoihnegFZObjP0IVvDA5YfNlLDJjHutBDj30GW5Fei8xw\\u003d\",\"tag\":\"qt4FcCGO4rp969CBBTPJ0nhAeQeR+rOM0FmXk8DdGLQ\\u003d\"}"},
"payeeId":"1185",
"billAmount":"10.21",
"description":"test payment",
"shopOrderNumber":"123456",
"attribute1":"1",
"attribute2":"2",
"attribute3":"3",
"attribute4":"4",
"emailRecipient":"[email protected]",
"billCurrency":"UAH",
"preauthFlag":"N",
"shop_site_id" : "",
"threeDs":{
"termUrl":"Y",
"appUrl":"https://portmone2.com/r3/ecommerce/test/master-test-from"
},
"clientIp": "127.0.0.7"
}
},
"id": "1"
}
Response parameters:
| Parameter | Description |
|---|---|
| status | The result of payment. Possible values: - PAYED – successful payment, - REJECTED – rejected, - CREATED – order created, but not paid |
| errorCode | Error code. If the parameter value is "0", this means that the payment was successful or additional verification is required (see the value of the isNeed3Ds parameter). If the parameter value is greater than 0 or empty, an error has occurred |
| error | Error description. See Error codes table |
| shopBillId | A unique identifier (ID) assigned to each transaction (payment document) in the Portmone.com system |
| billAmount | The transaction amount sent in the request |
| billNumber | Number of an order (bill) in the Online Store system. Maximum length is 120 symbols |
| attribute1 | Service field. Filled at company’s discretion |
| attribute2 | Service field. Filled at company’s discretion |
| attribute3 | Service field. Filled at company’s discretion |
| attribute4 | Service field. Filled at company’s discretion |
| cardMask | Payer’s card mask or token mask |
| actionMPI | The card issuing bank page URL to which client should be redirected to confirm payment with 3D Secure |
| pareq | Parameter which should be sent to actionMPI for 3D Secure check |
| authCode | Bank authorization code |
| description | Comment to the order / description of payment details. Maximum length is 250 symbols |
| lang | Errore message languge. Depends on the localization of the endpoint you requested* |
| md | Parameter which should be sent to actionMPI for 3D Secure check |
| isNeed3DS | 3DS-authorization flag ("Y" - 3D Secure check is required, "N" - no additional actions required) |
| token | Token value for subsequent payments. For payment methods GPay and APay token is not generated |
| billCurrency | Currency of the payment |
| transactionId | Transaction ID in the acquiring bank system |
| termUrl | URL of the merchant site to which the issuing bank returns a response message after passing 3D Secure. The value is generated by the Portmone system |
| successUrl | appUrl of the merchant site to which the issuing bank returns a response message after passing 3D Secure (if this value was passed in the appUrl parameter of the payment request) |
| pdfUrl | Link to save payment receipt. Provided to the client if status=PAYED |
| shop_site_id | Payment channel in the Portmone system |
Note: * – to receive localized error texts, you should send a request to the appropriate endpoint:
https://www.portmone.com.ua/r3/api/gateway – default is Ukrainian https://www.portmone.com.ua/r3/uk/api/gateway – for messages in Ukrainian https://www.portmone.com.ua/r3/en/api/gateway – for messages in English
An example of successful response:
{
"result": {
"status": "PAYED",
"errorCode": "0",
"error": "",
"shopBillId": "550298815",
"billAmount": "1.01",
"billNumber": "SHP-00000002",
"attribute1": "",
"attribute2": "",
"attribute3": "",
"attribute4": "",
"cardMask": "535560******3735",
"actionMPI": "",
"pareq": "",
"authCode": "67037Z",
"description": "test payment",
"lang": "uk",
"md": "",
"isNeed3DS": "N",
"token": "",
"billCurrency": "UAH",
"transactionId": "927500948048",
"pdfUrl": "https://www.portmone.com.ua/r3/services/receipts/get-receipts/shop-bill-id/35357a20f10b49519794e81b48b20d0402cd2b7654553048021cb230400befdf94bacfbb12bd77983adae9422fbcc51cf0987a171403f08b33b2d119249845bad4e457",
"shop_site_id" : ""
},
"id": "1"
}