Package com.google.checkout.schema._2

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


      String currency) throws ProtocolException {
    if (StringUtil.isEmpty(reason)) {
      throw new ProtocolException("Refunding order: reason is missing!");
    }
   
    RefundOrderRequest refundRequest = _objectFact.createRefundOrderRequest();
    refundRequest.setGoogleOrderNumber(orderNumber);
    refundRequest.setReason(reason);
    if (amount > 0.0F && !StringUtil.isEmpty(currency)) {
      Money refundAmount = createMoney(amount, currency);
      refundRequest.setAmount(refundAmount);
    }
   
    JAXBElement<RefundOrderRequest> refundOrder
        = _objectFact.createRefundOrder(refundRequest);
    return convertToDOM(refundOrder);
View Full Code Here


      for (Object giftCert : giftCertList) {
        list.add(giftCert);
      }
    }
   
    Result individualResult = _objectFact.createResult();
    individualResult.setAddressId(addressId);
    individualResult.setShippable(isShippable);
    individualResult.setShippingRate(createMoney(shippingRate));
    individualResult.setTotalTax(createMoney(totalTaxAmount));
    individualResult.setMerchantCodeResults(merchantCodeResults);
   
    Results results = _objectFact.createMerchantCalculationResultsResults();
    results.getResult().add(individualResult);
    MerchantCalculationResults mResults
        = _objectFact.createMerchantCalculationResults();
View Full Code Here

  public Document createMerchantCalResults(
      List<CouponResult> couponList, List<GiftCertificateResult> giftCertList,
      float totalTaxAmount, float shippingRate, boolean isShippable,
      String addressId) throws ProtocolException {

    MerchantCodeResults merchantCodeResults
        = _objectFact.createResultMerchantCodeResults();
    List list = merchantCodeResults.getCouponResultOrGiftCertificateResult();
    if (couponList != null) {
      for (Object coupon : couponList) {
        list.add(coupon);
      }
    }
View Full Code Here

  private class RiskAlertEventHandler extends CallBackEventHandler
      implements RiskInformationNotificationListener {
    public void handleEvent(CallBackEvent event) {
      RiskInformationNotificationEvent riskEvent = (RiskInformationNotificationEvent) event;
      RiskInformationNotification riskNote = riskEvent.getRiskNote();
      assertSame(RiskInformationNotification.class, riskNote.getClass());
    }
View Full Code Here

      boolean toEmail) throws ProtocolException {
    if (StringUtil.isEmpty(googleOrderNumber)) {
      throw new ProtocolException("google order number must not be empty");
    }

    SendBuyerMessageRequest buyerMsg = _objectFact.createSendBuyerMessageRequest();
    buyerMsg.setGoogleOrderNumber(googleOrderNumber);
    buyerMsg.setMessage(message);
    buyerMsg.setSendEmail(toEmail);
    JAXBElement<SendBuyerMessageRequest> elem
        = _objectFact.createSendBuyerMessage(buyerMsg);
    return convertToDOM(elem);
  }
View Full Code Here

   * @param excludedAreas Optional. An ExcludedAreas object.
   */
  public ShippingRestrictions createShippingRestrictions(
      AllowedAreas allowedAreas, ExcludedAreas excludedAreas)
      throws ProtocolException {
    ShippingRestrictions restrict = _objectFact.createShippingRestrictions();
    restrict.setAllowedAreas(allowedAreas);
    restrict.setExcludedAreas(excludedAreas);
    return restrict;
  }
View Full Code Here

   */
  public ShippingRestrictions createShippingRestrictions(
      AllowedAreasType allowedAreas, ExcludedAreasType excludedAreas)
      throws ProtocolException {
    try {
      ShippingRestrictions restrict = _objectFact.createShippingRestrictions();
      restrict.setAllowedAreas(allowedAreas);
      restrict.setExcludedAreas(excludedAreas);
      return restrict;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

   * Test method for 'com.google.checkout.sample.protocol.CheckoutCartBuilder.createAllowedAreasByStates(List<USStateArea>)'
   */
  public void testCreateAllowedAreasByStates() throws Exception {
    CheckoutCartBuilder pBuilder = CheckoutCartBuilder.getInstance();
    List<USStateArea> usStateAreas = makeUSState();
    AllowedAreas allowed = pBuilder.createAllowedAreasByStates(usStateAreas);
    List<Object> testList = allowed.getUsStateAreaOrUsZipAreaOrUsCountryArea();
   
    assertNotNull(testList);
    assertEquals(testList.size(), usStateAreas.size());
  }
View Full Code Here

   * state abbreviations, U.S. zip codes or zip code patterns.
   * @return AllowedAreas object
   */
  private AllowedAreas createAllowedAreaByList(List areas)
      throws ProtocolException {
    AllowedAreas allowedAreas
        = _objectFact.createShippingRestrictionsAllowedAreas();
    List allowedList = allowedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    for (Object area : areas) {
      allowedList.add(area);
    }
    return allowedAreas;   
  }
View Full Code Here

      throws ProtocolException {
    if (biggerArea == null) {
      throw new ProtocolException("biggerArea cannot be null");
    }
   
    AllowedAreas allowedAreas
        = _objectFact.createShippingRestrictionsAllowedAreas();
    List allowedList = allowedAreas.getUsStateAreaOrUsZipAreaOrUsCountryArea();
    USCountryArea countryArea = _objectFact.createUSCountryArea();
    countryArea.setCountryArea(biggerArea);
    allowedList.add(countryArea);
    return allowedAreas;
  }
View Full Code Here

TOP

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

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.