[Go to site: main page, start]

Google Pay ™


Google Pay


Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer’s Google account.

Direct Google Pay Integration

In case a direct integration with Google Pay is required, and not through Components, the following parameters should be used when working with the Google Pay integration:

gateway:

gatewayMerchantID: mrchnt_{merchant_id}

Your merchant ID can be found on the dashboard on the Developers tab.

For merchants who are PCI Level 1 certified and integrating directly with Google Pay, network tokens can be decrypted by the merchant before sending to for processing.

For merchants who are not certified or do not want to detokenize Google Pay payment data, the encrypted blob can be sent to for both decryption and processing. Merchants are not exposed to PCI Scope for obtaining the Google Pay token.

What authMethod should I use for Google Pay?

While supports both auth methods PAN_ONLY and CRYPTOGRAM_3DS strongly encourages the sole use of authMethod CRYPTOGRAM_3DS to mitigate fraud.


In a Google pay workflow the payment data are directly sent to the server with initial payment request. That means that the transaction can be processed straight away.

Your request has to include the following information:

  • - Authentication Credentials
  • - Type and amount of transactions
  • - Payment information like pan_only/cryptogram_3ds/encrypted

For our Google pay Workflow REST API you can use the following types of initial payments:

Perform 3DS on a PAN_ONLY Google Pay token

In case of PAN Only, based on risk parameters 3D secure flow may trigger, please refer 3D workflow for more details

We do provide 3DS on Google Pay PAN_ONLY transactions. Pass attemptThreeD parameter in request on every PAN_ONLY credential returned from a Google Pay PAN_ONLY encrypted payload to initiate 3DS verification.

For more details on each parameters please refer our API Specifications.

Google Pay Hosted Checkout

In order to use Google Pay hosted checkout option, you need to integrate with our standard checkout option.


Preauthorization (PA):

Request has to be sent to our REST endpoint i.e. /transactionServices/REST/v1/payments using POST method.

The paymentType for this request will be PA.

You can also place a capture transaction request against a successful PA using our Backoffice APIs.


Debit (DB):

Debit request has to be sent to our REST endpoint i.e. /transactionServices/REST/v1/payments using POST method.

With a DB request a successfully authorized transaction gets captured immediately.

The paymentType for this request will be DB.


In our API Specifications you can find a full list of parameters that can be sent in the initial request.


   Merchant needs to set Authentication token in header while posting request. To generate authentication token, please refer Auth token API.

Request specification:


Parameter Description Format Required
authentication.memberId Unique merchant member ID provided by TWPayz. N10
[0-9]{1,10}
Yes
authentication.checksum MD5 checksum generated using merchant credentials for request authentication. AN32
[a-fA-F0-9]{32}
Yes
authentication.terminalId Merchant terminal ID assigned by TWPayz. N10
[0-9]{1,10}
Yes
merchantTransactionId Unique transaction reference generated by the merchant. AN100
[a-zA-Z0-9\\p{Space}\\-_.]{1,100}
Yes
amount Transaction request amount. Decimal format needs to be followed N13
[0-9]{1,10}\.[0-9]{2}
Yes
currency Transaction request currency A3
[a-zA-Z]{3}
Yes
orderDescriptor Description of the order or transaction. AN255
[a-zA-Z0-9\\p{Space}\\,.:'&()/_-]{1,255}
Yes
shipping.country Country of the shipping address. AN3
[a-zA-Z0-9]{2,3}
Yes
shipping.city City of the customer's shipping address. AN50
[a-zA-Z0-9\\\\#&\\p{Space}\\p{L}\\p{M}\\-;.,~`/%$#@ ]{0,50}
Yes
shipping.state State or region of the customer's shipping address. AN50
[\\ra-zA-Z0-9\\\\!@#$*%^&{}\\[\\]()_+\\p{L}\\p{M}\\-=,.~'` ]{0,50}
Yes
shipping.postcode Postal code/ Zip code of the customer's shipping address. AN9
[A-Za-z0-9]{2,9}
Yes
shipping.street1 Building name, and or street name of the customer's shipping address. AN150
[a-zA-Z0-9\\p{Space}\\,]+
Yes
customer.telnocc Country code of the customer. N4
[0-9]{1,4}
Yes
customer.phone Phone number of the customer. N24
[0-9\+-. ]{6,24}
Yes
customer.email Email address of the customer. AN100
[A-Za-z0-9._%'-]+@[A-Za-z0-9.-]+\\.[a-zA-Z]{2,100}
Yes
customer.givenName First name of the customer. AN
[a-zA-Z0-9\\p{Space}\\,.:'"-=+)({}[]]+
Yes
customer.surname Last name or surname of the customer. AN
[a-zA-Z0-9\\p{Space}\\,.:'"-=+)({}[]]+
Yes
customer.ip IP address of the customer. AN255
(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
Yes
customer.birthDate Birth date of the customer in the format YYYYMMDD. AN8
{19|20)([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1]}
Yes
googlepayTokenpayload.paymentMethod The type of the payment credential. Currently, only CARD receives support. String Yes
googlepayTokenpayload.paymentMethodDetails.authMethod The authentication method of the card transaction. String Yes
googlepayTokenpayload.paymentMethodDetails.pan The personal account number that receives a charge. This string contains only digits. String Yes
googlepayTokenpayload.paymentMethodDetails.expirationMonth The expiration month of the card, where 1 represents January, 2 represents February, and so on. String Yes
googlepayTokenpayload.paymentMethodDetails.expirationYear The four-digit expiration year of the card, such as 2026 Number Yes
googlepayTokenpayload.paymentMethodDetails.cardFundingSource Card funding source for the selected payment method.
  • UNKNOWN
  • CREDIT
  • DEBIT
  • PREPAID
Important: cardFundingSource is only returned in TEST environment. Please reach out to your Google contact or support team to opt-in for using this parameter in PRODUCTION.
String Yes
googlepayTokenpayload.paymentMethodDetails.accountVerified If true, indicates that Cardholder possession validation performs on the returned payment credential. boolean Yes
googlepayTokenpayload.paymentMethodDetails.cardHolderAuthenticated If true, indicates that identification and verifications (ID&V) performs on the returned payment credential. boolean Yes
googlepayTokenpayload.gatewayMerchantId A unique merchant identifier that the processor understands and uses to verify that the message was for the merchant that made the request. The processor creates it, and the merchant passes it to Google by a merchant in PaymentMethodTokenization Specification on Android

(/pay/api/android/reference/request-objects#PaymentMethodTokenizationSpecification) or on Web (/pay/api/web/reference/request-objects#PaymentMethodTokenizationSpecification).

Caution: gatewayMerchantId doesn’t populate for direct, per-merchant encryption.
boolean Yes
googlepayTokenpayload.messageId A unique ID that identifies the message in case it needs to be revoked or located at a later time. string Yes
googlepayTokenpayload.messageExpiration Date and time at which the message expires as UTC milliseconds since epoch. Integrators need to reject any message that's past expiration. string Yes
customer.customerId Unique customer identifier assigned by the merchant. AN100
[a-zA-Z0-9\\-_]{1,100}
Yes
paymentBrand Type of Card while placing the transaction. AN20
[a-zA-Z0-9] {1,20}
Yes
paymentMode It specifies the mode of payment for the request AN10
[a-zA-Z0-9] {1,10}
Yes
paymentType The payment type for the request. You can send a transaction requests with one of the following types:
  • PA, Preauthorization: A request made by the merchant to the gateway to authorize the availability of a required amount of funds for a specific credit card. An authorization verifies that a card is valid and has sufficient funds to complete this transaction. If approved, the authorized amount is held until it is completed, or an expiry time is reached.
  • DB, Debit: A transaction combining both, the Auth and Capture transactions. It instructs the gateway to perform both actions one after the other, query the bank for authorization and – upon approval – immediately capture the relevant transaction.
A2
((PA|DB|))
Yes
merchantRedirectUrl This URL will receive the result of an asynchronous payment.
It must be sent URL encoded.
AN2048
([htpfs]{3,5}\\:?\\/\\/[\\w\\.\\:\\/]*\\??[a-zA-Z0-9]*)
Yes
notificationUrl Merchant callback URL for payment notifications. AN2048
([htpfs]{3,5}\\:?\\/\\/[\\w\\.\\:\\/]*\\??[a-zA-Z0-9]*)
Yes
tmpl_amount Template amount used for recurring transactions. N13
[0-9]{1,10}\\.[0-9]{2}
No
tmpl_currency Template currency used for recurring transactions. A3
[A-Z]{3}
No
merchant_website_url Merchant website URL. AN2048
([htpfs]{3,5}\\:?\\/\\/[\\w\\.\\:\\/]*\\??[a-zA-Z0-9]*)
Yes

Response specification:


Parameter Description Format Required
paymentId Unique payment identifier generated by TWPayz. N10
[0-9]
Yes
paymentBrand Type of Card while placing the transaction. A20
[a-zA-Z0-9] {1,20}
Yes
paymentType The payment type for the request. You can send a transaction requests with one of the following types:
  • PA, Preauthorization: A request made by the merchant to the gateway to authorize the availability of a required amount of funds for a specific credit card. An authorization verifies that a card is valid and has sufficient funds to complete this transaction. If approved, the authorized amount is held until it is completed, or an expiry time is reached.
  • DB, Debit: A transaction combining both, the Auth and Capture transactions. It instructs the gateway to perform both actions one after the other, query the bank for authorization and – upon approval – immediately capture the relevant transaction.
A2
((PA|DB|))
Yes
paymentMode It specifies the mode of payment for the request A10
[a-zA-Z0-9] {1,10}
Yes
amount Transaction request amount. Decimal format needs to be followed. N13
[0-9]{1,10}\.[0-9]{2}
Yes
currency Currency of the transaction. A3
[a-zA-Z\\p{Space}\\,]+
Yes
result.code Response code indicating the transaction status. AN11
[0-9\.]{2,11}
Yes
result.description Description corresponding to the response code. AN255
[a-zA-Z0-9\\p{Space}\\,]+[a-zA-Z0-9\\p{Space}\\,]+
Yes
card.bin First six digits (BIN) of the payment card. N6
[0-9]{6}
Yes
card.last4Digits Last four digits of the payment card. N4
[0-9]{4}
Yes
card.holder Name of the customer on card. AN255
[a-zA-Z0-9]
Yes
card.expiryMonth Expiry month on card.. N2
[0-9]
Yes
card.expiryYear Expiry year on card. N4
[0-9]
Yes
timestamp Shows at what time the transaction has been placed. date
yyyy-MM-dd hh:mm:ss
Yes
transactionStatus Status of the transaction processed. Possible values are,
‘Y’ – Successfully processed
‘N’ – Failed
‘P’ – Pending
‘3D’ – Pending for 3D authentication
‘C’ – Cancelled
A2
[Y|N|P|3D|C]
Yes
merchantTransactionId Unique ID sent at the time of transaction. AN100
[.\\p[0-9a-zA-Z\\p{Space}\\-]{0,100}
Yes
tmpl_currency Currency of the customized amount to facilitate customer, template currency can be same as transaction currency, Accept only 3 character currency code in capital letters. A3
[A-Z]{3}
No
tmpl_amount Customized amount of customer, template amount can be same as transaction amount. N13
[0-9]{1,10}\\.[0-9]{2}
No
remark Transaction remark from respective gateway. AN255
[a-zA-Z0-9]
Yes


Sample Request


Sample Response


Hashing Rule

is supporting MD5 Cryptographic Hash for the authenticity of payment request send to the server.


Below is the description of fields use for generating checksum.

  • memberId <Merchant ID as shared by >
  • secureKey <Secure Key that can be generated through 's dashboard>
  • merchantTransactionId <Unique transaction ID prived by merchant>
  • amount <Amount of transaction>

How to generate Checksum ?

Checksum has to be calculated with following combination and need to be send along with the authentication parameters in each server-to-server request:
<memberId>|<secureKey>|<merchantTransactionId>|<amount>


Standard Notification/ Callback

Checksum has to be calculated with following combination.
<paymentId>|<merchantTransactionId>|<amount>|<short status of transaction>|<secret key>

Example :
77251|011E1D8A5C034|156.00|N|<merchant secret key>


Sample Code


Compatibility

Card brands: Visa, MasterCard, American Express, Discover

Browsers: Google Chrome, Mozilla Firefox, Apple Safari, Microsoft Edge, Opera, or UCWeb UC


Terms of Service

By integrating Google Pay, you agree to Google’s terms of service and Google Pay and Wallet API's Acceptable Use Policy.

Web Merchants:

Google Pay Web Developer Documentation

Google Pay Web Integration Checklist

Google Pay Web Brand Guidelines


Android Merchants:

Google Pay Android Developer Documentation

Google Pay Android Integration Checklist

Google Pay Android Brand Guidelines