Method: capture

Initiates money movement between a customer's account held with Google and the payment processor. 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.

An example request looks like:


{
  "requestHeader": {
    "protocolVersion": {
      "major": 2
    },
    "requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ",
    "requestTimestamp": {
      "epochMillis": "1502220196077"
    },
    "paymentIntegratorAccountId": "InvisiCashUSA_USD"
  },
  "googlePaymentToken": {
    "issuerId": {
      "value": "invisicash"
    },
    "token": "ZXhhbXBsZSB1bmlxdWUgcGF5bWVudCB0b2tlbiB2YWx1ZQ"
  },
  "transactionDescription": "Google - Music",
  "amount": {
    "amountMicros": "728000000",
    "currencyCode": "INR"
  },
  "tax": {
    "amountMicros": "27300000",
    "currencyCode": "INR"
  },
  "captureContext": {}
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": {
      "epochMillis": "1481900013178"
    },
    "requestId": "bWVyY2hhbnQgdHJhbnNhY3Rpb24gaWQ"
  },
  "result": {
    "success": {}
  }
}

HTTP request

POST https://www.integratordomain.com/v2/capture

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "googlePaymentToken": {
    object (GooglePaymentToken)
  },
  "transactionDescription": string,
  "amount": {
    object (Amount)
  },
  "tax": {
    object (Amount)
  },
  "captureContext": {
    object (CaptureContext)
  },

  // Union field account_verification can be only one of the following:
  "authenticationRequestId": string,
  "otpVerification": {
    object (OtpVerification)
  }
  // End of list of possible types for union field account_verification.
}
Fields
requestHeader

object (RequestHeader)

REQUIRED: Common header for all requests.

googlePaymentToken

object (GooglePaymentToken)

REQUIRED: This is the token that both companies will use to identify the account for purchases between each other.

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.

amount

object (Amount)

REQUIRED: The amount of the purchase.

tax

object (Amount)

REQUIRED: The amount of the purchase the buyer is paying in taxes.

captureContext

object (CaptureContext)

REQUIRED: Context about this capture.

Union field account_verification.

account_verification can be only one of the following:

authenticationRequestId

string

OPTIONAL: requestId of the associated authentication request. If this is not present then no authentication can be tied to this capture.

If this is present then the user was authenticated immediately preceding this call, or was authenticated when an automated payment schedule was set up.

otpVerification

object (OtpVerification)

OPTIONAL: Data necessary to verify an OTP generated from sendOtp. This is only present if the user went through the sendOtp path.

Response body

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

Response object for the capture method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "userMessage": string,
  "result": {
    object (CaptureResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

userMessage
(deprecated)

string

OPTIONAL: A description of the result to be displayed to the user if the result is not success.

result

object (CaptureResult)

REQUIRED: Result of this capture.

CaptureContext

This object provides context about how the capture was requested.

JSON representation
{
  "userIpAddress": string
}
Fields
userIpAddress

string

OPTIONAL: This is the IP address of the user's device if the purchase was made by a user in session. If the user was not in session this will empty. If the particular contract doesn't stipulate the need for this field it will always be empty.

CaptureResult

Result codes for capture.

JSON representation
{

  // Union field result can be only one of the following:
  "success": {
    object (Empty)
  },
  "chargeExceedsTransactionLimit": {
    object (ChargeExceedsTransactionLimit)
  },
  "chargeExceedsDailyLimit": {
    object (ChargeExceedsDailyLimit)
  },
  "chargeExceedsMonthlyLimit": {
    object (ChargeExceedsMonthlyLimit)
  },
  "chargeUnderLimit": {
    object (ChargeUnderLimit)
  },
  "insufficientFunds": {
    object (InsufficientFunds)
  },
  "accountDoesNotSupportCurrency": {
    object (AccountDoesNotSuportCurrency)
  },
  "accountClosed": {
    object (AccountClosed)
  },
  "accountClosedAccountTakenOver": {
    object (AccountClosedAccountTakenOver)
  },
  "accountOnHold": {
    object (AccountOnHold)
  },
  "accountClosedFraud": {
    object (AccountClosedFraud)
  },
  "googlePaymentTokenInvalidatedByUser": {
    object (GooglePaymentTokenInvalidatedByUser)
  },
  "tokenRefreshRequired": {
    object (TokenRefreshRequired)
  },
  "otpNotMatched": {
    object (OtpNotMatched)
  },
  "otpAlreadyUsed": {
    object (OtpAlreadyUsed)
  }
  // End of list of possible types for union field result.
}
Fields

Union field result.

result can be only one of the following:

success

object (Empty)

Successful capture, deliver the goods.

chargeExceedsTransactionLimit

object (ChargeExceedsTransactionLimit)

This capture request's amount exceeds per-transaction limit. If this code is used populate the transactionLimit field for user messaging purposes.

chargeExceedsDailyLimit

object (ChargeExceedsDailyLimit)

This account cannot be used for purchases right now as it has exceeded its daily limits.

chargeExceedsMonthlyLimit

object (ChargeExceedsMonthlyLimit)

This account cannot be used for purchases right now as it has exceeded its monthly limits.

chargeUnderLimit

object (ChargeUnderLimit)

This capture request's amount does not meet the minimum transaction amount.

insufficientFunds

object (InsufficientFunds)

This account does not have sufficient funds to guarantee this capture.

accountDoesNotSupportCurrency

object (AccountDoesNotSuportCurrency)

This account does not support the requested currency.

accountClosed

object (AccountClosed)

The user's account held with the integrator has been closed.

Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again.

accountClosedAccountTakenOver

object (AccountClosedAccountTakenOver)

The user's account with the integrator has been closed, suspected account take over.

Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again.

accountOnHold

object (AccountOnHold)

The account is on hold.

accountClosedFraud

object (AccountClosedFraud)

The user's account held with the integrator has been closed because of fraud.

Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again.

googlePaymentTokenInvalidatedByUser

object (GooglePaymentTokenInvalidatedByUser)

The account is active, but the GPT has been invalidated by the user on the integrator's side.

Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again.

tokenRefreshRequired

object (TokenRefreshRequired)

Returning this requires the user to go through a refresh flow.

otpNotMatched

object (OtpNotMatched)

OTP did not match what the integrator sent.

otpAlreadyUsed

object (OtpAlreadyUsed)

OTP was already used.

ChargeExceedsTransactionLimit

JSON representation
{
  "rawResult": {
    object (RawResult)
  },
  "transactionLimit": {
    object (Amount)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

transactionLimit

object (Amount)

REQUIRED: This is the maximum amount the user could spend on a transaction.

The currencyCode of transactionLimit must match the currencyCode of the request.

ChargeExceedsDailyLimit

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

ChargeExceedsMonthlyLimit

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

ChargeUnderLimit

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

InsufficientFunds

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

AccountDoesNotSuportCurrency

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

AccountClosed

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

AccountClosedAccountTakenOver

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

AccountOnHold

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

AccountClosedFraud

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

GooglePaymentTokenInvalidatedByUser

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

TokenRefreshRequired

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

OtpNotMatched

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.

OtpAlreadyUsed

JSON representation
{
  "rawResult": {
    object (RawResult)
  }
}
Fields
rawResult

object (RawResult)

OPTIONAL: Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code–mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the scope would be "visa" and the rawCode would be whatever the VISA network returned.