Request object for the Generate Payment Token Redirect flow.
Here's an example of a clear text JSON request:
{
"requestHeader": {
"protocolVersion": {
"major": 1,
"minor": 1,
"revision": 0
},
"requestId": "G112YZH4XPDV88J",
"requestTimestamp": "1481907920000"
},
"paymentIntegratorAccountId": "InvisiCashUSA_USD",
"transactionAmount": {
"amountMicros": "109900000",
"currencyCode": "INR"
},
"transactionDescription": "Google Store Purchase",
"shippingAddress": {
"name": "Example Customer",
"addressLine": ["123 Main St"],
"localityName": "Springfield",
"administrativeAreaName": "CO",
"postalCodeNumber": "80309",
"countryCode": "US"
},
"shippingAddressType": "STORE",
"googleAccountDetails": {
"emailAddress": "example@gmail.com"
}
}
The GeneratePaymentTokenRedirectRequest
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 GeneratePaymentTokenRedirectRequest
must be passed through the following functions:
Base64UrlEncode(
PGPSignAndEncrypt(
{
"requestHeader": {
"protocolVersion": {
"major": 1,
"minor": 1,
"revision": 0
},
"requestId": "G112YZH4XPDV88J",
"requestTimestamp": "1481907920000"
},
"paymentIntegratorAccountId": "InvisiCashUSA_USD",
"transactionAmount": {
"amountMicros": "109900000",
"currencyCode": "INR"
},
"transactionDescription": "Google Store Purchase",
"shippingAddress": {
"name": "Example Customer",
"addressLine": ["123 Main St"],
"localityName": "Springfield",
"administrativeAreaName": "CO",
"postalCodeNumber": "80309",
"countryCode": "US"
},
"shippingAddressType": "STORE",
"googleAccountDetails": {
"emailAddress": "example@gmail.com"
}
}
)
)
or
Base64UrlEncode(
JWSignAndEncrypt(
{
"requestHeader": {
"protocolVersion": {
"major": 1,
"minor": 1,
"revision": 0
},
"requestId": "G112YZH4XPDV88J",
"requestTimestamp": "1481907920000"
},
"paymentIntegratorAccountId": "InvisiCashUSA_USD",
"transactionAmount": {
"amountMicros": "109900000",
"currencyCode": "INR"
},
"transactionDescription": "Google Store Purchase",
"shippingAddress": {
"name": "Example Customer",
"addressLine": ["123 Main St"],
"localityName": "Springfield",
"administrativeAreaName": "CO",
"postalCodeNumber": "80309",
"countryCode": "US"
},
"shippingAddressType": "STORE",
"googleAccountDetails": {
"emailAddress": "example@gmail.com"
}
}
)
)
JSON representation |
---|
{ "requestHeader": { object ( |
Fields | |
---|---|
request |
REQUIRED: Common header for all requests. |
payment |
REQUIRED: This is the payment integrator account identifier that identifies contractual constraints around this transaction. |
transaction |
REQUIRED: The amount of the transaction. |
transaction |
REQUIRED: A description of the transaction that can be shown to the user. |
shipping |
OPTIONAL: The shipping address of the customer/store. This is used when there are physical goods being shipped to the user/store. |
shipping |
OPTIONAL: Indicates the type of the shipping address. Should not be provided if shippingAddress is not provided. |
google |
OPTIONAL: This is information about the user's Google account that Google has verified. |
enableAdditionalPaymentOptions |
DEPRECATED: If present, additional payment options may be presented to the user. |
Amount
Associates an amount in micros with a currency code.
JSON representation |
---|
{ "amountMicros": string, "currencyCode": string } |
Fields | |
---|---|
amount |
REQUIRED: An amount in micros. |
currency |
REQUIRED: ISO 4217 3-letter currency code |
GoogleAccountDetails
Details about the user's Google account.
JSON representation |
---|
{ "emailAddress": string } |
Fields | |
---|---|
email |
OPTIONAL: The email address associated with the customer. |