Stay organized with collections
Save and categorize content based on your preferences.
Overview
Some integrators expect their payment tokens to expire. In this situation, as the token nears its expiration, Google will authenticate the user again and extend the token's expiration. This is called the refresh token flow, or re-association flow. During this flow, the integrator tells Google when the payment token expires.
How the flow works
If a token has expired, or is about to expire, this flow will go through the process of renewing the expiry date.
Refresh Token Flow
Here is a list of the object represented in the diagram above:
Google Server: The backend server at Google that sends the capture command to the Payment Integrator Server.
Payment Integrator Server: The backend server of the integrator that accepts the request for a funds capture.
In this flow, the token either has expired or is near expiry. The action begins with the Payment Integrator Server.
The Payment Integrator Server tells the Google Server that the token has expired or is about to expire.
The Google Server sends a refreshToken message to the Payment Integrator Server. This includes the authenticationRequestId, and GPT as proof of authentication.
The Payment Integrator Server refreshes the token with a new expiry date. This may occur whether the original token has expired or not.
The Payment Integrator Server sends the Google Server a Success message.
Best practices and other considerations
The googlePaymentToken sent to the Payment Integrator Server will not be a new token, but an existing token that has already been established via associateAccount. If the token is unknown an error message of FAILED_PRECONDITION should be returned.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-03 UTC."],[[["Google automatically extends expiring payment tokens through a refresh token flow, requiring re-authentication."],["Integrators inform Google of token expiration, initiating the refresh process where Google provides authentication proof."],["The integrator updates the token's expiration date and confirms success to Google, potentially declining the refresh like an initial association."],["The refresh token flow uses the existing payment token, returning an error if the token is unknown to the integrator."],["Payment tokens have a minimum lifetime of one year and the refresh process can occur before the token actually expires."]]],["The Payment Integrator Server informs the Google Server when a payment token expires or is near expiry. Google then sends a `refreshToken` message, including an `authenticationRequestId` and `GPT`, to the Payment Integrator Server. The Integrator refreshes the token with a new expiry date, which has a minimum lifetime of one year, then confirms the success to Google. The `googlePaymentToken` used in this process is an existing token, not a new one. If token is not known, it returns a `FAILED_PRECONDITION` error message.\n"]]