Exemple #1
0
  /**
   * Sets some static variables during setup
   *
   * @throws KKException
   */
  public void setStaticVariables() throws KKException {
    KKConfiguration conf;
    StaticData staticData = staticDataHM.get(getStoreId());
    if (staticData == null) {
      staticData = new StaticData();
      staticDataHM.put(getStoreId(), staticData);
    }

    conf = getConfiguration(MODULE_SHIPPING_ITEM_SORT_ORDER);
    if (conf == null) {
      staticData.setSortOrder(0);
    } else {
      staticData.setSortOrder(new Integer(conf.getValue()).intValue());
    }

    conf = getConfiguration(MODULE_SHIPPING_ITEM_TAX_CLASS);
    if (conf == null) {
      staticData.setTaxClass(0);
    } else {
      staticData.setTaxClass(new Integer(conf.getValue()).intValue());
    }

    conf = getConfiguration(MODULE_SHIPPING_ITEM_ZONE);
    if (conf == null) {
      staticData.setZone(0);
    } else {
      staticData.setZone(new Integer(conf.getValue()).intValue());
    }

    conf = getConfiguration(MODULE_SHIPPING_ITEM_COST);
    if (conf == null) {
      staticData.setCost(new BigDecimal(0));
    } else {
      staticData.setCost(new BigDecimal(conf.getValue()));
    }

    conf = getConfiguration(MODULE_SHIPPING_ITEM_HANDLING);
    if (conf == null) {
      staticData.setHandling(new BigDecimal(0));
    } else {
      staticData.setHandling(new BigDecimal(conf.getValue()));
    }
  }
Exemple #2
0
  /**
   * Sets some static variables during setup
   *
   * @throws KKException
   */
  public void setStaticVariables() throws KKException {
    KKConfiguration conf;
    StaticData staticData = staticDataHM.get(getStoreId());
    if (staticData == null) {
      staticData = new StaticData();
      staticDataHM.put(getStoreId(), staticData);
    }

    conf = getEng().getConfiguration(MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER);
    if (conf == null) {
      staticData.setSortOrder(0);
    } else {
      staticData.setSortOrder(new Integer(conf.getValue()).intValue());
    }
  }
  /**
   * Sets some static variables during setup
   *
   * @throws KKException
   */
  public void setStaticVariables() throws KKException {
    KKConfiguration conf;
    StaticData staticData = staticDataHM.get(getStoreId());
    if (staticData == null) {
      staticData = new StaticData();
      staticDataHM.put(getStoreId(), staticData);
    }

    conf = getConfiguration(MODULE_ORDER_TOTAL_TAX_CLOUD_SORT_ORDER);
    if (conf == null) {
      staticData.setSortOrder(0);
    } else {
      staticData.setSortOrder(new Integer(conf.getValue()).intValue());
    }

    staticData.setLoginId(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_API_LOGIN_ID));
    staticData.setLoginKey(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_API_LOGIN_KEY));
    staticData.setAddress1(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_STORE_ADDRESS1));
    staticData.setAddress2(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_STORE_ADDRESS2));
    staticData.setCity(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_STORE_CITY));
    staticData.setState(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_STORE_STATE));
    staticData.setZip(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_STORE_ZIP));
    staticData.setUspsId(getConfigurationValue(MODULE_ORDER_TOTAL_TAX_CLOUD_USPS_USER_ID));

    // Verify and cache the origin address
    net.taxcloud.Address origin = new net.taxcloud.Address();
    origin.setAddress1(staticData.getAddress1());
    origin.setAddress2(staticData.getAddress2());
    origin.setCity(staticData.getCity());
    origin.setState(staticData.getState());
    origin.setZip5(staticData.getZip());
    net.taxcloud.Address originVerified = verifyAddress(staticData, origin);
    if (originVerified == null) {
      throw new KKException(
          "The store address for store "
              + getStoreId()
              + " could not be verified using the USPS verification service probably due to a communications problem.");
    }
    validateAddress(origin, originVerified);
    staticData.setOriginAddr(originVerified);
  }