Google Pay Response Objects
For complete sample code please refer here
Available Response Objects
PaymentResponse Object
This Object contains Google Pay response.
Name
Type
Always exists
Description
transactionInfo
Yes
Contains all transaction data. For more details please click on the link
paymentData
Yes
This is a response object that's returned by Google after a payer approves payment
TransactionInfo Object
Name
Type
Always exists
Description
displayItems
DisplayItem
Yes
Array of line items describing the charge. For more details please click on the link
countryCode
String
Yes
ISO 3166-1 alpha-2 country code
currencyCode
String
Yes
ISO 4217 alphabetic currency code.
totalPriceStatus
String
Yes
Set to FINAL
totalPrice
String
Yes
Total amount consumer should be charged. This is a sum of all DisplayItems
transactionId
String
Yes
A unique ID that identifies a transaction attempt. Can be passed on the Request through billingParameters
DisplayItem Object
Name
Type
Always exists
Description
label
String
Yes
From Google documentation: The label to be displayed for the given option
type
String
Yes
From Google documentation: Type of displayed line item:
LINE_ITEM
SUBTOTAL
price
String
Yes
From Google documentation: The monetary value of the cart item with an optional decimal precision of two decimal places. Negative values are allowed.
status
String
Yes
From Google documentation: The following variables define price variance:
FINAL
PENDING
Default to FINAL
if not provided
TransactionInfo example
PaymentData Object
Name
Type
Always exists
Description
apiVersion
Number
Yes
From Google documentation: Major API version
apiVersionMinor
Number
Yes
From Google documentation: Minor API version
paymentMethodData
Yes
From Google documentation: Data about the selected payment method
email
String
No
Email address, if emailRequired
is set to true
in the request
shippingOptionData
No
From Google documentation: The selected shipping option in the payment sheet.
SelectionOptionData Object
Name
Type
Always exists
Description
id
String
Yes
Id of the selected Shipping Option
PaymentMethodData Object
Name
Type
Always exists
Description
description
String
Yes
From Google documentation: User-facing message to describe the payment method that funds this transaction.
tokenizationData
No
From Google documentation: Payment tokenization data for the selected payment method.
type
String
Yes
Will be always set to CARD
CardInfo Object
Name
Type
Always exists
Description
cardNetwork
String
Yes
From Google documentation: The payment card network of the selected payment.
cardDetails
String
Yes
From Google documentation: The details about the card. This value is commonly the last four digits of the selected payment account number.
assuranceDetails
String
Yes
From Google documentation:
This object provides information about the validation performed on the returned payment data if assuranceDetailsRequired
is set to true
on the request.
billingAddress
Address
No
From Google documentation:
The billing address associated with the provided payment method, if billingAddressRequired
is set to true
in the request
PaymentMethodTokenizationData Object
Name
Type
Always exists
Description
type
String
Yes
Will be always set to PAYMENT_GATEWAY
token
String
No
A JSON object string that contains a chargeable token issued by Google
PaymentData Example
Address Object
Name
Address format
Description
name
MIN
From Google documentation: The full name of the addressee.
postalCode
MIN
From Google documentation: The postal or ZIP code.
countryCode
MIN
From Google documentation: ISO 3166-1 alpha-2 country code.
phoneNumber
MIN
From Google documentation:
A telephone number, if phoneNumberRequired
is set to true
in the request
address1
FULL
From Google documentation: The first line of the address.
address2
FULL
From Google documentation: The second line of the address.
address3
FULL
From Google documentation: The third line of the address.
locality
FULL
From Google documentation: City, town, neighborhood, or suburb.
administrativeArea
FULL
From Google documentation: A country subdivision, such as a state or province.
sortingCode
FULL
From Google documentation: The sorting code.
Address Example
Full Response Object
Last updated