Page Summary
-
This integration example demonstrates web redirect authentication for creating payment instruments and uses tokenized First Open Payment (FOP) flows for purchases, refunds, and remittances.
-
During instrument creation, Google redirects users to the integrator's webpage for authentication, then calls the
associateAccountAPI to link the authenticated account. -
Purchases involve Google calling
generateReferenceNumberto initiate a transaction, followed by the integrator notifying Google of payment viareferenceNumberPaidNotification. -
Google utilizes
cancelReferenceNumberto cancel transactions andrefundto initiate refunds for completed transactions. -
Remittance involves Google notifying the integrator via
remittanceStatementNotification, prompting the integrator to reconcile using the Google Hosted Remittance API.
Example of an integration using web redirect authentication.
Related APIs
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

Create Instrument - Association flow

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.

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.

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.

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.