Google Pay in QuickStream
Use QuickStream to accept Google Pay with QuickStream REST API. Google Pay allows customers to make purchases using a credit or debit card from their Google wallet. As a business, accepting Google Pay makes it easy for your customers to make purchases using Google Chrome and compatible Android devices.

You can add Google Pay as a payment method to your own payment page by creating a Payment Request button using the QuickStream REST API and then provide the singleUseTokenId
to the Transactions API.
Getting started
To accept Google Pay as a payment method in QuickStream, you must integrate with the QuickStream REST API and configure your facility to accept Google Pay. Follow these steps:
- Sign in to QuickStream to Configure Google Pay and follow the instructions to accept the terms of service.
- Integrate with QuickStream REST API and refer to the guides below to implement Google Pay on the web or in-app.
Reporting
Use these methods to find Google Pay transactions made through QuickStream:
- You can find Google Pay transactions in QuickStream portal.
- Use the Transactions API to find Google Pay transactions.
- Download a CSV report containing Google Pay transactions using QuickStream portal and the REST API.
- If you have applied for BankRec, you can link QuickStream to a BankRec facility to automate in-depth bank statement reconciliation for every payment made.
Refunds
Refund Google Pay transactions using QuickStream portal and the REST API.
Settlement and response codes
- Transaction processing and settlement for cards.
- Transaction response codes for cards.
Supported browsers
Google Pay is supported on browsers and devices compatible with the Payment Request Button.
Google Pay on the Web with QuickStream REST API
Our QuickStream REST API allows you to create a Payment Request Button in your payment form with QuickStream-API.js.
Getting started
This page explains how to add Google Pay on the Web to your existing QuickStream REST API integration. If you haven't done this integration yet, refer to our API reference and the QuickStream-API.js library reference.
To get started with your Google Pay on the Web integration:
- Register with the Google Pay & Wallet Console and use the assigned merchant ID in
googleMerchantId
for your integration. - Make sure that you have received your Publishable and Secret REST API keys for our QuickStream REST API.
- Sign in to QuickStream portal and activate Google Pay.
- Create a payment form that you want to add a Google Pay button to. Your payment form is a webpage that you will display to your customers when they choose their payment method.
- Set up your back-end implementation to take a payment using the REST API by providing a
singleUseTokenId
returned by the Payment Request Button module. - Serve your application over HTTPS. This is required for test and production environments. You can use a service like ngrok to do this.
All merchants must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
How to implement Google Pay in your payment form
-
Add the QuickStream-API.js library to your payment form. For New Zealand based businesses: replace the
src
urlhttps://api.quickstream.westpac.com.au/rest/v1/quickstream-api-1.0.min.js
withhttps://quickapi.paymentsonline.co.nz/rest/v1/quickstream-api-1.0.min.js
.<script type="text/javascript" src="https://api.quickstream.westpac.com.au/rest/v1/quickstream-api-1.0.min.js"></script>
-
Add the Payment Request Button Container to your payment form that will drop-in the Google Pay button on Google Chrome and supported Android devices.
<div data-quickstream-api="paymentRequestButtonContainer"></div>
-
Initialise QuickStream-API.js with your Publishable API key for your QuickStream facility.
QuickstreamAPI.init( { publishableApiKey: "PUBLISHABLE_API_KEY" } );
-
Create the PaymentRequestConfigObject for your customer.
var config = { supplierBusinessCode: "SUPPLIER_CODE", googleMerchantId: "YOUR_GOOGLE_MERCHANT_ID", details: { total: { label: "Your company name", amount: { value: "50.00", currency: "AUD" } } } };
-
Create the Payment Request Button with the PaymentRequestConfigObject.
Handle errors or retrieve the
singleUseTokenId
property from the PaymentRequestResponseObject.QuickstreamAPI.paymentRequestButton.createButton(config, function(errors, paymentResponse) { if (errors) { // Handle errors here } else { console.log("singleUseTokenId is " + paymentResponse.singleUseTokenId); // perform the payment on your server here before calling below. paymentResponse.complete("success"); } });
Take a payment
-
After obtaining the
singleUseTokenId
pass this to your server. -
From your server, request POST
/v1/transactions
using your Secret REST API key, specifying:singleUseTokenId
: ThepaymentResponse.singleUseTokenId
from thecreateButton
function.
POST / HTTP/1.1 Host: https://api.quickstream.westpac.com.au/rest/v1/transactions Authorization: Basic A8d8sdk938damcheyt7= Idempotency-Key: a8f4bd70-5435-11ea-8d77-2e728ce88125 Content-Type: application/json { "transactionType" : "PAYMENT", "singleUseTokenId": "dec2075f-da92-49df-8a92-f7e494f89c22", "supplierBusinessCode": "SUPPLIER_CODE", "principalAmount": 5.00, "currency" : "AUD", "eci": "INTERNET", "ipAddress" : "192.168.1.1" }
See Process a transaction using a single-use-token for more.
The response contains the result of the payment.
For New Zealand based businesses: replace the
Host
url above (https://api.quickstream.westpac.com.au/rest/v1/transactions
) with the New Zealand urlhttps://quickapi.paymentsonline.co.nz/rest/v1/transactions
. You may also need to change the currency depending on your specific business needs.
Present the result
Use the status
that you received in your transaction response to present the result to your payer by updating the Payment Sheet using the PaymentRequestResponseObject complete
function.
QuickstreamAPI.paymentRequestButton.createButton(config, function(errors, paymentResponse) {
if (errors) {
// Handle errors here
} else {
// provide success or fail to present the result to the client
paymentResponse.complete("success");
}
});
Google Pay in an App with QuickStream REST API
Our QuickStream REST API allows you implement the direct integration method for Google Pay for use within an app.
Getting started
This page explains how to use Google Pay in an app with your existing QuickStream REST API integration. If you haven't done this integration yet, refer to our API reference.
To get started with your Google Pay in an App integration:
- Sign in to QuickStream portal and activate Google Pay.
- Take note of your QuickStream Community Code. This is the
gatewayMerchantId
in your integration. - Make sure that you have received your Publishable and Secret REST API keys for our QuickStream REST API.
- Set up your front-end implementation to create a Single Use Token using the Single-use-tokens API. You may wish to fetch your Publishable API Key from your server.
- Implement Google Pay as a payment method in your app.
- Set up your back-end implementation to take a payment using the Transactions API.
All merchants must adhere to the Google Pay APIs Acceptable Use Policy and accept the terms defined in the Google Pay API Terms of Service.
How to implement Google Pay in your app
First refer to the Google Pay for Payments - Overview and the Google Pay for Payments - Android Tutorial.
Part 1 - Payment configuration
In Step 1 of Google Pay for Payments - Android Tutorial:
- Under "Request a payment token for your payment provider" set these values:
gateway=qvalent
gatewayMerchantId
= your QuickStream Community Code.
- (Optional) Under "Define supported card networks" you may use your Publishable API Key to retrieve your Accepted Cards using the Businesses API.
- Under "Define supported card networks" set
allowedCardAuthMethods
PAN_ONLY
CRYPTOGRAM_3DS
(Optional) Part 2 - Display card surcharges
In Step 5 of Google Pay for Payments - Android Tutorial you may use your Publishable API Key to retrieve your Card Surcharges using the Businesses API to display this to your clients. Refer to Surcharging below for more.
Part 3 - Create a Single Use Token
In Step 6 of Google Pay for Payments - Android Tutorial retrieve a singleUseTokenId
using your Publishable API Key and the Single-use-tokens API with the following values:
supplierBusinessCode
accountType=GOOGLE_PAY
displayAccountNumber
= Retrieve it frompaymentResponse.details.paymentMethodData.info.cardDetails
googlePayToken
= Retrieve the value fromPaymentData
paymentMethodData.tokenizationData.token
.
Part 4 - Take a payment
After obtaining the singleUseTokenId
pass this to your server:
From your server, request POST /v1/transactions
using your Secret REST API key, specifying the singleUseTokenId
.
Part 5 - Present the result
In Step 6 of Google Pay for Payments - Android Tutorial process the result of the payment.
- See Process a transaction using a single-use-token for more.
- The response contains the result of the payment.
- Use the
status
that you received in your transaction response to present the result
Surcharging
Surcharging works the same as normal card payments. The Google Pay credential (i.e. DPAN or FPAN) is sent to QuickStream and QuickStream calculates the surcharge based on your Card Scheme Surcharging configuration.
However, for Google Pay, QuickStream does not know the card before the user approves the payment sheet meaning it cannot calculate and show the total amount to the user before it is approved.
By default, the payment sheet for Google Pay will show <Supplier Business Name> (surcharge may be added)
when surcharging is configured for a supplier business. Note that <Supplier Business Name>
is truncated to 18 characters if it is longer due to the limitations on the display of the label on the payment sheet for Google Pay.
You can change this label during:
- the
initialisation
of the payment sheet - the
onShippingAddressChange
event - the
onShippingOptionChange
event
See the details.total.label
property.
You may be able to use multiple line items to display a surcharge amount. For example, if you have configured all card schemes to have the same surcharge amount, you can calculate and provide the surcharge value earlier in the flow than usual.
Multiple line items
You can provide the details.displayItems
property which is an array of amount line items.
details: {
displayItems: [
{
label: "Service 1",
amount: { currency: "AUD", value: "6.00" }
},
{
label: "Service 2",
amount: { currency: "AUD", value: "4.00" }
},
{
label: "Surcharge",
amount: { currency: "AUD", value: "1.00" }
}
],
total: {
label: "Total amount",
amount: { currency: "AUD", value: "11.00" }
}
}
Google Pay only displays the line items when shipping is requested. If shipping is not requested, then Google Pay will instead display the step in the Payment Sheet to select a card to pay with.
Testing Google Pay with QuickStream
The QuickStream test environment is linked to the Google Pay TEST
environment. You can test the payment process using the Google Pay Test card suite.
- You require a Google account to access the test suite and use a Google Wallet. You may be required to add a chargeable card to your Google Wallet for the test cards to show up. Transactions in the test environment will never charge a card.
- You can use any value for
googleMerchantId
in the test environment. However, it is good practice to register a merchant ID using the Google Pay & Wallet Console in preparation for your Production integration. - Follow the Google Pay Web integration checklist
Refer to:
- the QuickStream test account numbers for approve and decline rules while testing.
- the QuickStream REST API reference for testing, duplicate payments and error handling requirements.
- the Google Pay Web developer documentation
- the Google Pay Web brand guidelines
Go Live
Once you are ready to go live you must:
- Request production access for Google Pay. Ensure you receive a Google Pay merchant ID and that you have received approval for your integration submission to get production access.
- Sign in to QuickStream portal and activate Google Pay.
- Complete your integration with the QuickStream REST API in the production environment.