Package br.com.caelum.restbucks.model

Examples of br.com.caelum.restbucks.model.Payment


        order = resources.entryAt(uri).post(order);
       
        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();
        System.out.println(String.format("Final order placed, current status [%s]", order.getStatus()));
View Full Code Here

TOP

Related Classes of br.com.caelum.restbucks.model.Payment

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.