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()));