@Test
    public void testVoidPayment() {

        Gateway beanstream = new Gateway("v1", 300200578,
                "4BaD82D9197b4cc4b70a221911eE9f70");

        CardPaymentRequest paymentRequest = new CardPaymentRequest();
        paymentRequest.setAmount(90.00);
        paymentRequest.setOrderNumber(getRandomOrderId("PEDRO"));
        paymentRequest.getCard()
                .setName("John Doe")
                .setNumber("5100000010001004")
                .setExpiryMonth("12")
                .setExpiryYear("18")
                .setCvd("123");

        try {
            PaymentResponse response = beanstream.payments().makePayment(paymentRequest);
            if (response.isApproved()) {
                Gson gsonpp = new GsonBuilder().setPrettyPrinting().create();
                System.out.println("Your Payment has been approved response: \n"+ gsonpp.toJson(response));

                response = beanstream.payments().voidPayment(response.id, 90.00);

                if ("VP".equals(response.type)) {
                    System.out.println("The payment was voided");

                } else {
                    System.out.println("The payment was not voided");
                }
            }
        } catch (BeanstreamApiException ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,
                    "An error occurred", ex);
            Assert.fail(ex.getMessage());
        }

    }