Describes the Merchant name and website. For more information please click the link
onGPButtonLoaded
String
No
Name of a callback function to be called when Google Pay button is loaded.
Accepts an object of type GPButtonLoadedResult.
onGetTransactionInfo
String
Yes
Name of a callback function to be called that returns the final price and tax calculations.
Please click here for the sample code
onBeforeProcessPayment
String
No
Name of a callback function to be called when consumer clicked the button but before Google Pay sheet is loaded . Usually used to make validations before the payment.
Please click here for the sample code
onProcessPayment
String
Yes
Name of a callback function to be called when Google Payment is authorized for the completion of the transaction.
This function accepts a parameter of PaymentResponse.
Please click here for the sample code
onPaymentCanceled
String
No
Name of a callback function to be called when Google Pay sheet is closed/canceled without completing the transaction.
Please click here for the sample code
environment
String
No
Google Pay Environment. Could be either “TEST“ or “PRODUCTION“.
If omitted, defaults to “TEST“
From Google documentation:
Merchant name encoded as UTF-8. Merchant name is rendered in the payment sheet. In TEST environment, or if a merchant isn't recognized, a “Pay Unverified Merchant” message is displayed in the payment sheet.
Google Pay Button loaded successfully: status = iStatus.success
Google Pay not supported: status = iStatus.unsupported
An error occurred while loading Google Pay Button: status = iStatus.error
reason
String
If Google Pay Button failed to load this field will be populated with the reason.
BillingParameters Object
Name
Type
Required
Description
transactionId
String
No
From Google documentation:
A unique ID that identifies a transaction attempt.
If not provided will be automatically generated by iFields API. Will be sent back on paymentRequest..transactionInfo response object.
allowedAuthMethods
String[]
No
If not provided will be defaulted to ["PAN_ONLY", "CRYPTOGRAM_3DS"]From Google documentation:
Fields supported to authenticate a card transaction.
PAN_ONLY: This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.
CRYPTOGRAM_3DS: This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.
allowedCardNetworks
String[]
No
If not provided will be defaulted to ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]From Google documentation:
One or more card networks that you support, also supported by the Google Pay API.
AMEX
DISCOVER
INTERAC
JCB
MASTERCARD
VISA
assuranceDetailsRequired
Boolean
No
From Google documentation:
Set to true to request assuranceDetails. This object provides information about the validation performed on the returned payment data.
billingAddressRequired
Boolean
No
From Google documentation:
Set to true if you require a billing address. A billing address should only be requested if it's required to process the transaction.
Has an effect when billingAddressRequired is set to trueFrom Google documentation:
Billing address format required to complete the transaction.
MIN: Name, country code, and postal code (default).
FULL: Name, street address, locality, region, country code, and postal code.
phoneNumberRequired
Boolean
No
Has an effect when billingAddressRequired is set to trueFrom Google documentation:
Set to true if a phone number is required to process the transaction.
When shipping is required you need to provide the name of your function that returns a list of shipping options.
For an example - please see below
onGetShippingCosts
String
No
When shipping is required you need to provide the name of your function that returns a list of shipping costs.
For an example - please see below
shippingAddressRequired
Boolean
No
From Google documentation:
Set to true to request a full shipping address..
emailRequired
Boolean
No
From Google documentation:
Set to true to request an email address.
phoneNumberRequired
Boolean
No
From Google documentation:
Set to true if a phone number is required for the provided shipping address.
allowedCountryCodes
String[]
No
From Google documentation:
ISO 3166-1 alpha-2 country code values of the countries where shipping is allowed. If this object isn't specified, will be defaulted to US only.
Shipping Parameters example
shippingParams: {
allowedCountryCodes: ['US'],
onGetShippingCosts: function (shippingData) {
logDebug({
label: "onGetShippingCosts",
data: shippingData
});
return {
"shipping-001": "0.00",
"shipping-002": "1.99",
"shipping-003": "10.00"
}
},
onGetShippingOptions: function (shippingData) {
logDebug({
label: "onGetShippingOptions",
data: shippingData
});
let selectedOptionid = "shipping-001";
if (shippingData && shippingData.shippingOptionData && shippingData.shippingOptionData.id !== "shipping_option_unselected") {
selectedOptionid = shippingData.shippingOptionData.id;
}
return {
defaultSelectedOptionId: selectedOptionid,
shippingOptions: [
{
"id": "shipping-001",
"label": "Free: Standard shipping",
"description": "Free Shipping delivered in 5 business days."
},
{
"id": "shipping-002",
"label": "$1.99: Standard shipping",
"description": "Standard shipping delivered in 3 business days."
},
{
"id": "shipping-003",
"label": "$10: Express shipping",
"description": "Express shipping delivered in 1 business day."
},
]
};
}
}