- HTTP request
- Request body
- Response body
- GenerateDeviceCaptureTokenResponse
- GenerateDeviceCaptureTokenResult
- GenerateDeviceCaptureTokenResultCode
Requests a token from the integrator that can be executed on the user's device in order to debit the device's stored value. The combination of requestId
within the header and paymentIntegratorAccountId
is the idempotency key and uniquely identifies this transaction. All mutations on this transaction (refunds) populate the requestId
value in the captureRequestId
field.
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,
"minor": 1,
"revision": 0
},
"requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
"requestTimestamp": "1502220196077"
},
"paymentIntegratorAccountId": "InvisiCashUSA_USD",
"transactionDescription": "Google - Music",
"currencyCode": "JPY",
"amount": "545000000",
"deviceIdentifier": "FC199014344145",
"instanceIdentifier": "ID15626388286838485",
"sessionIdentifier": "5226453",
"balance": "16000000"
}
An example response looks like:
{
"responseHeader": {
"responseTimestamp": "1481900013178"
},
"result": {
"generateDeviceCaptureTokenResultCode": "SUCCESS"
},
"paymentIntegratorTransactionId": "aW50ZWdyYXRvciB0cmFuc2FjdGlvbiBpZA",
"deviceCaptureToken": "WW91IHN1cmUgYXJlIGN1cmlvdXMsIGFyZW4ndCB5b3U/"
}
HTTP request
POST https://www.integratorhost.example.com/integrator-base-path/value-on-device-fop-v1/generateDeviceCaptureToken
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"requestHeader": {
object ( |
Fields | |
---|---|
requestHeader |
REQUIRED: Common header for all requests. |
paymentIntegratorAccountId |
REQUIRED: This is the payment integrator account identifier that identifies contractual constraints around this transaction. |
currencyCode |
REQUIRED: ISO 4217 3-letter currency code |
amount |
REQUIRED: The amount of the purchase, in micros of the currency unit. |
transactionDescription |
REQUIRED: This is the description of the transaction that can be put on the customer's statement. Localized to the userLocale found in the |
deviceIdentifier |
REQUIRED: Identifies the device this token should be built for. This is a hardware identifier. |
instanceIdentifier |
REQUIRED: Identifies the eMoney card instance this token should be built for. |
sessionIdentifier |
OPTIONAL: An identifier for this particular transaction or session that we are executing on the Secure Element. |
balance |
OPTIONAL: The current balance on the Secure Element, in micros of the currency unit. |
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 |
|
HTTP 4XX / 5XX Status |
|
GenerateDeviceCaptureTokenResponse
Response object for the generateDeviceCaptureToken method.
JSON representation |
---|
{ "responseHeader": { object ( |
Fields | |
---|---|
responseHeader |
REQUIRED: Common header for all responses. |
paymentIntegratorTransactionId |
OPTIONAL: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this transaction by. For convenience, this identifier is included with in the remittance details |
deviceCaptureToken |
OPTIONAL: Token to be presented to the device to trigger a capture completion. This value is required if the |
result |
REQUIRED: The result of the generate device capture token call. The non-success result codes indicate that there is no need to attempt a device capture since it is guaranteed to be declined based on the state of the user's account and this transactions details. |
GenerateDeviceCaptureTokenResult
Information about the result of generating a device capture token.
JSON representation |
---|
{ "generateDeviceCaptureTokenResultCode": enum ( |
Fields | |
---|---|
generateDeviceCaptureTokenResultCode |
REQUIRED: Result code of this generate device capture token call. |
Union field
|
|
transactionMaxLimit |
OPTIONAL: If This amount is micros/micros of the same |
transactionMinLimit |
OPTIONAL: If This amount is micros/micros of the same |
GenerateDeviceCaptureTokenResultCode
Result codes for generating a device capture token.
Enums | |
---|---|
UNKNOWN_RESULT |
Do not ever set this default value! |
SUCCESS |
Device capture token generated successfully. |
CHARGE_UNDER_TRANSACTION_LIMIT |
Requested device capture amount does not meet the integrator's minimum per-transaction amount. If this code is used, populate the transactionMinLimit field with the minimum transaction amount for user messaging purposes. |
CHARGE_EXCEEDS_TRANSACTION_LIMIT |
Requested device capture amount exceeds the integrator's maximum per-transaction limit. If this code is used, populate the transactionMaxLimit field with the transaction limit for user messaging purposes. |
CHARGE_EXCEEDS_DAILY_LIMIT |
User's account cannot be used for purchases right now as it has exceeded its daily limit. If this code is used, do NOT set transactionMinLimit or transactionMaxLimit . Google does not look at those fields for this case. |
CHARGE_EXCEEDS_MONTHLY_LIMIT |
User's account cannot be used for purchases right now as it has exceeded its monthly limit. If this code is used, do NOT set transactionMinLimit or transactionMaxLimit . Google does not look at those fields for this case. |
ACCOUNT_CLOSED |
User's account held with the integrator has been closed. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
ACCOUNT_CLOSED_ACCOUNT_TAKEN_OVER |
User's account with the integrator has been closed, suspected account take over. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
ACCOUNT_CLOSED_FRAUD |
User's account held with the integrator has been closed because of fraud. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
ACCOUNT_ON_HOLD |
User's account is on hold. |
INSUFFICIENT_FUNDS |
This account does not have sufficient funds to guarantee this capture. |