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)
  },
  "cardNotActivated": {
    object (Empty)
  },
  "cardNumberInvalid": {
    object (Empty)
  },
  "cardExpired": {
    object (Empty)
  },
  "cardExpirationDateInvalid": {
    object (Empty)
  },
  "cardIssuanceDateInvalid": {
    object (Empty)
  },
  "cardHolderNameInvalid": {
    object (Empty)
  },
  "restrictedCard": {
    object (Empty)
  },
  "invalidCardDetails": {
    object (Empty)
  },
  "insufficientFunds": {
    object (InsufficientFunds)
  },
  "notSupportedByIssuer": {
    object (Empty)
  },
  "declinedByIssuer": {
    object (DeclinedByIssuer)
  }
  // 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.

cardNotActivated

object (Empty)

The card has not been activated.

cardNumberInvalid

object (Empty)

The card number is invalid.

cardExpired

object (Empty)

The card has expired.

cardExpirationDateInvalid

object (Empty)

The expiration date on the card was invalid.

cardIssuanceDateInvalid

object (Empty)

The issuance date on the card was invalid.

cardHolderNameInvalid

object (Empty)

The card holder name on the card was invalid.

restrictedCard

object (Empty)

The card is restricted from making this type of purchase.

invalidCardDetails

object (Empty)

This decline code should never be used in steady-state. It is meant as a temporary code to use when the integrator encounters a generic invalid card information decline code from the underlying issuer of the user's instrument. This result code can be used while the integrator determines a more appropriate result code to use or negotiates the addition of a new result code to this specification.

Declined because the card details, while formatted correctly, were invalid. (e.g. The card holder name was invalid).

insufficientFunds

object (InsufficientFunds)

This account does not have sufficient funds to guarantee this redirect payment.

notSupportedByIssuer

object (Empty)

The issuer can not support a redirect payment for this request.

declinedByIssuer

object (DeclinedByIssuer)

This decline code should never be used in steady-state. It is meant as a temporary catch-all code to use when the integrator encounters an unknown decline code from the underlying issuer of the user's instrument. This result code can be used while the integrator determines a more appropriate result code to use or negotiates the addition of a new result code to this specification.

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