Package com.google.greaze.example.definition.model

Examples of com.google.greaze.example.definition.model.Cart


  }

  private static Cart createCart(String cartId, String itemName, int priceInUsd) {
    List<LineItem> lineItems =
        Lists.newArrayList(new LineItem(itemName, 1, priceInUsd*1000000, "USD"));
    return new Cart(Id.<Cart>get(cartId), lineItems, "inder", "4111-1111-1111-1111");
  }
View Full Code Here


  public static void main(String[] args) {
    ExampleClient client = new ExampleClient();
    List<LineItem> lineItems = new ArrayList<LineItem>();
    lineItems.add(new LineItem("item1", 2, 1000000L, "USD"));
  Cart cart = new Cart(lineItems, "first last", "4111-1111-1111-1111");
  String authToken = "authToken";
  Order order = client.placeOrder(cart, authToken );
  System.out.print(order);
  }
View Full Code Here

  public static void main(String[] args) {
    OrderClient client = new OrderClient();
    List<LineItem> lineItems = new ArrayList<LineItem>();
    String itemName = "cheese";
    lineItems.add(new LineItem(itemName, 2, 1000000L, "USD"));
    Cart cart = new Cart(lineItems, "Hungry Bird", "4111-1111-1111-1111");
    cart = client.createCart(cart);
    Order order = client.placeOrder(cart);
 
    System.out.println("Placed order: " + gson.toJson(order));
    List<Order> queriedOrders = client.query(itemName);
View Full Code Here

  }

  @Override
  protected WebServiceResponse buildResponse(ResponseSpec responseSpec,
      WebServiceRequest webServiceRequest) {
    Cart cart = webServiceRequest.getBody().get(TypedKeys.RequestBody.CART);
    String authToken = webServiceRequest.getHeader(TypedKeys.Request.AUTH_TOKEN);

    Order order = placeOrder(cart, authToken);

    // Empty headers per the spec
View Full Code Here

TOP

Related Classes of com.google.greaze.example.definition.model.Cart

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.