src/test/java/com/squareup/connect/api/TransactionsApiTest.java
@Test
    public void retrieveTransactionTest() throws ApiException {
        Transaction transaction = api.charge(locationId, new ChargeRequest()
            .idempotencyKey(UUID.randomUUID().toString())
            .amountMoney(new Money()
                .amount(200L)
                .currency("USD"))
            .cardNonce(cardNonce)).getTransaction();

        RetrieveTransactionResponse response = api.retrieveTransaction(locationId, transaction.getId());

        assertTrue(response.getErrors().isEmpty());
        assertEquals(transaction.getId(), response.getTransaction().getId());
    }
/**
     * RetrieveTransaction
     *
     * Retrieves details for a single transaction.
     *
     * @throws ApiException
     *          if the Api call fails
     */
RetrieveTransaction
Retrieves details for a single transaction.

@throws ApiException
if the Api call fails
RetrieveTransaction Retrieves details for a single transaction . @throws ApiException if the Api call fails
@Test
    public void retrieveTransactionTest() throws ApiException {
        Transaction transaction = api.charge(locationId, new ChargeRequest()
            .idempotencyKey(UUID.randomUUID().toString())
            .amountMoney(new Money()
                .amount(200L)
                .currency("USD"))
            .cardNonce(cardNonce)).getTransaction();
        RetrieveTransactionResponse response = api.retrieveTransaction(locationId, transaction.getId());
        assertTrue(response.getErrors().isEmpty());
        assertEquals(transaction.getId(), response.getTransaction().getId());
    }
@ Test public void retrieveTransactionTest ( ) throws ApiException { Transaction transaction = api . charge ( locationId , new ChargeRequest ( ) . idempotencyKey ( UUID . randomUUID ( ) . toString ( ) ) . amountMoney ( new Money ( ) . amount ( 200L ) . currency ( "USD" ) ) . cardNonce ( cardNonce ) ) . getTransaction ( ) ; RetrieveTransactionResponse response = api . retrieveTransaction ( locationId , transaction . getId ( ) ) ; assertTrue ( response . getErrors ( ) . isEmpty ( ) ) ; assertEquals ( transaction . getId ( ) , response . getTransaction ( ) . getId ( ) ) ; }
RetrieveTransaction
 Retrieves details for a single transaction.
RetrieveTransaction Retrieves details for a single transaction .