src/main/java/com/squareup/connect/api/V1TransactionsApi.java
public V1Payment retrievePayment(String locationId, String paymentId) 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 retrievePayment");
    }
    
    // verify the required parameter 'paymentId' is set
    if (paymentId == null) {
      throw new ApiException(400, "Missing the required parameter 'paymentId' when calling retrievePayment");
    }
    
    // create path and map variables
    String localVarPath = "/v1/{location_id}/payments/{payment_id}"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .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<V1Payment> localVarReturnType = new GenericType<V1Payment>() {};
    CompleteResponse<V1Payment> completeResponse = (CompleteResponse<V1Payment>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
/**
   * RetrievePayment
   * Provides comprehensive information for a single payment.
   * @param locationId The ID of the payment&#39;s associated location. (required)
   * @param paymentId The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint. (required)
   * @return V1Payment
   * @throws ApiException if fails to make API call
   */
RetrievePayment
Provides comprehensive information for a single payment.
@param locationId The ID of the payment's associated location. (required)
@param paymentId The Square-issued payment ID. payment_id comes from Payment objects returned by the List Payments endpoint, Settlement objects returned by the List Settlements endpoint, or Refund objects returned by the List Refunds endpoint. (required)
@return V1Payment
@throws ApiException if fails to make API call
RetrievePayment Provides comprehensive information for a single payment . @param locationId The ID of the payment ' s associated location . ( required ) @param paymentId The Square - issued payment ID . payment_id comes from Payment objects returned by the List Payments endpoint Settlement objects returned by the List Settlements endpoint or Refund objects returned by the List Refunds endpoint . ( required ) @return V1Payment @throws ApiException if fails to make API call
public V1Payment retrievePayment(String locationId, String paymentId) throws ApiException {
    Object localVarPostBody = null;
    if (locationId == null) {
      throw new ApiException(400, "Missing the required parameter 'locationId' when calling retrievePayment");
    }
    if (paymentId == null) {
      throw new ApiException(400, "Missing the required parameter 'paymentId' when calling retrievePayment");
    }
    String localVarPath = "/v1/{location_id}/payments/{payment_id}"
      .replaceAll("\\{" + "location_id" + "\\}", apiClient.escapeString(locationId.toString()))
      .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<V1Payment> localVarReturnType = new GenericType<V1Payment>() {};
    CompleteResponse<V1Payment> completeResponse = (CompleteResponse<V1Payment>)apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
    return completeResponse.getData();
      }
public V1Payment retrievePayment ( String locationId , String paymentId ) throws ApiException { Object localVarPostBody = null ; if ( locationId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'locationId' when calling retrievePayment" ) ; } if ( paymentId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'paymentId' when calling retrievePayment" ) ; } String localVarPath = "/v1/{location_id}/payments/{payment_id}" . replaceAll ( "\\{" + "location_id" + "\\}" , apiClient . escapeString ( locationId . toString ( ) ) ) . 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 < V1Payment > localVarReturnType = new GenericType < V1Payment > ( ) { } ; CompleteResponse < V1Payment > completeResponse = ( CompleteResponse < V1Payment > ) apiClient . invokeAPI ( localVarPath , "GET" , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarAccept , localVarContentType , localVarAuthNames , localVarReturnType ) ; return completeResponse . getData ( ) ; }
RetrievePayment
 Provides comprehensive information for a single payment.
RetrievePayment Provides comprehensive information for a single payment .
// verify the required parameter 'locationId' is set // verify the required parameter 'paymentId' is set // create path and map variables // query params