Google Pay
1 Introduction
Google Pay™ (formerly Android Pay) is a digital wallet, which enables simple and fast card payments, without the need to enter the card data for each payment. The card data is safely stored by Google. This payment method is available for all devices (mobile phones and computers), irrespective of the operating system and web browser.
In case of Google Pay usage, Acceptor is obligated to comply with the provisions of the following regulations.
Note: the description below applies to provision of this service directly by displaying the Google Pay lightbox at the website of payment recipient (e-store) or in the mobile application. |
If you wish to offer this method via upc.ua hosted payment page, no additional integration effort is required.
2. Prerequisites and limitations
To enable Google Pay with In-App Payments SDK on Android, the following must be true:
- You have followed the instructions in the In-App Payments: Build on Android guide. This guide does not cover the general setup of In-App Payments SDK.
- for UPC SDK requires android version 4.0.3 (api level 15) and higher.
- You have read, and will adhere to, Google Pay API Terms of Service, Google Pay API Acceptable Use Policy, and Google's brand guidelines.
- The Google Pay app must be installed on the Android devices that your app is distributed to.
- The device user must have added a Square-supported payment method to Google Pay.
- Google Pay for the In-App Payments SDK is only available for Square merchants based in the Ukraine, Croatia, Serbia, Kosovo, Albania, Bosnia, Austria.
Google Pay requirements
Please, ensure that you use approved branding (e.g. buttons and assets) as provided by either Google Pay Android brand guidelines or Google Pay Web brand guidelines when
- creating a payment button on your site
- creating a payment button in your application layout
- referencing Google Pay on your site, in a mobile application, when communicating with the clients
UPC supports the following values of parameters for every settlement region:
const allowedCardNetworks = ["MASTERCARD", "VISA"];
const allowedCardAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];
Pay attention, that BillingAddressParameters parameter is optional.
If you do not use SDK please define values for gatewayMerchantId and gatewayID parameters explicitly:
gatewayMerchantId: <your merchant_id>
gatewayID: upcua
Google Pay activation instructions for direct integration
If you prefer to integrate directly against the Google Pay API, follow Google’s instructions.
3 Integration
Google Pay activation instructions for direct integration
If you prefer to integrate directly against the Google Pay API, follow Google’s instructions.
- Obtain the payer encrypted payment data returned by Google Pay.
- Submit the encrypted payment data to your server.
- Resend encrypted payment data from your server to UPC payment API endpoint https://secure.upc.ua/go/service/02 in parameter <TAVV> (see specifications)
- Obtain payment final response from UPC server with order details
- Inform payer about payment result
2.1 Web integration
To integrate the website with the Google Pay method, proceed according to the instructions placed at this website:
- API documentation: https://developers.google.com/pay/api/web
- Brand guidelines: https://developers.google.com/pay/api/web/guides/brand-guidelines
The gateway parameter in the script should have the constant value of upcua, according to the example below:
type: 'PAYMENT_GATEWAY' , parameters: { 'gateway' : 'upcua' , 'gatewayMerchantId' : '[Point of Service Id (pos_id)]' } }; |
The value of the gatewayMerchantId parameter should be the identifier of the payment point where the order is made.
Please note that upcua as the processor of Google Pay payments enables the handling of all types of payment cards issued by the Visa and MasterCard organizations (including Maestro). This implies the following configuration of the Google script:
const allowedCardNetworks = [ 'MASTERCARD' , 'VISA' ];
const allowedCardAuthMethods = [ 'PAN_ONLY' , 'CRYPTOGRAM_3DS' ]; |
In response, Google shall return the PaymentData item, and the field paymentMethodData.tokenizationData.token shall contain a safely encrypted Google Pay Token (a string of characters).
A sample Google Pay Token looks like this:
{
"signature" : "MEUCIQDY3wBQyHB4sZcktRoJXKxm+OLcjHzCvdDeGn23oX0kkwIgKznRFZZL+sDMv1b5cuD+YurXMZraYBsr9hbravVY5Ro\u003d" , "protocolVersion" : "ECv1" , "signedMessage" : "{\"encryptedMessage\":\"cI87tLqzqTGyCFnMMCVWcTHw3xhYIK+CEnuQ74K+nlLpCgOlfpScib9jds4sxDtN6CunCqCSMfd/3yHeeRy6aCx1yyqcT4ey6NueeBznprJpkmVVgI1JHWLQt4hzAXMUAcYASYLOabKP9fUZvHkOBDytD531jpzNXa+Spc/zrpGzFKx2C4VU9sC95q9i+ey+kr7ZMNVCOFJPWXu7lKZ105IOOqozJ6/70MKmxP3jM89eeq+/19QnyHjQLXfnQPvQjiUJKGCcRKDLlrb3XoY5ZUUzGfN5eZCLzCVg0hWEbwU+6J7KWYJyW+Wr1r8bagN9zWsrMKhDpsQbHfyzb+yBzFUoxeUgL4a7FeVvEllIcHtqsvTCf6FENV20aF5VLDv5qzUkV+PzTAIbFEuabA0God9UbVCVVv7nM8QFzvRPhzYYFVFTn4JHvL2qZ4pAR9lE+w\\u003d\\u003d\",\"ephemeralPublicKey\":\"BPHLC4sBHpenY1M0ixmiDMuWJTaTJOqggRUwtgBJMcBp28VsxHD7zPI7985x4F5EjMP5y8j/cuUzbe/cGPjOKGk\\u003d\",\"tag\":\"RaXrPOUuc5iw3oxDa0C2MOjaKxgxIRQvwOspmtFV0zU\\u003d\"}" } |
Gateway adress: GOOGLE https://secure.upc.ua/go/payByWallet
{
header:"….base64 encoded data….",
payload:" ….base64 encoded data…. ",
signature:" ….base64 encoded $signature …."}
Payload structure (required fields highlighted)
{
"MerchantID":"${mid}",
"TerminalID":"${tid}",
"OrderID":"${oid}",
"TotalAmount":"$totalAmount",
"Currency":"${curr}",
"PurchaseTime":"${purchaseTime}",
"Wallet":"GOOGLE_PAY",
"WalletData":"${walletData}",
"PurchaseDesc":"${purchaseDesc}",
"Ref3":"${ref3}",
"Recurrent":"${recurrent}"
}
3.2 Android integration
To integrate the mobile application with the Google Pay method, proceed according to the instructions placed at this website:
- API documentation: https://developers.google.com/pay/api/android
- Brand guidelines: https://developers.google.com/pay/api/android/guides/brand-guidelines
To make the integration easier, use the technical documentation for the upc.ua SDK.
4 Order
To charge the payment card stored under Google Pay, in the request OrderCreateRequest place an extended item of payMethods.
The item payMethods.payMethod must contain the authorizationCode field, whose value is the GooglePay Token parameter, coded with the Base64 function. The field payMethod.value should have the ap value, and the field payMethod.type - the PBL value.
"payMethods" : {
"payMethod" : { "value" : "ap" , "type" : "PBL" , "authorizationCode" : "eyJzaWduYXR1cmUiOiJNRVVDSVFEWTN3QlF5SEI0c1pja3RSb0pYS3htK09MY2pIekN2ZERlR24yM29YMGtrd0lnS3puUkZaWkwrc0RNdjFiNWN1RCtZdXJYTVpyYVlCc3I5aGJyYXZWWTVSb1x1MDAzZCIsInByb3RvY29sVmVyc2lvbiI6IkVDdjEiLCJzaWduZWRNZXNzYWdlIjoie1wiZW5jcnlwdGVkTWVzc2FnZVwiOlwiY0k4N3RMcXpxVEd5Q0ZuTU1DVldjVEh3M3hoWUlLK0NFbnVRNzRLK25sTHBDZ09sZnBTY2liOWpkczRzeER0TjZDdW5DcUNTTWZkLzN5SGVlUnk2YUN4MXl5cWNUNGV5Nk51ZWVCem5wckpwa21WVmdJMUpIV0xRdDRoekFYTVVBY1lBU1lMT2FiS1A5ZlVadkhrT0JEeXRENTMxanB6TlhhK1NwYy96cnBHekZLeDJDNFZVOXNDOTVxOWkrZXkra3I3Wk1OVkNPRkpQV1h1N2xLWjEwNUlPT3Fveko2LzcwTUtteFAzak04OWVlcSsvMTlRbnlIalFMWGZuUVB2UWppVUpLR0NjUktETGxyYjNYb1k1WlVVekdmTjVlWkNMekNWZzBoV0Vid1UrNko3S1dZSnlXK1dyMXI4YmFnTjl6V3NyTUtoRHBzUWJIZnl6Yit5QnpGVW94ZVVnTDRhN0ZlVnZFbGxJY0h0cXN2VENmNkZFTlYyMGFGNVZMRHY1cXpVa1YrUHpUQUliRkV1YWJBMEdvZDlVYlZDVlZ2N25NOFFGenZSUGh6WVlGVkZUbjRKSHZMMnFaNHBBUjlsRSt3XFx1MDAzZFxcdTAwM2RcIixcImVwaGVtZXJhbFB1YmxpY0tleVwiOlwiQlBITEM0c0JIcGVuWTFNMGl4bWlETXVXSlRhVEpPcWdnUlV3dGdCSk1jQnAyOFZzeEhEN3pQSTc5ODV4NEY1RWpNUDV5OGovY3VVemJlL2NHUGpPS0drXFx1MDAzZFwiLFwidGFnXCI6XCJSYVhyUE9VdWM1aXczb3hEYTBDMk1PamFLeGd4SVJRdndPc3BtdEZWMHpVXFx1MDAzZFwifSJ9" } } |
Further processing of the request is subject to the standard process, which is described under REST API.
Please note that it may be necessary to handle a redirect of the request to the 3D Secure authentication page. |
As the orders paid with the Google Pay method shall be settled just as standard card payments, it is worth considering the integration of the service transaction data retrieve. In this manner, you will be able to differentiate cards entered through the upc.ua form from cards downloaded from Google Pay.
5 Error codes in Google Pay
List of standard errors returned by Google Pay lightbox can be found on the Google Developers site.
In addition following errors may occur:
- "Nieoczekiwany błąd po stronie programisty - spróbuj ponownie później" - returned e.g. if parameter
environment
is specified as "PRODUCTION" for POS from the Sandbox environment.
6 Sandbox
The Google Pay payment method is available also under the Sandbox environment – during the integration process, openly indicate the test environment:
var paymentsClient = new google.payments.api.PaymentsClient({environment: 'TEST' }); |
As Google Pay is not the default payment method, please contact our ecommerce team after registration in the Sandbox environment, but before commencing integration with the use of the Google Pay method.