TopUpRedirectResponse
Stay organized with collections
Save and categorize content based on your preferences.
Response object for the Top-Up Redirect flow.
Here's an example of a clear text JSON request:
{
"redirectRequestId": "cmVxdWVzdDE",
"success": {
"currentBalance": {
"amountMicros": "51000000",
"currencyCode": "USD"
}
}
}
The TopUpRedirectResponse
is encrypted and signed using PGP or JWE+JWS. Further, this value is web-safe base64 encoded. This encoding is referred to below as Base64UrlEncode
. In other words, the clear text JSON version of the TopUpRedirectResponse
must be passed through the following functions:
Base64UrlEncode(
PGPSignAndEncrypt(
{
"redirectRequestId": "cmVxdWVzdDE",
"success": {
"currentBalance": {
"amountMicros": "51000000",
"currencyCode": "USD"
}
}
}
)
)
or
Base64UrlEncode(
JWSignAndEncrypt(
{
"redirectRequestId": "cmVxdWVzdDE",
"success": {
"currentBalance": {
"amountMicros": "51000000",
"currencyCode": "USD"
}
}
}
)
)
JSON representation |
{
"redirectRequestId": string,
// Union field redirectResult can be only one of the following:
"success": {
object (TopUpSuccess )
},
"abandoned": {
object (Empty)
},
"errorResponse": {
object (CompleteRedirectErrorResponse )
}
// End of list of possible types for union field redirectResult .
} |
Fields |
redirectRequestId |
string
REQUIRED: Unique identifier of the initiating redirect request. This is a string that has a max length of 100 characters, and contains only the characters "a-z", "A-Z", "0-9", ":", "-", and "_".
|
Union field redirectResult . REQUIRED: The result of the top-up redirect. redirectResult can be only one of the following: |
success |
object (TopUpSuccess )
Indicates the redirect completed successfully and the user added at least some amount of money to their balance.
|
abandoned |
object (Empty)
Indicates the user abandoned the top-up flow without adding any funds.
|
errorResponse |
object (CompleteRedirectErrorResponse )
Details if the redirect failed because of an error.
|
TopUpSuccess
Details about a successful top-up.
JSON representation |
{
"currentBalance": {
object (Amount)
}
} |
Fields |
currentBalance |
object (Amount)
OPTIONAL: The user's new current balance after topping up. Providing this value allows Google to determine whether the user can proceed with the current purchase or if another top-up is necessary.
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-29 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 2025-07-29 UTC."],[[["\u003cp\u003e\u003ccode\u003eTopUpRedirectResponse\u003c/code\u003e is the response object for the Top-Up Redirect flow and is encrypted, signed (PGP or JWE+JWS), and base64 encoded.\u003c/p\u003e\n"],["\u003cp\u003eIt includes details about the redirect result, which can indicate success, abandonment, or an error.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful top-up (\u003ccode\u003esuccess\u003c/code\u003e), it may optionally provide the user's updated balance in \u003ccode\u003ecurrentBalance\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eredirectRequestId\u003c/code\u003e is a required field and serves as the unique identifier for the initiating redirect request.\u003c/p\u003e\n"],["\u003cp\u003eThe response contains a union field \u003ccode\u003eredirectResult\u003c/code\u003e that indicates the outcome of the top-up flow with possible values \u003ccode\u003esuccess\u003c/code\u003e, \u003ccode\u003eabandoned\u003c/code\u003e, or \u003ccode\u003eerrorResponse\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `TopUpRedirectResponse` object provides results of a top-up attempt. It's encrypted and signed via PGP or JWE+JWS, then `Base64UrlEncode`d. It contains a `redirectRequestId` and a `redirectResult`, which can be `success`, `abandoned`, or `errorResponse`. `success` includes the user's `currentBalance`, `abandoned` indicates no funds added, and `errorResponse` signals failure. The `TopUpSuccess` object details the successful top-up, showing the new balance.\n"],null,["# TopUpRedirectResponse\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [TopUpSuccess](#TopUpSuccess)\n - [JSON representation](#TopUpSuccess.SCHEMA_REPRESENTATION)\n\nResponse object for the Top-Up Redirect flow.\n\nHere's an example of a clear text JSON request: \n\n\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n\nThe `TopUpRedirectResponse` is encrypted and signed using PGP or JWE+JWS. Further, this value is web-safe base64 encoded. This encoding is referred to below as `Base64UrlEncode`. In other words, the clear text JSON version of the `TopUpRedirectResponse` must be passed through the following functions: \n\n Base64UrlEncode(\n PGPSignAndEncrypt(\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n )\n )\n\nor \n\n Base64UrlEncode(\n JWSignAndEncrypt(\n {\n \"redirectRequestId\": \"cmVxdWVzdDE\",\n \"success\": {\n \"currentBalance\": {\n \"amountMicros\": \"51000000\",\n \"currencyCode\": \"USD\"\n }\n }\n }\n )\n )\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"redirectRequestId\": string, // Union field `redirectResult` can be only one of the following: \"success\": { object (/pay/korea-e-wallets-v1/google-korea-e-wallets-api/TopUpRedirectResponse#TopUpSuccess) }, \"abandoned\": { object (/pay/korea-e-wallets-v1/payment-integrator-korea-e-wallets-api/Empty) }, \"errorResponse\": { object (/pay/korea-e-wallets-v1/google-korea-e-wallets-api/CompleteRedirectErrorResponse) } // End of list of possible types for union field `redirectResult`. } ``` |\n\n| Fields ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `redirectRequestId` | `string` **REQUIRED**: Unique identifier of the initiating redirect request. This is a string that has a max length of 100 characters, and contains only the characters \"a-z\", \"A-Z\", \"0-9\", \":\", \"-\", and \"_\". |\n| Union field `redirectResult`. **REQUIRED** : The result of the top-up redirect. `redirectResult` can be only one of the following: ||\n| `success` | `object (`[TopUpSuccess](/pay/korea-e-wallets-v1/google-korea-e-wallets-api/TopUpRedirectResponse#TopUpSuccess)`)` Indicates the redirect completed successfully and the user added at least some amount of money to their balance. |\n| `abandoned` | `object (`[Empty](/pay/korea-e-wallets-v1/payment-integrator-korea-e-wallets-api/Empty)`)` Indicates the user abandoned the top-up flow without adding any funds. |\n| `errorResponse` | `object (`[CompleteRedirectErrorResponse](/pay/korea-e-wallets-v1/google-korea-e-wallets-api/CompleteRedirectErrorResponse)`)` Details if the redirect failed because of an error. |\n\nTopUpSuccess\n------------\n\nDetails about a successful top-up.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------|\n| ``` { \"currentBalance\": { object (/pay/korea-e-wallets-v1/payment-integrator-korea-e-wallets-api/Amount) } } ``` |\n\n| Fields ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `currentBalance` | `object (`[Amount](/pay/korea-e-wallets-v1/payment-integrator-korea-e-wallets-api/Amount)`)` **OPTIONAL**: The user's new current balance after topping up. Providing this value allows Google to determine whether the user can proceed with the current purchase or if another top-up is necessary. |"]]