Package org.apache.tuscany.sca.itest.policies

Examples of org.apache.tuscany.sca.itest.policies.Customer


    private Map<String, Customer> customers = new HashMap<String, Customer>();
   
   
    @Init
    public void init() {
        Customer c1 = new Customer();
        c1.setId("001");
        c1.setName("John Smith");
        CreditCard creditCard = new CreditCard();
        creditCard.setNumber("1234-5678-1234");
        creditCard.setType("Visa");
        creditCard.setOwner("John Smith");
        creditCard.setExpMonth(6);
        creditCard.setExpYear(2015);
        c1.setCreditCard(creditCard);
        customers.put(c1.getId(), c1);
       
        Customer c2 = new Customer();
        c2.setId("002");
        c2.setName("Jane Smith");
        creditCard = new CreditCard();
        creditCard.setNumber("1234-5678-5678");
        creditCard.setType("MasterCard");
        creditCard.setOwner("Jane Smith");
        creditCard.setExpMonth(9);
        creditCard.setExpYear(2012);
        c2.setCreditCard(creditCard);
        customers.put(c2.getId(), c2);
    }
View Full Code Here


    @Authentication
    @Requires({Confidentiality.CONFIDENTIALITY_MESSAGE, Confidentiality.CONFIDENTIALITY_TRANSPORT})
    protected CreditCardPayment creditCardPayment;

    public String charge(String customerID, float amount) {
        Customer customer = customerRegistry.find(customerID);
        CreditCard creditCard = customer.getCreditCard();
        String status = creditCardPayment.authorize(creditCard, amount);
        return status;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.itest.policies.Customer

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.