Package com.google.checkout.schema._2

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


   * @return Returns the calculation results.
   */
  private List<Result> getResultList(
      final MendozaMerchantCalculation merchantCalculation) {
    log.trace("Entering getResultList");
    MerchantCalculationResults result =
      merchantCalculation.getMerchantCalculationResult();
     MerchantCalculationResults.Results results = result.getResults();
     log.trace("Leaving getResultList");
     return results.getResult();
  }
View Full Code Here


      public MerchantCalculationResults calculate(final Long buyerId,
          final ShoppingCart cart, final String language,
          final MerchantCalculationCallback callback) {
        System.out.println(
            "Merchant Sample App: Merchant calculation callback received");
        return new MerchantCalculationResults();
      };
    };

    /* Create the merchant order listener */
    OrderListener orderListener = new OrderListener() {
View Full Code Here

    Object result = calculationListener.calculate(
        getBuyerId(), getShoppingCart(), getBuyerLanguage(), this);

    if (result instanceof MerchantCalculationResults) {
      MerchantCalculationResults results = (MerchantCalculationResults) result;
      ObjectFactory factory = new ObjectFactory();
      return factory.createMerchantCalculationResults(results);
    } else if (result instanceof String) {
      String stringResult = (String) result;
      return stringResult;
View Full Code Here

      log.debug("The merchant calculation result message is not a valid XML: "
      + validationMessage);
    }

    MerchantCalculationCallback merchantCalculationCallback = null;
    MerchantCalculationResults merchantCalculationResult = null;
    try {
      /* Callback */
      JAXBElement callbackNode =
        (JAXBElement) CartUtils.unmarshal(callbackMsg);
      merchantCalculationCallback =
View Full Code Here

        || StringUtil.isEmpty(merchantOrderNumber)) {
      throw new ProtocolException("google order number " +
          "and merchant order number must not be empty");
    }
   
    AddMerchantOrderNumberRequest addOrderNumberRequest
        = _objectFact.createAddMerchantOrderNumberRequest();
    addOrderNumberRequest.setGoogleOrderNumber(googleOrderNumber);
    if (!StringUtil.isEmpty(merchantOrderNumber)) {
      addOrderNumberRequest.setMerchantOrderNumber(merchantOrderNumber);
    }
    JAXBElement<AddMerchantOrderNumberRequest> addOrderNumberElem
        = _objectFact.createAddMerchantOrderNumber(addOrderNumberRequest);
    return convertToDOM(addOrderNumberElem);
  }
View Full Code Here

   * to the shipment
   * @param courier Name of the shipment carrier
   */
  public Document addTrackingData(String orderNumber, String trackNumber,
      String courier) throws ProtocolException {
    AddTrackingDataRequest addTrackingDataRequest
        = _objectFact.createAddTrackingDataRequest();
    TrackingData trackData = _objectFact.createTrackingData();
    trackData.setTrackingNumber(trackNumber);
    trackData.setCarrier(courier);
    addTrackingDataRequest.setTrackingData(trackData);
    addTrackingDataRequest.setGoogleOrderNumber(orderNumber);
    JAXBElement<AddTrackingDataRequest> addTrackingData
        = _objectFact.createAddTrackingData(addTrackingDataRequest);
    return convertToDOM(addTrackingData);
  }
View Full Code Here

   * between 0 and 1.
   * @return {@see DefaultTaxRule} object
   */
  private AlternateTaxRule createAlternateTaxRule(
      AlternateTaxRule.TaxArea taxArea, float taxRate) {
    AlternateTaxRule aTaxRule = _objectFact.createAlternateTaxRule();
    aTaxRule.setRate(taxRate);
    aTaxRule.setTaxArea(taxArea);
    return aTaxRule;
  }
View Full Code Here

   * @return {@see DefaultTaxRule} object
   */
  private AlternateTaxRule createAlternateTaxRule(
      AlternateTaxRule.TaxAreaType taxArea, float taxRate)
      throws JAXBException {
    AlternateTaxRule aTaxRule = _objectFact.createAlternateTaxRule();
    aTaxRule.setRate(taxRate);
    aTaxRule.setTaxArea(taxArea);
    return aTaxRule;
  }
View Full Code Here

   * added to the AlternateTaxTable
   * @return AlternateTaxTable object
   */
  public AlternateTaxTable addAlternateTaxRule(AlternateTaxTable taxTable,
      AlternateTaxRule rule) throws ProtocolException {
    AlternateTaxTable returnTaxTable = taxTable;
    if (returnTaxTable == null) {
      returnTaxTable = _objectFact.createAlternateTaxTable();
    }
   
    AlternateTaxRules aRules
        = _objectFact.createAlternateTaxTableAlternateTaxRules();
    List<AlternateTaxRule> taxRuleList = aRules.getAlternateTaxRule();
    if (!taxRuleList.contains(rule) && rule != null) {
      taxRuleList.add(rule);
    }

    returnTaxTable.setAlternateTaxRules(aRules);
    return returnTaxTable;
  }
View Full Code Here

    List<AlternateTaxRule> ruleList = taxRules.getAlternateTaxRule();
    for (AlternateTaxRule rule : rules) {
      ruleList.add(rule);
    }
   
    AlternateTaxTable aTaxTable = _objectFact.createAlternateTaxTable();
    aTaxTable.setAlternateTaxRules(taxRules);
    aTaxTable.setName(taxTableName);
    aTaxTable.setStandalone(isTaxRulesStandAlone);
    return aTaxTable;
  }
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.