TopUpRedirectResponse

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