Package com.example.test.jaxb.client

Examples of com.example.test.jaxb.client.CreditCardDetailsType


    @Reference
    private CreditCardPaymentRequestClientSync syncProxy;

    @Override
    public String authorize(String creditCardNumber, String holder, float amount) {
        CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);

        try {
            return proxy.authorize(creditCard, amount);
        } catch (AuthorizeFault e) {
            return "FAIL: " + e.getFaultInfo().getErrorCode();
View Full Code Here


    }

    private CreditCardDetailsType createCreditCard(String creditCardNumber, String holder) {
        ObjectFactory factory = new ObjectFactory();
        CreditCardDetailsType creditCard = factory.createCreditCardDetailsType();
        creditCard.setCreditCardNumber(creditCardNumber);
        PayerType payer = factory.createPayerType();
        payer.setName(holder);
        creditCard.setCardOwner(payer);
        return creditCard;
    }
View Full Code Here

        creditCard.setCardOwner(payer);
        return creditCard;
    }

    public String authorizeAsync(String creditCardNumber, String holder, float amount) {
        CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);

        Response<AuthorizeResponse> respone = proxy.authorizeAsync(creditCard, amount);
        try {
            return respone.get().getStatus();
        } catch (Exception e) {
View Full Code Here

        }

    }

    public String authorizeAsyncWithCallback(String creditCardNumber, String holder, float amount) {
        CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);

        Future<?> respone = proxy.authorizeAsync(creditCard, amount, new AsyncHandler<AuthorizeResponse>() {

            @Override
            public void handleResponse(Response<AuthorizeResponse> res) {
View Full Code Here

     * A map that host the result for a given credit card
     */
    private static Map<String, String> statusMap = new HashMap<String, String>();

    public String authorizeSCAAsyncWithCallback(String creditCardNumber, String holder, float amount) {
        CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
        asyncProxy.authorizeRequestOneway(creditCard, amount);
        synchronized (statusMap) {
            while (true) {
                String status = statusMap.remove("ASYNC:" + creditCardNumber);
                if (status != null) {
View Full Code Here

            statusMap.notifyAll();
        }
    }

    public String authorizeSCAWithCallback(String creditCardNumber, String holder, float amount) {
        CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
        syncProxy.authorizeRequest(creditCard, amount);
        synchronized (statusMap) {
            while (true) {
                String status = statusMap.remove("SYNC:" + creditCardNumber);
                if (status != null) {
View Full Code Here

TOP

Related Classes of com.example.test.jaxb.client.CreditCardDetailsType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.