Developer Portal

11 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.

DO NOT EXECUTE STEPS 1 OR 3 FROM A JAVASCRIPT. THESE INVOLVE DATA THAT SHOULD NOT BE PASSING THROUGH THE CLIENT BROWSER.

11.1 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.

 

11.2 Step 2: Send Queued Transaction

When you load the payment page and present the Google Pay button, you will send to the page the paywayRequestToken that was returned in step 1. No other data should be sent to the page. When the user clicks the Google Pay button, an interaction with the Google Pay payment sheet happens. When the user approves the payment, a sendQueuedTransaction request is sent by the JavaScript to Payway and the transaction is processed. Only the resultCode and paywayMessage are returned to the web page.

11.3 Step 3: Hosted Payment Results

Using the paywayRequestToken from the previous steps, you may call hostedPaymentResults to get details on the completed transaction. The account information entered by the user on the Google Pay sheet will be returned, with the credit card number masked.

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.

When this call is complete, the paywayRequestToken is invalidated on Payway. This call is optional. If you skip it, the paywayRequestToken will expire without further action.

Subscribe

Every post in your inbox