Package com.google.checkout

Examples of com.google.checkout.TotalTax


    BigDecimal defaultShipping = JavaCommerce.getConfiguration().getBigDecimal(CONFIG_GOOGLE_CALC_SHIPPING_DEFAULT, DEFAULT_SHIPPING);
   
    // Addresses is always passed according to the XSD.
    for (int i = 0; i < _callback.getCalculate().getAddresses().getAnonymousAddressCount(); i++) {
      AnonymousAddress address = _callback.getCalculate().getAddresses().getAnonymousAddress(i);
      TotalTax totalTax = null;
      if (calcTax) {
        // Get the tax rate
        BigDecimal taxRate = JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_TAX).append(".").append(address.getRegion()).toString(), defaultTax);
        // Calculate Tax
        BigDecimal tax = taxRate.multiply(orderTotal);
        tax = tax.setScale(2, BigDecimal.ROUND_UP);
        if (LOG.isDebugEnabled()) {
          LOG.debug("Calculated tax of [" + tax + "] with rate of [" + taxRate + "]");
        }
        totalTax = new TotalTax();
        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());
View Full Code Here

TOP

Related Classes of com.google.checkout.TotalTax

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.