Package com.google.checkout.schema._2

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


  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createMerchantCalResults(List, List, float, float, boolean, String)'
  */
  public void testCreateMerchantCalResults() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    CouponResult coupon = builder.createCouponResult(true, 10.00F,
        "C0000111A", "normal coupon");
    GiftCertificateResult giftCert = builder.createGiftCertResult(true, 1F,
        "G10023343B", "gift certB");
   
    List couponList = new ArrayList();
View Full Code Here


      throws ProtocolException {
    if (StringUtil.isEmpty(couponCode)) {
      throw new ProtocolException("coupon code cannot be empty");
    }
   
    CouponResult cResult = _objectFact.createCouponResult();
    cResult.setCalculatedAmount(createMoney(couponValue));
    cResult.setCode(couponCode);
    cResult.setValid(isCodeValid);
    cResult.setMessage(additionalMsg);
    return cResult;
  }
View Full Code Here

   * value indicating whether tax is applied to the shipping cost
   * @return {@see DefaultTaxRule} object
   */
  private DefaultTaxRule createDefaultTaxRule(DefaultTaxRule.TaxArea taxArea,
      float taxRate, boolean isShippingTaxable) {
    DefaultTaxRule taxRule = _objectFact.createDefaultTaxRule();
    taxRule.setRate(taxRate);
    taxRule.setShippingTaxed(isShippingTaxable);
    taxRule.setTaxArea(taxArea);
    return taxRule;
  }
View Full Code Here

   * value indicating whether tax is applied to the shipping cost
   * @return {@see DefaultTaxRule} object
   */
  private DefaultTaxRule createDefaultTaxRule(DefaultTaxRule.TaxAreaType taxArea,
      float taxRate, boolean isShippingTaxable) throws JAXBException {
    DefaultTaxRule taxRule = _objectFact.createDefaultTaxRule();
    taxRule.setRate(taxRate);
    taxRule.setShippingTaxed(isShippingTaxable);
    taxRule.setTaxArea(taxArea);
    return taxRule;
  }
View Full Code Here

   * added to the DefaultTaxTable
   * @return DefaultTaxTable object
   */
  public DefaultTaxTable addDefaultTaxRule(DefaultTaxTable taxTable,
      DefaultTaxRule rule) throws ProtocolException {
    DefaultTaxTable returnTaxTable = taxTable;
    if (returnTaxTable == null) {
      returnTaxTable = _objectFact.createDefaultTaxTable();
    }
   
    TaxRules taxRules = _objectFact.createDefaultTaxTableTaxRules();
    List<DefaultTaxRule> taxRuleList = taxRules.getDefaultTaxRule();
    if (!taxRuleList.contains(rule) && rule != null) {
      taxRuleList.add(rule);
    }
   
    returnTaxTable.setTaxRules(taxRules);
    return returnTaxTable;
  }
View Full Code Here

    List<DefaultTaxRule> taxRuleList = taxRules.getDefaultTaxRule();
    for (DefaultTaxRule rule : ruleList) {
      taxRuleList.add(rule);
    }
   
    DefaultTaxTable taxTable = _objectFact.createDefaultTaxTable();
    taxTable.setTaxRules(taxRules);
    return taxTable;
  }
View Full Code Here

   * added to the DefaultTaxTable
   * @return DefaultTaxTable object
   */
  public DefaultTaxTable addDefaultTaxRule(DefaultTaxTable taxTable,
      DefaultTaxRule rule) throws ProtocolException {
    DefaultTaxTable returnTaxTable = taxTable;
   
    try {
      if (returnTaxTable == null) {
        returnTaxTable = _objectFact.createDefaultTaxTable();
      }
     
      TaxRulesType taxRules = _objectFact.createDefaultTaxTableTaxRulesType();
      List taxRuleList = taxRules.getDefaultTaxRule();
      if (!taxRuleList.contains(rule) && rule != null) {
        taxRuleList.add(rule);
      }
     
      returnTaxTable.setTaxRules(taxRules);
      return returnTaxTable;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

      List taxRuleList = taxRules.getDefaultTaxRule();
      for (int i = 0; i < ruleList.size(); i++) {
        taxRuleList.add(ruleList.get(i));
      }
     
      DefaultTaxTable taxTable = _objectFact.createDefaultTaxTable();
      taxTable.setTaxRules(taxRules);
      return taxTable;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

    DefaultTaxTable returnTaxTable = taxTable;
    if (returnTaxTable == null) {
      returnTaxTable = _objectFact.createDefaultTaxTable();
    }
   
    TaxRules taxRules = _objectFact.createDefaultTaxTableTaxRules();
    List<DefaultTaxRule> taxRuleList = taxRules.getDefaultTaxRule();
    if (!taxRuleList.contains(rule) && rule != null) {
      taxRuleList.add(rule);
    }
   
    returnTaxTable.setTaxRules(taxRules);
View Full Code Here

      throws ProtocolException {
    if (ruleList == null) {
      throw new ProtocolException("ruleList cannot be null");
    }
   
    TaxRules taxRules = _objectFact.createDefaultTaxTableTaxRules();
    List<DefaultTaxRule> taxRuleList = taxRules.getDefaultTaxRule();
    for (DefaultTaxRule rule : ruleList) {
      taxRuleList.add(rule);
    }
   
    DefaultTaxTable taxTable = _objectFact.createDefaultTaxTable();
View Full Code Here

TOP

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

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.