Developer Guide Menu

Google Pay

Google Pay uses payment network tokenization to make Web payments and mobile payments on Android devices. You can choose CyberSource to process Google Pay transactions through all e-commerce channels.

How Google Pay Works

  1. The customer chooses the
    Google Pay
    button. Using the Google API, your system initiates the Google Pay request identifying
    cybersource
    as your payment gateway, passing your CyberSource merchant ID as the gateway merchant ID.
  2. The customer confirms the payment. The Google API contacts Google Pay services to retrieve the consumer’s payment parameters.
  3. If the customer’s selected payment credentials are tokenized or you are tokenizing new payment credentials, the Google Pay service contacts the appropriate payment network to retrieve the appropriate cryptogram.
  4. The payment network returns the appropriate token and cryptogram to the Google Pay service.
  5. Google creates encrypted payment data using the gateway-specific key that is supplied in the Wallet request and includes it in the Google API response.
  6. The Google Pay call back returns the encrypted payment data.
  7. Your system prepares the Google Pay response information for submission to the CyberSource service.
    1. CyberSource sends the authorization request to the acquirer.
    2. The acquirer processes the request from CyberSource and creates the payment network authorization request.
    3. The payment network processes the request from the acquirer and creates the issuer authorization request.
    4. The issuer processes the request from the payment network. The issuer looks up the payment information and returns an approved or declined authorization message to the payment network.
    5. The payment network returns the authorization response to the acquirer.
    6. The acquirer returns the authorization response to CyberSource.
  8. CyberSource returns the authorization response to your system.
  9. Your system returns the authorization response to the payment application.
  10. The payment application displays the confirmation or decline message to the customer.
    1. The acquirer submits the settlement request to the issuer for funds.
    2. The issuer supplies the funds to the acquirer for the authorized transactions.

Decryption Options

CyberSource offers merchants two options for processing Google Pay transactions:
  • CyberSource decryption
  • Merchant decryption
The CyberSource decryption option enables you to simplify your payment processing by allowing CyberSource to decrypt the payment data for you during processing. You can then process transactions without seeing the payment network token and transaction data. To use this option:
  1. Using the Google API, request the customer’s encrypted payment data.
  2. Using the CyberSource API, construct and submit the authorization request, and include the encrypted payment data from the Google Pay call back. CyberSource decrypts the encrypted payment data to create the payment network token and processes the authorization request.
The merchant decryption option enables you to decrypt the payment data from Google to retrieve the payment network token, the expiry date, the cryptogram, and other payment data associated with the transaction. You then submit the authorization request with the payment network tokenization data as described in "Payment Network Tokenization."

Formatting the Payment Blob

To transmit Google Pay responses to CyberSource securely, you must first encode them using Base64.
Example 1
shows a Google Pay response.
Example 1
. Google Pay Response
{"signature":"MEUCIQDhTxhHqwY8pXB9hpYxaSK5jFgsqpG2E1rX 77QXssK8tAIgUBvYYAI/bnBS8T/Tfxnm2AF981Mv5y0pHyGexM5dMJk\u003d","pr otocolVersion":"ECv1","signedMessage":"{\"encryptedMessage\":\"ody UGGA7B+blletYcJbS43AQUFQJpWEFCN4UuUExQ5LX0\/XcLwKElXcB95nMnmPO9lM2 KGp13FYsL768ccCzAjBGLYF+fugcJTcvkrUhcNSyXr7hwf12BEsrweqJM6I7Vs5lfr PAukRJeLDQG4FxmTLW49QyP8vIZC+tz2c+Z3zozzI5oB9jE8fA2dolFa13Cu6gXqdK H\/IHRh7UniLUuTy+0G5FQV2pwST2uBSNNkZhb8WYJDHbxBjz0UebVP+ObmT5cc8AK U5dgHRdfr4GKpEZ4EBzB90BPxLqYHpopriJ6lbFgFVsQQ6\/8HBqQ7ImIMH5y7G8p8 qAFkWnB78ZcL0Fh5BjXojkxGoFp2gjAsrhhttHAFbe3WQBuPkwJu09\/6\/MyJpCSr pMHFouF\/dj0SYjQ+xI097lCHZec7jQrAhISLWZ9DZkuMvGKPWpu0CKn2XqTXQ=\", \"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnn4yj y0N6xlXO8\/8j7\/4jvmLJCYAqgXLwP1FhjuTgIM9oCtPijZfI9so2QEOs2ZnVp3D0 dl3JYIDVe+396KkAQ==\",\"tag\":\"DRpcc+YQ33RNgsTcxztnJbMJnirbU5DW3d StjfhFiwc=\"}"}
Example 2
shows how to transform the Google Pay payment information into the Base64-encoded blob.
Example 2
. Android Code
new String(Base64.encode(paymentData.getPaymentMethodToken().getToken().getBytes()))
To construct the following blob, encode
Example 1
using Base64 and include it in the CyberSource payment request.
Example 3
shows a formatted Google Pay blob.
Example 3
. Google Pay Blob
eyJ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NktrQVE9PVwiLFwidGFnXCI6XCJEUnBjYytZUTMzUk5nc1RjeHp0bk piTUpuaXJiVTVEVzNkU3RqZmhGaXdjPVwifSJ9
The CyberSource decryption option enables you to simplify your payment processing by allowing CyberSource to decrypt the payment data for you during processing. To use this option:
  1. In the authorization request under the
    paymentInformation
    object, set the
    value
    field under the
    fluidData
    object to the Base64-encoded value obtained from the Google Pay blob.
  2. Under the
    processingInformation
    object, set the
    paymentSolution
    field to
    012
    .
Top