Package org.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata

Examples of org.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.CIMResourceAllocationSettingDataType


   * to "PROCESSING".
   * @param orderNumber Google Checkout-assigned order number
   */
  public Document processOrder(String orderNumber)
      throws ProtocolException {
    ProcessOrderRequest processRequest
        = _objectFact.createProcessOrderRequest();
    processRequest.setGoogleOrderNumber(orderNumber);
    JAXBElement<ProcessOrderRequest> processOrder
        = _objectFact.createProcessOrder(processRequest);
    return convertToDOM(processOrder);
  }
View Full Code Here


      String currency) throws ProtocolException {
    if (StringUtil.isEmpty(reason)) {
      throw new ProtocolException("Refunding order: reason is missing!");
    }
   
    RefundOrderRequest refundRequest = _objectFact.createRefundOrderRequest();
    refundRequest.setGoogleOrderNumber(orderNumber);
    refundRequest.setReason(reason);
    if (amount > 0.0F && !StringUtil.isEmpty(currency)) {
      Money refundAmount = createMoney(amount, currency);
      refundRequest.setAmount(refundAmount);
    }
   
    JAXBElement<RefundOrderRequest> refundOrder
        = _objectFact.createRefundOrder(refundRequest);
    return convertToDOM(refundOrder);
View Full Code Here

  public Document createMerchantCalResults(
      List<CouponResult> couponList, List<GiftCertificateResult> giftCertList,
      float totalTaxAmount, float shippingRate, boolean isShippable,
      String addressId) throws ProtocolException {

    MerchantCodeResults merchantCodeResults
        = _objectFact.createResultMerchantCodeResults();
    List list = merchantCodeResults.getCouponResultOrGiftCertificateResult();
    if (couponList != null) {
      for (Object coupon : couponList) {
        list.add(coupon);
      }
    }
View Full Code Here

      boolean toEmail) throws ProtocolException {
    if (StringUtil.isEmpty(googleOrderNumber)) {
      throw new ProtocolException("google order number must not be empty");
    }

    SendBuyerMessageRequest buyerMsg = _objectFact.createSendBuyerMessageRequest();
    buyerMsg.setGoogleOrderNumber(googleOrderNumber);
    buyerMsg.setMessage(message);
    buyerMsg.setSendEmail(toEmail);
    JAXBElement<SendBuyerMessageRequest> elem
        = _objectFact.createSendBuyerMessage(buyerMsg);
    return convertToDOM(elem);
  }
View Full Code Here

   * @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

  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

      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

   */
  public Document addTrackingData(String orderNumber, String trackNumber,
      String courier) throws ProtocolException {
    AddTrackingDataRequest addTrackingDataRequest
        = _objectFact.createAddTrackingDataRequest();
    TrackingData trackData = _objectFact.createTrackingData();
    trackData.setTrackingNumber(trackNumber);
    trackData.setCarrier(courier);
    addTrackingDataRequest.setTrackingData(trackData);
    addTrackingDataRequest.setGoogleOrderNumber(orderNumber);
    JAXBElement<AddTrackingDataRequest> addTrackingData
        = _objectFact.createAddTrackingData(addTrackingDataRequest);
    return convertToDOM(addTrackingData);
View Full Code Here

TOP

Related Classes of org.dmtf.schemas.wbem.wscim._1.cim_schema._2.cim_resourceallocationsettingdata.CIMResourceAllocationSettingDataType

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.