Package br.com.caelum.restbucks.model

Examples of br.com.caelum.restbucks.model.Order.pay()


        System.out.println(String.format("Order placed at [%s]", order.getSelfUri()));
       
        // Pay for the order
        Payment payment = new Payment("12345677878", "guilherme silveira", 12, 2999, order.getCost());
        System.out.println(String.format("About to create a payment resource at [%s] via PUT", resource(order).getRelation("payment").getHref()));
        payment =  order.pay(payment);
        System.out.println("Payment made, receipt created at: " + payment.getCreatedAt());

        // Check on the order status
        System.out.println(String.format("About to check order status at [%s] via GET", order.getSelfUri()));
        order = (Order) resource(order).getRelation("self").accessAndRetrieve();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.