Payway GooglePay Integration Guide - DesignRev4
Payway GooglePay Integration Guide - DesignRev4
RELATED DOCUMENTATION 3
INTRODUCTION 4
A. BRAND GUIDELINES 5
B. DEVELOPER DOCUMENTATION 5
C. INTEGRATION CHECKLIST 5
X. INTEGRATION STEPS 7
2
Revision History
Date Initials Comments
9/20/2019 DN Initial Revision.
4/20/2020 DN Add Google required sections
Related Documentation
3
Introduction
This document provides a guide to integrating Google Pay™ into your web applications.
Google Pay provides a secure, wallet-based payment method for your users. Payway®
provides the RESTtful web service with which you will interact to implement your Google
Pay interface.
The PaywayWS Integration Guide will describe the general integration process including
accessing our development, staging, and production servers.
The user can pay for products and services using a Google Pay button you present on your
web page. PaywayWS decrypts and manages the encrypted data and the interaction with the
payment processors.
4
V. Managing Google Pay Data Collection
The included Google Pay JavaScript provides a section that controls the collection of
payment data by your application. This controls the payment sheet and required fields that
are presented when a user processes a payment with Google Pay. This can be set up to
collect a minimum of cardholder name and zip, or full data including phone number. Note
that requiring all data may require the user to modify their Google payment account since
the Google Pay page will enforce your requirements. All request and reply fields are
documented by Google here:
https://developers.google.com/pay/api/web/reference/object#PaymentOptions
https://developers.google.com/pay/api/web/guides/brand-guidelines
B. Developer Documentation
The main resource page for Google Pay integrations is here:
https://developers.google.com/pay/api/web/overview
C. Integration Checklist
The checklist below is helpful as a reference to guide your integration. You will be
connected to Payway’s development server during the development phase. See the
PaywayWS Integration guide for information on development and staging servers.
https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-
checklist
5
VIII. Terms of Service
You will be directed to agree to the terms of service when you are ready to implement
Google Pay in production.
https://payments.developers.google.com/terms/sellertos
6
X. Integration Steps
Processing a Google Pay payment is done in three steps. The first step and the final step
are executed from your server. Step two is handled in the JavaScript that we provide, and
you modify according to your needs. During a Google Pay transaction, only the
paywayRequestToken, resultCode, and paywayMessage are available to the browser. See
the PaywayWS Integration Guide for details on data fields.
Below is a diagram of the steps for a PaywayWS enabled Google Pay transaction.
7
A. Step 1: Queue Transaction
Before presenting the page with the Google Pay button, you will send PaywayWS a
queueSale or queueAuthorize request. This request will return a
paywayRequestToken that will be used to complete the request.
The purpose of this request is to avoid sending transaction information to the browser
that can be manipulated by the user. The queued payment includes the payment
amount, source id, and payment type. Once this step is completed the Google Pay
button can be displayed on your page. Note you should not send a
paywaySessionToken to the web site, this can be accessed by the user and used for
unauthorized transactions.
At this point you can store and/or present any of this information to the user for
receipt purposes or other processing. This interaction is between your server and
PaywayWS so none of this information is available to the browser during the
transaction.
8
XI. Code Details
A. Queue Transaction
See the PaywayWS-Integration-Guide for details and samples of the queueSale and
queueAuthorize transactions.
B. GooglePay.js JavaScript
To integrate with Payway’s Google Pay offering, start with the sample JavaScript
called GooglePay.js. This contains all features you need to integrate the web client
with Google Pay.
billingAddressRequired: true,
billingAddressParameters:
// MUST BE AT LEAST ‘MIN’ but ‘FULL’ recommended
{
format : 'MIN', // ‘FULL' for complete address info
phoneNumberRequired : true
}
9
E. Additional Cardholder Data
Some account data accepted by Payway will not appear on the Google Pay billing
sheet. For example, email address can be added to your payment page and sent in
along with the Google Pay encrypted data.
H. OnGooglePayLoaded()
This method creates a payments client, checks if Google Pay is ready,
and sets up the payment gateway parameters.
tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'payway',
'gatewayMerchantId': 'exampleGatewayMerchantId'
}
10
I. onGooglePaymentButtonClicked()
The payment data request is set up, and the payment is processed. Note that in
processPayment, the PaywayWS request is created and sent to Payway.
The googlePayToken field is set to the encrypted Google Pay paymentData, and the
paywayRequestToken is taken from the page. Other PaywayWS fields can be sent in
this request, such as email.
cardAccount :
{
accountNotes1: "notes1",
accountNotes2: "notes2",
accountNotes3: "notes3"
}
11