One Time Payment Code Flow

Reference Number Use Case

Example of an integration using web redirect authentication.

Authentication flow

API implemented by integrator: Web Authentication.

Association flow

API implemented by integrator: associateAccount on Payment Integrator Hosted Tokenized FOP API.

Purchase flow

API implemented by integrator: generateReferenceNumber and cancelReferenceNumber on Payment Integrator Hosted Tokenized FOP API.

API implemented by Google: referenceNumberPaidNotification on Google Hosted Tokenized FOP API.

Refund flow

API implemented by integrator: refund on Payment Integrator Hosted Tokenized FOP API.

Remittance flow

API implemented by integrator: See Payment Integrator Hosted Remittance API.

API implemented by Google: See Google Hosted Remittance API.

How all flows fit together

Create Instrument

On Google's UI, a user is redirected to an integrator hosted web page to do Web Authentication. After successful authentication, the user is redirected back to Google. And then Google will call associateAccount. The requestId in authenticationResponse will be the authenticationRequestId of associateAccount request. After successful association, Google stores googlePaymentToken(GPT) and other metadata as an instrument for the user.

Create Instrument - Authentication flow

Web Authentication Flow

Create Instrument - Association flow

Association flow diagram

Generate reference number

When the user wants to buy goods/services with the instrument, Google calls generateReferenceNumber with GPT. The requestId within the header of the generateReferenceNumber request will be used to identify the transaction for related APIs.

Cash Generate Reference Number

Pay reference number

After the user pays the reference number offline, integrator will call referenceNumberPaidNotification. The requestId within the header of the generateReferenceNumber request will be the generateReferenceNumberRequestId of referenceNumberPaidNotification request.

Pay reference number flow

Cancel a transaction

If the user decides to cancel the transaction before paying, Google will call cancelReferenceNumber. The requestId within the header of the generateReferenceNumber request will be the generateReferenceNumberRequestId of cancelReferenceNumber request.

Refund a transaction

After the reference number is paid, if the user wants the money back, Google will call refund. The requestId within the header of the generateReferenceNumber request will be the transactionId of refund request.

Refund flow

Remittance

Based on contract, Google will call remittanceStatementNotification to notify integrator when statement is ready. Then, integrator will call Google Hosted Remittance API to perform reconciliation.