Method: generateDeviceCaptureToken

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

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.integratordomain.com/v1/generateDeviceCaptureToken

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "paymentIntegratorAccountId": string,
  "currencyCode": string,
  "amount": string,
  "transactionDescription": string,
  "deviceIdentifier": string,
  "instanceIdentifier": string,
  "sessionIdentifier": string,
  "balance": string
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

paymentIntegratorAccountId

string

REQUIRED: This is the payment integrator account identifier that identifies contractual constraints around this transaction.

currencyCode

string

REQUIRED: ISO 4217 3-letter currency code

amount

string (Int64Value format)

REQUIRED: The amount of the purchase, in micros of the currency unit.

transactionDescription

string

REQUIRED: This is the description of the transaction that can be put on the customer's statement. Localized to the userLocale found in the requestHeader. This format can be changed without notice and must never be parsed.

deviceIdentifier

string

REQUIRED: Identifies the device this token should be built for. This is a hardware identifier.

instanceIdentifier

string

REQUIRED: Identifies the eMoney card instance this token should be built for.

sessionIdentifier

string

OPTIONAL: An identifier for this particular transaction or session that we are executing on the Secure Element.

balance

string (Int64Value format)

OPTIONAL: The current balance on the Secure Element, in micros of the currency unit.

Response body

If successful, the response body contains data with the following structure:

Response object for the generateDeviceCaptureToken method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "paymentIntegratorTransactionId": string,
  "deviceCaptureToken": string,
  "result": {
    object (GenerateDeviceCaptureTokenResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

paymentIntegratorTransactionId

string

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

string

OPTIONAL: Token to be presented to the device to trigger a capture completion.

This value is required if the result is SUCCESS and should not be set if the result is anything other than SUCCESS.

result

object (GenerateDeviceCaptureTokenResult)

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 (GenerateDeviceCaptureTokenResultCode),

  // Union field FailureDetail can be only one of the following:
  "transactionMaxLimit": string,
  "transactionMinLimit": string
  // End of list of possible types for union field FailureDetail.
}
Fields
generateDeviceCaptureTokenResultCode

enum (GenerateDeviceCaptureTokenResultCode)

REQUIRED: Result code of this generate device capture token call.

Union field FailureDetail.

FailureDetail can be only one of the following:

transactionMaxLimit

string (Int64Value format)

OPTIONAL: If generateDeviceCaptureTokenResultCode is CHARGE_EXCEEDS_TRANSACTION_LIMIT then this is the value of the maximum allowable transaction. This is used for structured, user facing messaging and decline rate analysis.

This amount is micros/micros of the same currencyCode as the original generateDeviceCaptureToken method call.

transactionMinLimit

string (Int64Value format)

OPTIONAL: If generateDeviceCaptureTokenResultCode is CHARGE_UNDER_TRANSACTION_LIMIT then this is the value of the minimum allowable transaction. This is used for structured, user facing messaging and decline rate analysis.

This amount is micros/micros of the same currencyCode as the original generateDeviceCaptureToken method call.

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.