Google Pay™
We're working hard on finishing our Google Pay integration - the information available here is how to integrate and use it - once we're done!
This documentation is intended for merchants integrating ePay Hosted Fields directly. If you are using the ePay Payment Window, no additional setup is required for Google Pay.
We recommend that all merchants use the Quick Setup guide, as it reduces the maintenance burden on your integration. By using Quick Setup, ePay can automatically apply updates to your integration for any future changes to Google’s protocols.
Quick Setup
To integrate Google Pay, make the following changes to your implementation:
<script async
src="https://pay.google.com/gp/p/js/pay.js"
onload="onGooglePayLoaded()"></script>
</body>
...
function onGooglePayLoaded() {
var requestData = epay.getGooglePayIsReadyToPayRequest()
let googlePayClient = epay.getGooglePaymentsClient()
googlePayClient.isReadyToPay(requestData)
.then(function(response) {
if (response.result) {
addGooglePayButton();
} else {
console.error("Not adding GooglePay button - client not able to provide payment information")
}
})
.catch(function(err) {
console.error(err);
});
}
let clientReady = epay
.setSessionId("<-- sessionId here -->")
.setSessionKey("<-- sessionKey here -->")
.init();
addGooglePayButton = async () => {
await clientReady
var googlePayData = epay.getGooglePayPaymentData();
var googlePayClient = epay.getGooglePaymentsClient();
const button = googlePayClient.createButton({
onClick: epay.createGooglePayTransaction,
allowedPaymentMethods: [googlePayData.allowedPaymentMethods]
});
// <-- Add button to layout - something like -->
document.getElementById('googlePayContainer').appendChild(button);
}
Advanced Setup
If you have any special needs, like tracking, regarding Google Pay transactions and the in-app experience you can modify the payment flow by manually creating the Google Pay payment session.
Card schemes
We support the following card schemes: Visa, Mastercard, Amex, JCB and Discover for merchants in the Nordic region (Denmark including Greenland and Faroe Islands, Norway, Sweden, Finland and Iceland)
Technical details
Other rather technical details regarding GooglePay integration follow below.
TokenizationSpecification
Regarding TokenizationSpecification object, which is part of request to loadPaymentData, set the parameters accordingly:
- parameter: gateway: epay
- parameter: gatewayMerchantID set this to Point Of Sale Id - available from ePay Backoffice
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "epay",
"gatewayMerchantId": "263c20dc-20de-11f0-914a-00155d32ef77"
}
}
SCA / 3DS
Regarding strong customer authentication (3DS) for PAN_ONLY authentication method - this is - like other transactions - controlled by the scaMode parameter when initializing the payment session. Default is NORMAL and will ensure 3DS flow is attempted - further details
Billing Address
GooglePay allow filtering on cards returned by the wallet to e.g. only allow cards with full billing address specified. We don't require BillingAddressParameter to be specified. Refer to the GooglePay reference for details regarding object BillingAddressParameters