src/main/java/com/squareup/connect/api/TransactionsApi.java
@Deprecated
  public CaptureTransactionResponse captureTransaction(String locationId, String transactionId) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'locationId' is set
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling captureTransaction");
    }
    
    // verify the required parameter 'transactionId' is set
    if (transactionId == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionId' when calling captureTransaction");
    }
    
    // create path and map variables
    String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/capture"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .replaceAll("\\{" + "transaction_id" + "\\}", apiClient.escapeString(transactionId.toString()));

    // query params
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "oauth2" };

    GenericType<CaptureTransactionResponse> localVarReturnType = new GenericType<CaptureTransactionResponse>() {};
    CompleteResponse<CaptureTransactionResponse> completeResponse = (CompleteResponse<CaptureTransactionResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * CaptureTransaction
   * Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;.  See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
   * @param locationId  (required)
   * @param transactionId  (required)
   * @return CaptureTransactionResponse
   * @throws ApiException if fails to make API call
   */
CaptureTransaction
Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`.  See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information.
@param locationId  (required)
@param transactionId  (required)
@return CaptureTransactionResponse
@throws ApiException if fails to make API call
CaptureTransaction Captures a transaction that was created with the [ Charge ] ( #endpoint - charge ) endpoint with a ` delay_capture ` value of ` true ` . See [ Delayed capture transactions ] ( / payments / transactions / overview#delayed - capture ) for more information . @param locationId ( required ) @param transactionId ( required ) @return CaptureTransactionResponse @throws ApiException if fails to make API call
@Deprecated
  public CaptureTransactionResponse captureTransaction(String locationId, String transactionId) throws ApiException {
    Object localVarPostBody = null;
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling captureTransaction");
    }
    if (transactionId == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionId' when calling captureTransaction");
    }
    String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/capture"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .replaceAll("\\{" + "transaction_id" + "\\}", apiClient.escapeString(transactionId.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    localVarHeaderParams.put("Square-Version", "2019-11-20");
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    String[] localVarAuthNames = new String[] { "oauth2" };
    GenericType<CaptureTransactionResponse> localVarReturnType = new GenericType<CaptureTransactionResponse>() {};
    CompleteResponse<CaptureTransactionResponse> completeResponse = (CompleteResponse<CaptureTransactionResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
@ Deprecated public CaptureTransactionResponse captureTransaction ( String locationId , String transactionId ) throws ApiException { Object localVarPostBody = null ; if ( locationId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'locationId' when calling captureTransaction" ) ; } if ( transactionId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'transactionId' when calling captureTransaction" ) ; } String localVarPath = "/v2/locations/{location_id}/transactions/{transaction_id}/capture" . replaceAll ( "\\{" + "location_id" + "\\}" , apiClient . escapeString ( locationId . toString ( ) ) ) . replaceAll ( "\\{" + "transaction_id" + "\\}" , apiClient . escapeString ( transactionId . toString ( ) ) ) ; List < Pair > localVarQueryParams = new ArrayList < Pair > ( ) ; Map < String , String > localVarHeaderParams = new HashMap < String , String > ( ) ; Map < String , Object > localVarFormParams = new HashMap < String , Object > ( ) ; localVarHeaderParams . put ( "Square-Version" , "2019-11-20" ) ; final String [ ] localVarAccepts = { "application/json" } ; final String localVarAccept = apiClient . selectHeaderAccept ( localVarAccepts ) ; final String [ ] localVarContentTypes = { "application/json" } ; final String localVarContentType = apiClient . selectHeaderContentType ( localVarContentTypes ) ; String [ ] localVarAuthNames = new String [ ] { "oauth2" } ; GenericType < CaptureTransactionResponse > localVarReturnType = new GenericType < CaptureTransactionResponse > ( ) { } ; CompleteResponse < CaptureTransactionResponse > completeResponse = ( CompleteResponse < CaptureTransactionResponse > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
CaptureTransaction
 Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a &#x60;delay_capture&#x60; value of &#x60;true&#x60;.
CaptureTransaction Captures a transaction that was created with the [ Charge ] ( #endpoint - charge ) endpoint with a &#x60 ; delay_capture&#x60 ; value of &#x60 ; true&#x60 ; .
// verify the required parameter 'locationId' is set // verify the required parameter 'transactionId' is set // create path and map variables // query params