Skip to main content
Version: 1.0.0

GooglePay

A better way to pay, by Google

Google Pay™ is the fast, simple way to pay on sites, in apps, and in stores using the cards saved to your Google Account. It protects your payment info with multiple layers of security and makes it easy to send money, store tickets, or cash in on rewards – all from one convenient place.

Connecting Google Pay via ProcardPay Hosted Checkout Page

To connect, you need:

  1. Signup in ProcardPay service and sign a contract with ProcardPay.
  2. Your must adhere to the Google Pay APIs Acceptable Use Policy and agree to the Google Pay Terms of Service.

Description

With this connection method, there is no need to carry out any additional integration. The Google Pay button will be displayed on the ProcardPay payment page.

An example of a payment form with the Google Pay method. Моя картинка

Connection with Google Pay API

Description

This method is most suitable for customer convenience. It allows you to connect directly, without redirecting to the ProcardPay payment form, and accept payments directly from your site or application.

How to connect?

  • To complete branding requirements
  • Check compliance integration checklist:
  • Pass the check - send the assembly of the mobile application or a link to the website with a payment page.

    How does it work?

gpayDiagram

  1. You request the encrypted payment data from your application.
  2. Google Pay returns the encrypted data after buyer authentication.
  3. You send the encrypted payment data to your server.
  4. You send an JSON-request to ProcardPay containing the encrypted data.
  5. We send you the payment response
  6. You inform the buyer of the outcome

How to integrate Google Pay?

For integration use Google Pay Android developer documentation or Google Pay Web developer documentation.

Configuration parameters

  1. allowPaymentMethods : CARD
  2. tokenizationSpecification = {"type": "PAYMENT_GATEWAY"}
  3. allowedCardNetworks = ['MASTERCARD', 'VISA'];
  4. allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];
  5. gateway = concordpay
  6. gatewayMerchantId - unique merchant identifier. Issued to each partner when connected to ProcardPay.

If the payer confirms the payment, the callback will return the data to the processPayment function, which will need to be sent payment data and encrypted data in the GooglePayPurchase payment method request

Example:

{
"apiVersionMinor":0,
"apiVersion":2,
"paymentMethodData":{
"description":"Mastercard •••• 6812",
"tokenizationData":{
"type":"PAYMENT_GATEWAY",
"token":{"signature":"MEYCIQC+IHxUu9Wwra2Vu6tBa2wJ1VphLGYtNVLLwIhAOkdbNje//eLrXVc+n6LOlc4PqxWOUcqwPCMT3pWtNrmki/CNA1ur","intermediateSigningKey":{"signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzyGFjQuzGSVij0DAQcDQgAEwhRrvGB0kZ1248MEJAPwX0YfrQInhyyRM7nZG3QC9NMvXR9Zd6uVcVzAz+6K/+NEGIWbX8zbk6A\\u003d\\u003d\",\"keyExpiration\":\"1571328568000\"}","signatures":["MEUCIQCR6vhCBHeFPvDJlCIo4/tLd7W8CIGrZDJlCI48IEiyHB8qmlCBHeFPvQIgLZJIe4cZv6pYtYYa56QCI/vvg1GqXTP3bTBjO49r5mI\u003d"]},"protocolVersion":"ECv2","signedMessage":"{\"encryptedMessage\":\"O4wTPip6RruraT6vO9MS+9stjkU/kT5EibKB3O1bbxyybKcGQ5vxBOtNOBKKd/NuqNmN2eEK3UbSKb1M3gv45gT9cCeEvlzO7Wg0N100vUBp9RPDN9TH4tj4w578sWFKfTi6FsSrZB27SGWcU0k85CGUMmd5PaGmQlHFqHc0HrDZmjM1yG82rFB/p31ZyUleN5nihzjOZif/BKXwg3XA2oLXqBSSWcAdfZwXxCEOqvAQE+kpTC7qVO4wTPip6RruraT6vO9M9FtPJXP9bPxzMVk/ozEZSfhSzVTT5EibKB3O1bbxyybKcGQ5vxBOtNOBKKd/NuqNmN2eEK3UbSKb1M3gv45gT9cCeEvlzO7Wg0N100vUBp9RPDN9TH4tj4w578sWFKfTi6FsSrZB27SGWcU0k85CGUMmd5PaGmQlHFqHc0HrDZmjM1yG82rFB/p31ZyUleN5nihzjOZif/BKXJXP9bPxzMVk/ozEZSfhSzVTT5EibKB3O1bbxyybKcGQ5vxBOtNOBKKd/NuqNmN2eEK3UbSKb1M3gv45gT9cCeEvlzO7Wg0N100vwg3XA2oLXqBSSWcAdfZwXxCEOqvAQE+kpTC7qVO4wTPip6RruraT6vO9MS+9stjkU/kT5EibKB3O1bbxyybKcGQ5vxBOtNOBKKd/NuqNmN2eEK3UbSKb1M3gv45gT9cCeEvlzO7Wg0N100vUBp9RPDN9TH4tj4w578sWFKfTi6FsSrZB27SGWcU0k85CGUMmd5PaGmQlHFqHc0HrDZmjM1yG82rFB/p31ZyUleN5nihzjOZif/BKXwg3XA2oLXqBSSWcAdfZwXxCEOqvAQE+kpTC7qVO4wTPip6RruraT6vO9M9FtIf0kcqzYSAN7pl1SUA5jC9rHrqucPoh0/FSspup78SWBt8TnmVKC9O3sQhIZ3SMoGOG4mdjtIrgCwWH2cbrxUH0dHAqOe5ANGOY/mII4nTEp7xaKu41hK/kFE15zVyqgEaKHO9buo94mRBY5yqffF3bKg5mAMPzjDhyHSujqWKAs9C5fBzMEuEr2z7A23kfLqBceH5uS9LJMiZ/yVKCwfpY9u2XyCjKdp7I\\u003d\",\"ephemeralPublicKey\":\"BAMDAtfgcPNuzItrwGLigGj3rtxmyHhZLwx1B4RJZ2oo11jpFf3SA6a3utryCMmlCEcqLfLn6WDH2ArrNBGn+Ew\\u003d\",\"tag\":\"T/qhZ/XY5/3Fe4QBKazwVeiKfm6NqS6EXhRlp8NeWrA\\u003d\"}"}
},
"type":"CARD",
"info":{
"cardNetwork":"MASTERCARD",
"cardDetails":"6812"
}
}
}

Payment method GooglePayPurchase

Production url: https://****.procard-ltd.com/api/

POST multipart/form-data

Request parameters:

ParameterDescriptionMandatoryType
operationOperation type. Value: GooglePayPurchaseYesString
merchant_idMerchant identifierYesString
amountAmount. Format: 1.00YesFloat
order_idUnique operation number on the merchant side.YesString
currency_isoCurrency UAHYesString
descriptionDescriptionYesString
callback_urlURL for payment result callback dataYesString
gpApiVersionMinorapiVersionMinor form the processPayment(paymentData)YesInteger
gpApiVersionapiVersion from the processPayment(paymentData)YesInteger
gpPMDescriptionpaymentMethodData.description from the processPayment(paymentData)YesString
gpPMTypepaymentMethodData.type from the processPayment(paymentData)YesString
gpPMICardNetworkpaymentMethodData.info. cardNetwork from the processPayment(paymentData)YesString
gpPMICardDetailspaymentMethodData.info. cardDetails from the processPayment(paymentData)YesString
gpTokenTypepaymentMethodData. tokenizationData.type from the processPayment(paymentData)YesString
gpTokenpaymentMethodData.tokenizationData.token from the processPayment(paymentData)NoString
gpTokenDecryptedThe parameter is passed instead of gpToken if payment with decrypted token is used. paymentMethodData.tokenizationData.token from the processPayment(paymentData)NoString
secure_typeTransaction Security Pass Type. The list of possible values see in Dictionary. secure_type parameter valuesNoInteger
signatureHMAC_SHA512 signature with merchant PrivateKey.YesString
Concatenated parameters merchant_id, order_id, amount, currency_iso, description in to string, separated ";" in UTF-8.
For example: hmac('sha512', 'merchant_id;order_id;amount;currency_iso;description')

Example of payment request with decrypted token:

{
"operation": "GooglePayPurchase",
"merchant_id": "BO_c544cc5a6be9f77",
"amount": 1,
"order_id": "1725460766155-908",
"currency_iso": "UAH",
"description": "Платеж GooglePayPurchase",
"callback_url": "http://merchant.dev/callback.php",
"gpApiVersionMinor": 0,
"gpApiVersion": 2,
"gpPMDescription": "Visa •••• 3119",
"gpPMType": "CRYPTOGRAM_3DS",
"gpPMICardNetwork": "VISA",
"gpPMICardDetails": "3119",
"gpTokenType": "PAYMENT_GATEWAY",
"gpTokenDecrypted": "ewoiZ2F0ZXdheU1lcmNoYW50SWQiOiAiQk9fZGM1NWI4MmJhMmJhNTNhIiwKIm1lc3NhZ2VFeHBpcmF0aW9uIjogIjE3MDg5ODc1MzMiLAoibWVzc2FnZUlkIjogIkFIMkVqdGRaaEZpc3NGdXZpaDdRbU9aeF9DLUp4akx4dW9yeGd6ekZxb2ZOcVdOZ2lOZ2hwOVNoVnVTemVaamxMVUFSZE1XUm8wZ2k5YzNPbllaREQ1ck9HRGhET2NwbkcyNVpmRU1CM2o5aFhpX3Q0UVlKRzN1UGV4eHdQOUZWaDhFb0RUUEg0a0o0IiwKInBheW1lbnRNZXRob2QiOiAiQ0FSRCIsCiJwYXltZW50TWV0aG9kRGV0YWlscyI6IHsKImV4cGlyYXRpb25ZZWFyIjogMjAyNSwKImV4cGlyYXRpb25Nb250aCI6IDEyLAoicGFuIjogIjQwMTIwMDAwMDAwMDMxMTkiLAoiYXV0aE1ldGhvZCI6ICJDUllQVE9HUkFNXzNEUyIsCiJjcnlwdG9ncmFtIjogIkFJSkJ2U2hRNkRtckFCS1AzL0F3R2dBREZBPT0iCn0KfQo=",
"add_params": {
"BrowserIP": "10.1.2.3",
"UserAccountID": "00000000-ABCD-1234-A1B2-123456789876-12345654-ABCD-1234-A1B2-333",
"Fingerprint": "12345654-ABCD-1234-A1B2-123456789876-12345654-ABCD-1234-A1B2-111",
"AReqDetails.notificationUrl": "https://merchant.dev/3ds/result"
},
"signature": "5d0ec7237a1e856a5a2c27f2680736cf"
}

Decrypted token structure:

ParameterDescriptionMandatoryType
gatewayMerchantIdUnique merchant identifier in the payment gateway systemYesString
messageExpirationA timestamp indicating when the token expiresYesString
messageIdA unique identifier for this particular payment messageYesString
paymentMethodType of payment method usedYesString
paymentMethodDetails
expirationYearCard expiration yearYesString
expirationMonthCard expiration monthYesString
panPrimary account number (tokenized card number)YesString
authMethodAuthentication method used (CRYPTOGRAM_3DS indicates 3D Secure)YesString
cryptogramUnique cryptogram generated for this transaction for security purposesYesString

Example decrypted token:

{
"gatewayMerchantId": "BO_dc55b82ba2ba53a",
"messageExpiration": "1708987533",
"messageId": "AH2EjtdZhFissFuvih7QmOZx_C-JxjLxuorxgzzFqofNqWNgiNghp9ShVuSzeZjlLUARdMWRo0gi9c3OnYZDD5rOGDhDOcpnG25ZfEMB3j9hXi_t4QYJG3uPexxwP9FVh8EoDTPH4kJ4",
"paymentMethod": "CARD",
"paymentMethodDetails": {
"expirationYear": 2025,
"expirationMonth": 12,
"pan": "4012000000003119",
"authMethod": "CRYPTOGRAM_3DS",
"cryptogram": "AIJBvShQ6DmrABKP3/AwGgADFA=="
}
}

To support the possibility of performing authorization according to the 3DS2 protocol, the following parameters must be additionally transferred to add_params:

ParameterTypeRequiredDescription
AReqDetails.notificationUrlStringNoThe URL to send CRes

JSON is returned in response.

Unsuccess response with the following parameters:

ParameterTypeDescription
codeIntegerResponse code (Dictionary. System Error Codes)
messageStringText message with query result

Response example:

{
"code":-4,
"message":"Неверная подпись"
}

If 3DS no need, response with the following parameters:

ParameterTypeDescription
reasonCodeIntegerRequest result code
0 - successful
12 - operation fail
reasonString/IntegerMessage with request result
Pay attention that the message can be string or number!
transactionStatusStringOperation Status (see Dictionary. Payment Statuses)

Success operation response example:

{
"reasonCode": 0,
"reason": "OK",
"transactionStatus": "APPROVED"
}

Operation failure response example:

{
"reasonCode": 12,
"reason": 55,
"transactionStatus": "DECLINED"
}

If 3DS verification is required, response with the following parameters:

ParameterDescriptionMandatoryType
codeResponse codeYesInteger
statusPayment status. If status like as "3ds", need to call 3D Secure checkYesString
d3AcsUrlacs url for 3D Secure CheckNoString
d3MdUnique message identifier for 3DS hostNoString
d3PareqPaReq message for 3DS hostNoString
d3Creqd3Creq message for 3DS hostNoString
transaction_keyProcardPay transaction keyYesString

Response example:

{
"code": 2002,
"status": "3ds",
"d3AcsUrl": "https://bank.com/acs/94",
"d3Creq": "eyJhY3NUcmFuc0lEIjoiMjczNzlhNWYtMGVlMi00MzcxLWEwMDYtNTExOTdlMzVhMjI3IiwidGhyZWVEU1NlcnZlclRyYW5zSUQiOiJmMjIyY2VlZi1kMWJjLTRjZjEtYWYxMy01MGM5ZjExODJhN2YiLCJjaGFsbGVuZ2VXaW5kb3dTaXplIjoiMDMiLCJtZXNzYWdlVHlwZSI6IkNSZXEiLCJtZXNzYWdlVmVyc2lvbiI6IjIuMS4wIn0",
"d3Md": "",
"d3Pareq": "",
"transaction_key": "b701ff08d09206ef89cc8178aee0e8ef3a765d7042368b545cf55acf8b5707e164c7adf64d66a"
}

Check 3DS

If status like as "3ds", need to call 3D Secure check.

If the response code is 2002, a 3DS1 verification is required.

If the response code is 2002, a 3DS2 verification is required.

3DS1 verification

To verify 3ds, you should use the POST method to send a form with the parameters d3Pareq and d3Md to d3AcsUr:

<form name="MPIform" action='${d3AcsUrl}' method="POST">
<input type="hidden" name="PaReq" value='${d3Pareq }'>
<input type="hidden" name="MD" value='${d3Md }'>
<input type="hidden" name="TermUrl" value='${TempUrl}'>
</form>

TempUrl - merchant url to return from 3DS verification.

3DS2 verification

To verify 3ds, you need to post the form with the d3Creq parameter to d3AcsUrl.

<form name="MPIform" action='${d3AcsUrl}' method="POST">
<input type="hidden" name="creq" value='${d3Creq}'>
</form>

To complete the payment on the merchant's payment page after executing 3DS, it is necessary to complete 3DS verification

Complete 3DS verification

See details in The confirmation of 3DS Verification