Google Pay integration guide

Google Pay Google Pay is a payment provider allowing customers to pay using payment methods saved to their Google account. This section is intended to help you implement Google Pay based on your preferred integration workflow.

Services and compatibility

Payment method gateway nameGoogle Pay through Authorize.net
Google Pay through Cybersource
Supported transaction types
Supported integration methods
Supported processing currenciesFor Google Pay through Authorize.net:
  • BRL, CAD, CLP, CZK, DKK, EUR, GBP, HKD, HNL, JPY, NOK, NZD, PLN, RUB, SEK, SGD, TWD, UAH, USD

For Google Pay through CyberSource:
  • AUD, CAD, USD
Webhook event types
  • TRANSACTION_AUTHORIZED
  • TRANSACTION_CAPTURED
  • TRANSACTION_REFUNDED
  • TRANSACTION_SETTLED
  • TRANSACTION_VOIDED

Configuration

In order to use Google Pay with your merchant account, you must first work with Integrations to add it to your account.

Prerequisites

In order to have Integrations configure your account for use with Google Pay, you need to provide Integrations with the following information:

Required fields

The following table shows the required and optional fields for Google Pay transactions in the Create APM one-time-use token request.

FieldRequired?Description
data.amountYesThe transaction amount.
data.currencyYesThe three-character ISO currency code for the transaction.
For Google Pay through Authorize.net (googlePayAuthNet), supported currencies are BRL, CAD, CLP, CZK, DKK, EUR, GBP, HKD, HNL, JPY, NOK, NZD, PLN, RUB, SEK, SGD, TWD, UAH, and USD.
For Google Pay through CyberSource (googlePayCyberSource), supported currencies are AUD, CAD, and USD.
data.customer.orderNumberYesThe order number.
data.customer.firstNameYesThe customer's first name, as it is set for the payment method.
data.customer.lastNameYesThe customer's last name, as it is set for the payment method.
data.customer.emailYesThe customer's email address.
data.customer.billToAddressOneYesThe street address for the customer.
data.customer.billToCityYesThe city for the address record.
data.customer.billToStateYesThe state or province on file with the payment provider. (If in the US, this must be the two-character state abbreviation).
data.customer.billToPostalYesThe postal code on file.
data.customer.billToCountryYesThe two-character (Alpha-2) ISO country code.
customerRedirectUrlConditionalThe URL to which the customer will be redirected after completing their payment. The customer will be sent here upon successful or failed payment. This URL must use the HTTPS protocol. Required if you intend to use Nexio’s redirectUrls with your own buttons.
data.cart.items[n].descriptionNoA description of the item.
data.cart.items[n].priceNoThe price per item
data.cart.items[n].quantityNoThe quantity sold.
data.cart.items[n].itemNoItem number or code.
data.cart.items[n].typeNoThe transaction type.
data.customer.billToAddressTwoNoAdditional street address information, if required.
data.customer.billToPhoneNoThe billing phone number.
data.customer.customerRefNoCustomer identifier. You can use this field to pass a customer ID to the APM or to manage user subscriptions.
data.customer.shipToAddressOneNoThe shipping address, if different from the billing address.
data.customer.shipToAddressTwoNoAdditional shipping address information, if required.
data.customer.shipToCityNoThe shipping city.
data.customer.shipToStateNoThe shipping state or province. (If in the US, this must be the two-character state abbreviation).
data.customer.shipToPostalNoThe shipping postal code.
data.customer.shipToCountryNoThe two-character (Alpha-2) ISO shipping country code.
data.customer.shipToPhoneNoThe shipping phone number.
data.descriptionNoA description of the transaction.
data.descriptor {}NoFor Google Pay through CyberSource (googlePayCyberSource) only, include this object and the appropriate parameters to dynamically change the descriptor on the customer's statement.

Supported parameters in the descriptor object are the following:

  • name - include this parameter to dynamically change the name descriptor on the customer's statement. If this parameter is not included, the system uses the default descriptor (as set up on the merchant account that is originating the transactions).
  • address - include this parameter to dynamically change the descriptor on the customer's statement for the street address of the merchant. If this parameter is not included, the system uses the default street address descriptor (as set up on the merchant account that is originating the transactions).
  • city - include this parameter to dynamically change the descriptor on the customer's statement for the city of the merchant. If this parameter is not included, the system uses the default city descriptor (as set up on the merchant account that is originating the transactions).
  • state - include this parameter to dynamically change the descriptor on the customer's statement for the state of the merchant. If this parameter is not included, the system uses the default state descriptor (as set up on the merchant account that is originating the transactions).
  • postal - include this parameter to dynamically change the descriptor on the customer's statement for the postal code of the merchant. If this parameter is not included, the system uses the default postal code descriptor (as set up on the merchant account that is originating the transactions).
  • country - include this parameter to dynamically change the descriptor on the customer's statement for the country of the merchant. If this parameter is not included, the system uses the default country descriptor (as set up on the merchant account that is originating the transactions).
data.paymentMethodNoThe identifier for the alternative payment method. Use this parameter when you want to only return the Google Pay iframe button URL (rather than data for all payment methods associated with the account).

The value to use is googlePayAuthNet or googlePayCyberSource, depending on your integration.
isAuthOnlyNoSet to true to run an auth only transaction.
processingOptions.merchantIdNoThe Nexio merchant ID (MID).
processingOptions.paymentOptionTagNoA custom value used to route transactions to a specific gateway or merchant account.
uiOptions.cssNoThe URL where your custom CSS file is hosted.
uiOptions.displaySubmitButtonNoSet to true to include a submit button in the iframe.

Example requests

The following are example one-time-use token requests for Google Pay.

Example Request for Google Pay through Authorize.net
curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic [Base64_encoded_login]'
  -d '{
  "data": {
    "amount": 4.00,
    "currency": "USD",
    "paymentMethod": "googlePayAuthNet",
    "customer": {
      "orderNumber": "12345678",
      "firstName": "John",
      "lastName": "Doe",
      "email": "[email protected]",
      "billToAddressOne": "123 Test St",
      "billToCity": "Testerville",
      "billToState": "UT",
      "billToPostal": "12345",
      "billToCountry": "US"
    }
  }
}'
Example Request for Google Pay through Cybersource
curl -X POST https://api.nexiopaysandbox.com/apm/v3/token \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic [Base64_encoded_login]'
  -d '{
  "data": {
    "amount": 4.00,
    "currency": "USD",
    "paymentMethod": "googlePayCyberSource",
    "customer": {
      "orderNumber": "12345678",
      "firstName": "John",
      "lastName": "Doe",
      "email": "[email protected]",
      "billToAddressOne": "123 Test St",
      "billToCity": "Testerville",
      "billToState": "UT",
      "billToPostal": "12345",
      "billToCountry": "US"
    }
  }
}'

A successful request returns a response similar to the following:
Example 200 Response with several payment methods
{
  "expiration": "2018-09-18T15:43:05.664Z",
  "token": "830d36f6-a5e3-4455-9600-3a55b63e2fc2",
  "scriptUrl": "https://api.nexiopaysandbox.com/apm/v3/script?token=b61ca2a9-b804-4a28-a00e-b794c8975dee",
  "expressIFrameUrl": "https://www.api.nexiopaysandbox.com/v3?token=79001ef6-fb40-4917-b8ae-2294fdfe1cf2",
  "redirectUrls": [
    {
      "paymentMethod": "payPal",
      "url": "https://www.api.nexiopaysandbox.com/v3/popup?token=79001ef6-fb40-4917-b8ae-2294fdfe1cf2&paymentMethod=payPal"
    },
    {
      "paymentMethod": "googlePayAuthNet",
      "url": "https://www.api.nexiopaysandbox.com/v3/popup?token=79001ef6-fb40-4917-b8ae-2294fdfe1cf2&paymentMethod=googlePayAuthNet"
    },
    {
      "paymentMethod": "googlePayCyberSource",
      "url": "https://www.api.nexiopaysandbox.com/v3/popup?token=79001ef6-fb40-4917-b8ae-2294fdfe1cf2&paymentMethod=googlePayCyberSource"
    }
  ],
  "buttonIFrameUrls": [
    {
      "paymentMethod": "payPal",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=b61ca2a9-b804-4a28-a00e-b794c8975dee&paymentMethod=payPal"
    },
    {
      "paymentMethod": "googlePayAuthNet",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=b61ca2a9-b804-4a28-a00e-b794c8975dee&paymentMethod=googlePayAuthNet"
    },
    {
      "paymentMethod": "googlePayCyberSource",
      "url": "https://api.nexiopaysandbox.com/apm/v3?token=b61ca2a9-b804-4a28-a00e-b794c8975dee&paymentMethod=googlePayCyberSource"
    }
  ]
}

For the multi iframe integration method: You use the expressIFrameUrl value in the steps for the transaction.

For the individual iframe option: You use the buttonIFrameUrls.url of the Google Pay APM for the transaction.

For the custom redirect option: You use the redirectUrls.url of the Google Pay APM for the transaction.

Transaction types and integration methods

Regardless of the integration method workflow you implement, consumers are redirected to Google Pay to complete their transactions.

Nexio supports the following transaction types for Google Pay:

Testing data

For testing data, see the appropriate page for your target platform:

Response handling

In the one-time-use token request, Google Pay gets returned in the paymentMethod parameter as googlePayAuthNet or googlePayCyberSource.

Nexio responds with transaction results in one of the following ways, depending on your integration workflow:

  • Event messages: This applies to integrations that do not pass a customerRedirectUrl in the request.
  • Response fields in the URL: This applies to integrations that do provide a customerRedirectUrl in the request.

In addition to one of the above, if your merchant account is configured to receive webhooks, Nexio provides responses to the webhook URLs that have been registered. For further explanation of the webhook event types, see the webhook Event types table.

For Google Pay, these are the possible webhook event types:

  • TRANSACTION_AUTHORIZED
  • TRANSACTION_CAPTURED
  • TRANSACTION_REFUNDED
  • TRANSACTION_SETTLED
  • TRANSACTION_VOIDED

For information about how to run each of the integration workflows, see Transaction types and integration methods above.

Status workflows

The status of a successful transaction with Google Pay varies, depending on the options you choose.

SaleWhen isAuthOnly is false, successful sale transactions have the following statuses:
  • pending*
  • settled
Auth onlyWhen isAuthOnly is true, successful sale transactions have the following statuses:
  • authOnlyPending
  • authOnly
CaptureSuccessful capture transactions have the following status:
  • settled
VoidSuccessful void transactions have the following status:
  • voided
RefundSuccessful refund transactions have the following status:
  • settled

*Pending status displays as "authorized" or "AUTHORIZED" in the Nexio Dashboard; it displays as 10, meaning "authorized", in the response when querying transactions (for more information about transactionStatus, see the table).

Next steps

Now, you are ready to get started with running transactions:

If you have any additional questions or feedback, see Contact us.