Package com.google.checkout.schema._2

Examples of com.google.checkout.schema._2.MerchantCalculationResults$ResultsType


    String[] itemDescs = new String[] {"mp3 player", "podcast subscription"};
    int[] quantities = new int[] {2, 1};
    float[] prices = new float[] {249.99F, 3.99F};
    List<Item> itemList = new ArrayList<Item>();
    for (int i = 0; i < itemNames.length; i++) {
      Item cartItem = pBuilder.createShoppingItem(itemNames[i], itemDescs[i],
        quantities[i], prices[i], null, null, null);
      itemList.add(cartItem);
    }
   
    return itemList;
View Full Code Here


  public Item createShoppingItem(String itemName, String itemDesc,
      int quantity, float unitPrice, String currency,
      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
    Money money = createMoney(unitPrice, currency);
    Item item = _objectFact.createItem();
    item.setItemName(itemName);
    item.setItemDescription(itemDesc);
    item.setQuantity(quantity);
    item.setUnitPrice(money);

    if (taxTableSelector != null) {
      item.setTaxTableSelector(taxTableSelector);
    }
   
    if (privateItemData != null) {
      AnyType anyType = _objectFact.createAnyType();
      anyType.setAny(privateItemData);
      item.setMerchantPrivateItemData(anyType);
    }
   
    return item;
  }
View Full Code Here

      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
   
    try {
      Money money = createMoney(unitPrice, currency);
      Item item = _objectFact.createItem();
      item.setItemName(itemName);
      item.setItemDescription(itemDesc);
      item.setQuantity(quantity);
      item.setUnitPrice(money);
 
      if (taxTableSelector != null) {
        item.setTaxTableSelector(taxTableSelector);
      }
     
      if (privateItemData != null) {
        AnyType anyType = _objectFact.createAnyType();
        anyType.setAny(privateItemData);
        item.setMerchantPrivateItemData(anyType);
      }
     
      return item;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
View Full Code Here

   * @return ShippingMethods object
   */
  public ShippingMethods createMerchantShipping(String shippingName,
      float shippingCost, String currency, ShippingRestrictions shipRestrictions)
      throws ProtocolException {
    MerchantCalculatedShipping merchantCal
        = _objectFact.createMerchantCalculatedShipping();
    merchantCal.setName(shippingName);
    merchantCal.setPrice(createMoney(shippingCost, currency));
    merchantCal.setShippingRestrictions(shipRestrictions);
    return addShippingMethod(merchantCal);
 
View Full Code Here

   */
  public ShippingMethodsType createMerchantShipping(String shippingName,
      float shippingCost, String currency, ShippingRestrictions shipRestrictions)
      throws ProtocolException {
    try {
      MerchantCalculatedShipping merchantCal
          = _objectFact.createMerchantCalculatedShipping();
      merchantCal.setName(shippingName);
      merchantCal.setPrice(createMoney(shippingCost, currency));
      merchantCal.setShippingRestrictions(shipRestrictions);
      return addShippingMethod(merchantCal);
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  } 
View Full Code Here

    individualResult.setTotalTax(createMoney(totalTaxAmount));
    individualResult.setMerchantCodeResults(merchantCodeResults);
   
    Results results = _objectFact.createMerchantCalculationResultsResults();
    results.getResult().add(individualResult);
    MerchantCalculationResults mResults
        = _objectFact.createMerchantCalculationResults();
    mResults.setResults(results);
    JAXBElement elem = _objectFact.createMerchantCalculationResults(mResults);
    return convertToDOM(elem);
  }
View Full Code Here

      individualResult.setMerchantCodeResults(merchantCodeResults);
     
      ResultsType results
          = _objectFact.createMerchantCalculationResultsResultsType();
      results.getResult().add(individualResult);
      MerchantCalculationResults mResults
          = _objectFact.createMerchantCalculationResultsElement();
      mResults.setResults(results);
      return convertToDOM(mResults);
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

    individualResult.setShippable(isShippable);
    individualResult.setShippingRate(createMoney(shippingRate));
    individualResult.setTotalTax(createMoney(totalTaxAmount));
    individualResult.setMerchantCodeResults(merchantCodeResults);
   
    Results results = _objectFact.createMerchantCalculationResultsResults();
    results.getResult().add(individualResult);
    MerchantCalculationResults mResults
        = _objectFact.createMerchantCalculationResults();
    mResults.setResults(results);
    JAXBElement elem = _objectFact.createMerchantCalculationResults(mResults);
    return convertToDOM(elem);
View Full Code Here

   * should send &lt;merchant-calculation-callback&gt; requests.
   */
  public MerchantCalculations createMerchantCalculations(boolean acceptCoupon,
      boolean acceptGiftCerts, String merchantCalculateUrl)
      throws ProtocolException {
    MerchantCalculations mCal = _objectFact.createMerchantCalculations();
    mCal.setAcceptGiftCertificates(acceptGiftCerts);
    mCal.setAcceptMerchantCoupons(acceptCoupon);
    mCal.setMerchantCalculationsUrl(merchantCalculateUrl);
    return mCal;
  }
View Full Code Here

   */
  public MerchantCalculations createMerchantCalculations(boolean acceptCoupon,
      boolean acceptGiftCerts, String merchantCalculateUrl)
      throws ProtocolException {
    try {
      MerchantCalculations mCal = _objectFact.createMerchantCalculations();
      mCal.setAcceptGiftCertificates(acceptGiftCerts);
      mCal.setAcceptMerchantCoupons(acceptCoupon);
      mCal.setMerchantCalculationsUrl(merchantCalculateUrl);
      return mCal;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of com.google.checkout.schema._2.MerchantCalculationResults$ResultsType

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.