src/main/java/com/squareup/connect/api/PaymentsApi.java
public CompleteResponse<CreatePaymentResponse>createPaymentWithHttpInfo(CreatePaymentRequest body) throws ApiException {
    Object localVarPostBody = body;
    
    // verify the required parameter 'body' is set
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createPayment");
    }
    
    // create path and map variables
    String localVarPath = "/v2/payments";

    // 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<CreatePaymentResponse> localVarReturnType = new GenericType<CreatePaymentResponse>() {};
    return (CompleteResponse<CreatePaymentResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
/**
   * CreatePayment
   * Charges a payment source, for example, a card  represented by customer&#39;s card on file or a card nonce. In addition  to the payment source, the request must also include the  amount to accept for the payment.  There are several optional parameters that you can include in the request.  For example, tip money, whether to autocomplete the payment, or a reference ID to correlate this payment with another system.  For more information about these  payment options, see [Take Payments](/payments-api/take-payments).  The &#x60;PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS&#x60; OAuth permission is required to enable application fees.
   * @param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
   * @return CompleteResponse<CreatePaymentResponse>
   * @throws ApiException if fails to make API call
   */
CreatePayment
Charges a payment source, for example, a card  represented by customer's card on file or a card nonce. In addition  to the payment source, the request must also include the  amount to accept for the payment.  There are several optional parameters that you can include in the request.  For example, tip money, whether to autocomplete the payment, or a reference ID to correlate this payment with another system.  For more information about these  payment options, see [Take Payments](/payments-api/take-payments).  The `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required to enable application fees.
@param body An object containing the fields to POST for the request.  See the corresponding object definition for field details. (required)
@return CompleteResponse
@throws ApiException if fails to make API call
CreatePayment Charges a payment source for example a card represented by customer ' s card on file or a card nonce . In addition to the payment source the request must also include the amount to accept for the payment . There are several optional parameters that you can include in the request . For example tip money whether to autocomplete the payment or a reference ID to correlate this payment with another system . For more information about these payment options see [ Take Payments ] ( / payments - api / take - payments ) . The ` PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS ` OAuth permission is required to enable application fees . @param body An object containing the fields to POST for the request . See the corresponding object definition for field details . ( required ) @return CompleteResponse @throws ApiException if fails to make API call
public CompleteResponse<CreatePaymentResponse>createPaymentWithHttpInfo(CreatePaymentRequest body) throws ApiException {
    Object localVarPostBody = body;
    if (body == null) {
      throw new ApiException(400, "Missing the required parameter 'body' when calling createPayment");
    }
    String localVarPath = "/v2/payments";
    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<CreatePaymentResponse> localVarReturnType = new GenericType<CreatePaymentResponse>() {};
    return (CompleteResponse<CreatePaymentResponse>)apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
  }
public CompleteResponse < CreatePaymentResponse > createPaymentWithHttpInfo ( CreatePaymentRequest body ) throws ApiException { Object localVarPostBody = body ; if ( body == null ) { throw new ApiException ( 400 , "Missing the required parameter 'body' when calling createPayment" ) ; } String localVarPath = "/v2/payments" ; 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 < CreatePaymentResponse > localVarReturnType = new GenericType < CreatePaymentResponse > ( ) { } ; return ( CompleteResponse < CreatePaymentResponse > ) apiClient . invokeAPI ( localVarPath , "POST" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; }
CreatePayment
 Charges a payment source, for example, a card  represented by customer&#39;s card on file or a card nonce.
CreatePayment Charges a payment source for example a card represented by customer&#39 ; s card on file or a card nonce .
// verify the required parameter 'body' is set // create path and map variables // query params