Package com.google.checkout

Examples of com.google.checkout.Result


        totalTax.setContent(tax);
        totalTax.setCurrency(DEFAULT_CURRENCY);
      }
      if (calcShipping) {
        for (int j = 0; j < _callback.getCalculate().getShipping().getMethodCount(); j++) {
          Result result = new Result();
          result.setAddressId(address.getId());
          result.setShippable(true);
          Method method = _callback.getCalculate().getShipping().getMethod(j);
          result.setShippingName(method.getName());
          // Load Shipping, read order:
          // 1. google.calculation.shipping.{method name}.{address region}
          // 2. google.calculation.shipping.{method name}.default
          // 3. google.calculation.shipping.default
          BigDecimal shipping = JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_SHIPPING).append(".").append(method.getName()).append(".").append(address.getRegion()).toString(), JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_SHIPPING).append(".").append(method.getName()).append(DOT_DEFAULT).toString(), defaultShipping));
          shipping = shipping.setScale(2, BigDecimal.ROUND_UP);
          if (LOG.isDebugEnabled()) {
            LOG.debug("Calculated shipping of [" + shipping + "] for [" + method.getName() + "]");
          }
          ShippingRate rate = new ShippingRate();
          rate.setContent(shipping);
          rate.setCurrency(DEFAULT_CURRENCY);
          result.setShippingRate(rate);
          if (calcTax) {
            result.setTotalTax(totalTax);
          }
          results.addResult(result);
        }
      }
      else if (calcTax) {
        Result result = new Result();
        result.setAddressId(address.getId());
        result.setTotalTax(totalTax);
        results.addResult(result);
      }
    }
    return mcResults;
  }
View Full Code Here

TOP

Related Classes of com.google.checkout.Result

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.