Method: generateRedirectPaymentUrl

Provides basic information about this transaction to allow the integrator to create a redirect URL. The URL returned from a successful request will be sent to the user and the user's browser/device will be redirected to that URL.

If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type ErrorResponse.

An example request looks like:


{
  "requestHeader": {
    "protocolVersion": {
      "major": 1
    },
    "requestId": "cmVxdWVzdDE",
    "requestTimestamp": {
      "epochMillis": "1481899949606"
    },
    "paymentIntegratorAccountId": "InvisiRedirectPaymentUSA_USD"
  },
  "transactionAmount": {
    "amountMicros": "109900000",
    "currencyCode": "INR"
  },
  "transactionDescription": "Play Movies",
  "formOfPayment": {
    "issuerId": {
      "value": "123ABC"
    }
  },
  "callbackUrl": "https://example.google.com/return/url/"
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481899949611"
    }
  },
  "result": {
    "success": {
      "redirectDetails": {
        "getMethod": {
          "url": "https://example.com/target/redirect/url/"
        }
      }
    }
  }
}

HTTP request

POST https://www.integratorhost.example.com/integrator-base-path/v1/payment-integrator-redirect/generateRedirectPaymentUrl

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "transactionAmount": {
    object (Amount)
  },
  "transactionDescription": string,
  "formOfPayment": {
    object (FormOfPayment)
  },
  "callbackUrl": string
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

transactionAmount

object (Amount)

REQUIRED: The amount of the transaction.

transactionDescription

string

REQUIRED: A description of the transaction that can be shown to the user.

formOfPayment

object (FormOfPayment)

REQUIRED: The form of payment that the user already selected for this payment. If the user made no choice or it does not apply, this will be set to noneChosen. In the noneChosen case, the user should be redirected to the integrator's website to allow the user to select a form of payment.

callbackUrl

string

REQUIRED: The URL the user should be redirected to when the redirect payment is complete. The URL has a max length of 512 characters.

Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an ErrorResponse, consult the ErrorResponse object and HTTP status codes documentation.

Possible response messages
HTTP 200 Status

object (GenerateRedirectPaymentUrlResponse)

HTTP 4XX / 5XX Status

object (ErrorResponse)

GenerateRedirectPaymentUrlResponse

Response object for the redirect-fop-v1.generateRedirectPaymentUrl method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "result": {
    object (GenerateRedirectPaymentUrlResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

result

object (GenerateRedirectPaymentUrlResult)

REQUIRED: Result details of the redirect-fop-v1.generateRedirectPaymentUrl request.

GenerateRedirectPaymentUrlResult

Result details of the redirect-fop-v1.generateRedirectPaymentUrl request.

JSON representation
{

  // Union field result can be only one of the following:
  "success": {
    object (SuccessDetails)
  },
  "invalidIssuerId": {
    object (Empty)
  }
  // End of list of possible types for union field result.
}
Fields
Union field result. The result of the generate request. The message specifies if this request was successful or rejected. result can be only one of the following:
success

object (SuccessDetails)

The integrator successfully generated a redirect URL. Details about the results are within this message.

invalidIssuerId

object (Empty)

The [issuerId][google.standardpayments.redirect_fop.v1.FormOfPayment.issuer_id] in the request was not valid for this integrator.

This should only be used in cases where this form of payment is not valid in the integrator's system. It should not be used to communicate outages or other minor issues with an otherwise valid form of payment.

SuccessDetails

The integrator successfully generated a redirect URL. Details about the results are within this message.

JSON representation
{
  "redirectDetails": {
    object (RedirectDetails)
  }
}
Fields
redirectDetails

object (RedirectDetails)

REQUIRED: Details about the redirect parameters to pass on to the user's browser/device.

RedirectDetails

This contains the result of the redirectUrl request when it is supported.

JSON representation
{

  // Union field redirect_details can be only one of the following:
  "getMethod": {
    object (GetRequest)
  },
  "postFormMethod": {
    object (PostFormRequest)
  }
  // End of list of possible types for union field redirect_details.
}
Fields
Union field redirect_details. Specifies the type of redirect that will be used. redirect_details can be only one of the following:
getMethod

object (GetRequest)

The user's browser should be redirected using an HTTPS GET.

postFormMethod

object (PostFormRequest)

The user's browser should be redirected using an HTTPS POST with content time x-www-form-urlencoded.

GetRequest

This contains details for redirecting the user's browser using an HTTPS GET.

JSON representation
{
  "url": string
}
Fields
url

string

REQUIRED: The URL that the user's browser should be redirected to with a GET request. Should not exceed 2048 characters in length.

PostFormRequest

This contains details for redirecting the user's browser using an HTTPS POST.

JSON representation
{
  "url": string,
  "body": [
    {
      object (BodyPair)
    }
  ],
  "bodyEncoding": enum (BodyEncoding)
}
Fields
url

string

REQUIRED: The url the user will be redirected to. Should not exceed 2048 characters in length.

body[]

object (BodyPair)

REQUIRED: Data for the body of the POST for the redirect.

This list represents the HTTPS POST body. For example:

[ "myParammy": "Val", "otherParam": "otherVal", "repeatedParam": "val1", "repeatedParam": "val2" ]

Would be formatted as this in the POST body:

myParam=myVal&otherParam=otherVal&repeatedParam=val1&repeatedParam= val2

.

bodyEncoding

enum (BodyEncoding)

REQUIRED: The character set used for the body. UTF-8 is recommended.

BodyPair

JSON representation
{
  "name": string,
  "value": string
}
Fields
name

string

REQUIRED: Name of the parameter.

value

string

REQUIRED: Value of the parameter.

BodyEncoding

Enums
BODY_ENCODING_UNSPECIFIED DO NOT USE
BODY_ENCODING_ISO_8859_1 ISO-8859-1 character set for the POST body
BODY_ENCODING_UTF_8 UTF-8 character set for the POST body
BODY_ENCODING_US_ASCII US-ASCII character set for the POST body