Method: captureFundsReservation

Initiates a capture of the funds reserved by a reserveFunds call.

This initiates money movement by capturing funds that were previous reserved in a call to reserveFunds. The reserveFundsRequestId specifies which funds reservation is to be captured. The amount captured can be less than or equal to the amount reserved but each reservation may only be captured once. The combination of requestId within the header and paymentIntegratorAccountId is the idempotency key and uniquely identifies this transaction. All mutations on this transaction (refund) populate the requestId value in their 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": 0,
      "revision": 0
    },
    "requestId": "G112YZH4XPDV88J",
    "requestTimestamp": "1481907920000"
  },
  "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR",
  "reserveFundsRequestId": "G1MQ0YERJ0Q7LPM",
  "amount": "728000000"
}

An example response looks like:


{
  "responseHeader": {
    "responseTimestamp": "1481907920760"
  },
  "result": "SUCCESS",
  "paymentIntegratorCaptureId": "invicash/ID::1323_abc"
}

HTTP request

POST https://www.integratorhost.example.com/integrator-base-path/redirect-payment-token-v1/captureFundsReservation

Request body

The request body contains data with the following structure:

JSON representation
{
  "requestHeader": {
    object (RequestHeader)
  },
  "paymentIntegratorAccountId": string,
  "reserveFundsRequestId": string,
  "amount": 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.

reserveFundsRequestId

string

REQUIRED: requestId of the reserve funds call for this transaction.

amount

string (Int64Value format)

REQUIRED: The amount of the purchase, in micros of the currency unit specified in the prior funds reservation. This amount can be less than or equal to the amount specified in the prior funds reservation. An example situation when this would occur would be, if Google runs out of stock for one item in a an order with multiple items.

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 (CaptureFundsReservationResponse)

HTTP 4XX / 5XX Status

object (ErrorResponse)

CaptureFundsReservationResponse

Response object for the capture method.

JSON representation
{
  "responseHeader": {
    object (ResponseHeader)
  },
  "paymentIntegratorCaptureId": string,
  "result": enum (CaptureReservedFundsResultCode),
  "rawResult": {
    object (RawResult)
  }
}
Fields
responseHeader

object (ResponseHeader)

REQUIRED: Common header for all responses.

paymentIntegratorCaptureId

string

REQUIRED: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this capture by.

For convenience, this identifier is included with in the remittance details

result

enum (CaptureReservedFundsResultCode)

REQUIRED: Result of this capture.

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.

This value is required if the result is not SUCCESS.

CaptureReservedFundsResultCode

Result codes for capture.

Enums
CAPTURE_RESERVED_FUNDS_RESULT_CODE_UNSPECIFIED Do not ever set this default value!
SUCCESS Successful capture, deliver the goods.
FUNDS_RESERVATION_EXPIRED The associated funds reservation has expired.