Examples of Cart


Examples of com.google.code.magja.model.cart.Cart

    }

    @Test
    public void testCreate() {
        try {
            Cart cart = service.create(0);
            if (cart == null) {
                fail("Could not create cart [cart.create]");
            }
            System.out.println("Created cart " + cart);
        } catch (ServiceException e) {
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

    public void testSetCustomer() {
        try {
            Customer customer = generateCustomer();
            customerService.save(customer);

            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);
            cart.setCustomer(customer);
            service.setCustomer(cart);
        } catch (ServiceException e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

    }

    @Test
    public void testGetLicenseAgreements() {
        try {
            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);
            service.getLicenseAgreements(cart);
            System.out.println("Received licenses: " + cart.getLicenseAgreements().size());
            for (CartLicense item : cart.getLicenseAgreements()) {
                System.out.println("    license " + item);
            }
        } catch (ServiceException e) {
            fail(e.getMessage());
        }
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

    }

    @Test
    public void testGetTotals() {
        try {
            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);
            service.getTotals(cart);
            System.out.println("Received totals: " + cart.getLicenseAgreements().size());
            for (CartTotal item : cart.getTotals()) {
                System.out.println("    total " + item);
            }
        } catch (ServiceException e) {
            fail(e.getMessage());
        }
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

    public void testGetById() {
        try {
            Customer customer = generateCustomer();
            customerService.save(customer);

            Cart cart = service.create(0);
            cart.setCustomer(customer);
            service.setCustomer(cart);

            Cart other = service.getById(cart.getId(), cart.getStoreId());
            Assert.assertEquals(cart.getId(), other.getId());
            Assert.assertEquals(cart.getStoreId(), other.getStoreId());
            Assert.assertEquals(cart.getCustomer().getId(), other.getCustomer().getId());
        } catch (ServiceException e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

            customerAddressService.save(shipAddr);
            System.out.println("Creating default bill addr");
            customerAddressService.save(billAddr);

            System.out.println("Creating cart");
            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);

            System.out.println("Setting customer");
            cart.setCustomer(customer);
            service.setCustomer(cart);

            System.out.println("Adding product");
            Product p = new Product();
            p.setSku("NI3TP");      //FIXME
            p.setId(53);            //FIXME
            service.addProduct(cart, p, 1);

            System.out.println("Setting cart addresses");
            System.err.println(shipAddr.getAllProperties());
            CartAddress cartShipAddr = CartAddress.fromAttributes(shipAddr.getAllProperties());
            CartAddress cartBillAddr = CartAddress.fromAttributes(billAddr.getAllProperties());
            cart.setBillingaddress(cartBillAddr);
            cart.setShippingAddress(cartShipAddr);
            service.setAddresses(cart);

            System.out.println("Creating order");
            service.order(cart);
        } catch (ServiceException e) {
View Full Code Here

Examples of com.google.code.magja.model.cart.Cart

  @Override
  public Cart create(Integer storeId) throws ServiceException {
    try {
      Integer id = (Integer) soapClient.call(
          ResourcePath.ShoppingCartCreate, storeId);
      Cart cart = new Cart();
      cart.setId(id);
      cart.setStoreId(storeId);
      return cart;
    } catch (AxisFault e) {
      if (debug) {
        e.printStackTrace();
      }
View Full Code Here

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

Examples of com.google.paymentexpress.jwt.Cart

      MaskedWalletRequest maskedWalletRequest = new MaskedWalletRequest(Config.MERCHANT_ID, Config.MERCHANT_SECRET, MaskedWalletRequest.Select.PAY_SHIP, mwResponse.getGoogle_transaction_id());
      maskedWalletRequest.setOrigin(origin);
     
      String desc = drink + " " + size + " " + milk;
      LineItem item = new LineItem( desc, 1, new Double(total), Config.CURRENCY);
      Cart cart = new Cart(Config.CURRENCY);
      cart.addItem(item);
     
      FullWalletRequest fullWalletRequest = new FullWalletRequest(Config.MERCHANT_ID, Config.MERCHANT_SECRET, cart, mwResponse.getGoogle_transaction_id());
      fullWalletRequest.setOrigin(origin);
     
      Velocity.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogChute");
View Full Code Here

Examples of com.ibatis.jpetstore.domain.Cart

  public String viewCart() {
    return "success";
  }

  public void clear() {
    cart = new Cart();
    workingItemId = null;
    pageDirection = null;
  }
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.