@Test
    public void testPayment() {

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

        /* Test Card Payment */
        CardPaymentRequest req = new CardPaymentRequest();
        req.setAmount(100.00)
            .setOrderNumber(getRandomOrderId("test"));
        req.getCard()
                .setName("John Doe")
                .setNumber("5100000010001004")
                .setExpiryMonth("12")
                .setExpiryYear("18")
                .setCvd("123");

        try {

            PaymentResponse response = beanstream.payments().makePayment(req);
            System.out.println("Card Payment Approved? "+ response.isApproved());

        } catch (BeanstreamApiException ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "An error occurred", ex);
            Assert.fail(ex.getMessage());
        }

        /* Test Cash Payment */
        CashPaymentRequest cashReq = new CashPaymentRequest();
        cashReq.setAmount(123.45);
        cashReq.setOrderNumber(getRandomOrderId("cash"));

        try {

            PaymentResponse response = beanstream.payments().makePayment(cashReq);
            System.out.println("Cash Payment Approved? "+ response.isApproved());

        } catch (BeanstreamApiException ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"An error occurred", ex);
            Assert.fail(ex.getMessage());
        }

        /* Test Cheque Payment */
        ChequePaymentRequest chequeReq = new ChequePaymentRequest();
        chequeReq.setAmount(668.99);
        chequeReq.setOrderNumber(getRandomOrderId("cheque"));

        try {

            PaymentResponse response = beanstream.payments().makePayment(chequeReq);
            System.out.println("Cheque Payment Approved? "+ response.isApproved());

        } catch (BeanstreamApiException ex) {
            Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"An error occurred", ex);
            Assert.fail(ex.getMessage());
        }
    }