Package com.globant.google.mendoza.malbec.schema._2

Examples of com.globant.google.mendoza.malbec.schema._2.ErrorResponse


   * @param excludedAreas Optional. An ExcludedAreas object.
   */
  public ShippingRestrictions createShippingRestrictions(
      AllowedAreas allowedAreas, ExcludedAreas excludedAreas)
      throws ProtocolException {
    ShippingRestrictions restrict = _objectFact.createShippingRestrictions();
    restrict.setAllowedAreas(allowedAreas);
    restrict.setExcludedAreas(excludedAreas);
    return restrict;
  }
View Full Code Here


   * Test method for 'com.google.checkout.sample.protocol.CheckoutCartBuilder.createAllowedAreasByStates(List<USStateArea>)'
   */
  public void testCreateAllowedAreasByStates() throws Exception {
    CheckoutCartBuilder pBuilder = CheckoutCartBuilder.getInstance();
    List<USStateArea> usStateAreas = makeUSState();
    AllowedAreas allowed = pBuilder.createAllowedAreasByStates(usStateAreas);
    List<Object> testList = allowed.getUsStateAreaOrUsZipAreaOrUsCountryArea();
   
    assertNotNull(testList);
    assertEquals(testList.size(), usStateAreas.size());
  }
View Full Code Here

   * state abbreviations, U.S. zip codes or zip code patterns.
   * @return AllowedAreas object
   */
  private AllowedAreas createAllowedAreaByList(List areas)
      throws ProtocolException {
    AllowedAreas allowedAreas
        = _objectFact.createShippingRestrictionsAllowedAreas();
    List allowedList = allowedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    for (Object area : areas) {
      allowedList.add(area);
    }
    return allowedAreas;   
  }
View Full Code Here

      throws ProtocolException {
    if (biggerArea == null) {
      throw new ProtocolException("biggerArea cannot be null");
    }
   
    AllowedAreas allowedAreas
        = _objectFact.createShippingRestrictionsAllowedAreas();
    List allowedList = allowedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    USCountryArea countryArea = _objectFact.createUSCountryArea();
    countryArea.setCountryArea(biggerArea);
    allowedList.add(countryArea);
    return allowedAreas;
  }
View Full Code Here

   * state abbreviations, U.S. zip codes or zip code patterns.
   * @return ExcludedAreas object
   */
  private ExcludedAreas createExcludedAreaByList(List areas)
      throws ProtocolException {
    ExcludedAreas excludedAreas
        = _objectFact.createShippingRestrictionsExcludedAreas();
    List excludedList
        = excludedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    for (Object area : areas) {
      excludedList.add(area);
    }
    return excludedAreas;
  }
View Full Code Here

      throws ProtocolException {
    if (biggerArea == null) {
      throw new ProtocolException("biggerArea cannot be null");
    }
   
    ExcludedAreas excludedAreas
        = _objectFact.createShippingRestrictionsExcludedAreas();
    List allowedList = excludedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    USCountryArea countryArea = _objectFact.createUSCountryArea();
    countryArea.setCountryArea(biggerArea);
    allowedList.add(countryArea);
    return excludedAreas;
  }
View Full Code Here

  public void testCreateShoppingCart() throws Exception {
    CheckoutCartBuilder pBuilder = CheckoutCartBuilder.getInstance();
    List<Item> cartItems = makeCartItems();
    int cartSize = cartItems.size();
    Date cartExpiry = new Date(System.currentTimeMillis() + 3600000L);
    ShoppingCart cart = pBuilder.createShoppingCart(cartItems, cartExpiry, null);
   
    assertNotNull(cart);
    assertEquals(cart.getItems().getItem().size(), cartSize);
    assertNull(cart.getMerchantPrivateData());
  }
View Full Code Here

    if (itemList == null) {
      throw new ProtocolException("itemList cannot be null");
    }
   
    // Create the <items> tag and add each item in the list to the cart
    ShoppingCart cart = _objectFact.createShoppingCart();
    Items items = _objectFact.createShoppingCartItems();
    List<Item> item_list = items.getItem();
    for (Item item : itemList) {
      item_list.add(item);
    }
   
    cart.setItems(items);
   
    // Add the expiration date if one is provided
    if (cartExpire != null) {
      GregorianCalendar gCal = new GregorianCalendar();
      gCal.setTime(cartExpire);
      XMLGregorianCalendar xmlCalendar
          = _dataFactory.newXMLGregorianCalendar(gCal);
      CartExpiration cartExpiry = _objectFact.createCartExpiration();
      cartExpiry.setGoodUntilDate(xmlCalendar);
      cart.setCartExpiration(cartExpiry);
    }

    // Add merchantPrivateData if it is provided
    if (merchantPrivateData != null) {
      AnyType anyType = _objectFact.createAnyType();
      anyType.setAny(merchantPrivateData);
      cart.setMerchantPrivateData(anyType);
    }
   
    return cart;
  }
View Full Code Here

      throw new ProtocolException("itemList cannot be null");
    }
   
    // Create the <items> tag and add each item in the list to the cart
    ShoppingCart cart = _objectFact.createShoppingCart();
    Items items = _objectFact.createShoppingCartItems();
    List<Item> item_list = items.getItem();
    for (Item item : itemList) {
      item_list.add(item);
    }
   
    cart.setItems(items);
View Full Code Here

      for (AlternateTaxTable aTaxtable : alterTaxTableList) {
        aTaxList.add(aTaxtable);
      }
    }
   
    TaxTables taxTables = _objectFact.createTaxTables();
    taxTables.setDefaultTaxTable(defaultTaxTable);
    taxTables.setAlternateTaxTables(aTables);
   
    MerchantCheckoutFlowSupport mChkoutSupport
        = _objectFact.createMerchantCheckoutFlowSupport();
    mChkoutSupport.setContinueShoppingUrl(continueShoppingUrl);
    mChkoutSupport.setEditCartUrl(editCartUrl);
View Full Code Here

TOP

Related Classes of com.globant.google.mendoza.malbec.schema._2.ErrorResponse

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.