src/main/java/com/squareup/connect/api/PaymentsApi.java
public CompleteResponse<CompletePaymentResponse>completePaymentWithHttpInfo(String paymentId) throws ApiException {
    Object localVarPostBody = null;
    
    // verify the required parameter 'paymentId' is set
    if (paymentId == null) {
      throw new ApiException(400, "Missing the required parameter 'paymentId' when calling completePayment");
    }
    
    // create path and map variables
    String localVarPath = "/v2/payments/{payment_id}/complete"
      .replaceAll("\\{" + "payment_id" + "\\}", apiClient.escapeString(paymentId.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<CompletePaymentResponse> localVarReturnType = new GenericType<CompletePaymentResponse>() {};
    return (CompleteResponse<CompletePaymentResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
/**
   * CompletePayment
   * Completes (captures) a payment.  By default, payments are set to complete immediately after they are created.  If you set autocomplete to false when creating a payment, you can complete (capture)  the payment using this endpoint. For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments).
   * @param paymentId Unique ID identifying the payment to be completed. (required)
   * @return CompleteResponse<CompletePaymentResponse>
   * @throws ApiException if fails to make API call
   */
CompletePayment
Completes (captures) a payment.  By default, payments are set to complete immediately after they are created.  If you set autocomplete to false when creating a payment, you can complete (capture)  the payment using this endpoint. For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments).
@param paymentId Unique ID identifying the payment to be completed. (required)
@return CompleteResponse
@throws ApiException if fails to make API call
CompletePayment Completes ( captures ) a payment . By default payments are set to complete immediately after they are created . If you set autocomplete to false when creating a payment you can complete ( capture ) the payment using this endpoint . For more information see [ Delayed Payments ] ( / payments - api / take - payments#delayed - payments ) . @param paymentId Unique ID identifying the payment to be completed . ( required ) @return CompleteResponse @throws ApiException if fails to make API call
public CompleteResponse<CompletePaymentResponse>completePaymentWithHttpInfo(String paymentId) throws ApiException {
    Object localVarPostBody = null;
    if (paymentId == null) {
      throw new ApiException(400, "Missing the required parameter 'paymentId' when calling completePayment");
    }
    String localVarPath = "/v2/payments/{payment_id}/complete"
      .replaceAll("\\{" + "payment_id" + "\\}", apiClient.escapeString(paymentId.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<CompletePaymentResponse> localVarReturnType = new GenericType<CompletePaymentResponse>() {};
    return (CompleteResponse<CompletePaymentResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
public CompleteResponse < CompletePaymentResponse > completePaymentWithHttpInfo ( String paymentId ) throws ApiException { Object localVarPostBody = null ; if ( paymentId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'paymentId' when calling completePayment" ) ; } String localVarPath = "/v2/payments/{payment_id}/complete" . replaceAll ( "\\{" + "payment_id" + "\\}" , apiClient . escapeString ( paymentId . 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 < CompletePaymentResponse > localVarReturnType = new GenericType < CompletePaymentResponse > ( ) { } ; return ( CompleteResponse < CompletePaymentResponse > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; }
CompletePayment
 Completes (captures) a payment.
CompletePayment Completes ( captures ) a payment .
// verify the required parameter 'paymentId' is set // create path and map variables // query params