Package com.google.checkout.schema._2

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


 
  private class ChargebackEventHandler extends CallBackEventHandler
      implements ChargebackNotificationListener {
    public void handleEvent(CallBackEvent event) {
      ChargebackNotificationEvent chargeBackEvent = (ChargebackNotificationEvent) event;
      ChargebackAmountNotification chargeBack
        = chargeBackEvent.getChargeBackNote();
      assertSame(ChargebackAmountNotification.class, chargeBack.getClass());
    }
View Full Code Here


    }
   
    CheckoutFlowSupport flowSupport
        = _objectFact.createCheckoutShoppingCartCheckoutFlowSupport();
    flowSupport.setMerchantCheckoutFlowSupport(checkoutFlowSupport);
    CheckoutShoppingCart chkoutCart = _objectFact.createCheckoutShoppingCart();
    chkoutCart.setShoppingCart(cart);
    chkoutCart.setCheckoutFlowSupport(flowSupport);
    JAXBElement<CheckoutShoppingCart> elem
        = _objectFact.createCheckoutShoppingCart(chkoutCart);
    return convertToDOM(elem);
  }
View Full Code Here

   
    try {
      CheckoutFlowSupportType flowSupport
          = _objectFact.createCheckoutShoppingCartCheckoutFlowSupportType();
      flowSupport.setMerchantCheckoutFlowSupport(checkoutFlowSupport);
      CheckoutShoppingCart chkoutCart = _objectFact.createCheckoutShoppingCartElement();
      chkoutCart.setShoppingCart(cart);
      chkoutCart.setCheckoutFlowSupport(flowSupport);
         
      return convertToDOM(chkoutCart);
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
View Full Code Here

    if (cart == null) {
      throw new ProtocolException("both cart and flow support cannot be null");
    }
   
    CheckoutFlowSupport flowSupport
        = _objectFact.createCheckoutShoppingCartCheckoutFlowSupport();
    flowSupport.setMerchantCheckoutFlowSupport(checkoutFlowSupport);
    CheckoutShoppingCart chkoutCart = _objectFact.createCheckoutShoppingCart();
    chkoutCart.setShoppingCart(cart);
    chkoutCart.setCheckoutFlowSupport(flowSupport);
    JAXBElement<CheckoutShoppingCart> elem
        = _objectFact.createCheckoutShoppingCart(chkoutCart);
View Full Code Here

  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createCouponResult(boolean, float, String, String)'
  */
  public void testCreateCouponResult() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    CouponResult result1 = builder.createCouponResult(true, 10.00F,
        "C10983488", "coupon 10");
    assertEquals("C10983488", result1.getCode());
   
    try {
      CouponResult invalidCoupon
          = builder.createCouponResult(false, -100.00F, "X1093432222",
              "coupon -100");
    } catch (ProtocolException protoEx) {
      assertContains(protoEx.getMessage(), "negative");
    }
View Full Code Here

  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createMerchantCalResultsByCoupon(List, float, float, boolean, String)'
  */
  public void testCreateMerchantCalResultsByCoupon() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    CouponResult coupon1 = builder.createCouponResult(true, 10.00F,
        "C0000111A", "normal coupon");
    CouponResult coupon2 = builder.createCouponResult(false, 100.00F,
        "C123!###334A", "coupon alpha ");
    List couponList = new ArrayList();
    couponList.add(coupon1);
    couponList.add(coupon2);
   
View Full Code Here

  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createMerchantCalResults(List, List, float, float, boolean, String)'
  */
  public void testCreateMerchantCalResults() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    CouponResult coupon = builder.createCouponResult(true, 10.00F,
        "C0000111A", "normal coupon");
    GiftCertificateResult giftCert = builder.createGiftCertResult(true, 1F,
        "G10023343B", "gift certB");
   
    List couponList = new ArrayList();
View Full Code Here

      throws ProtocolException {
    if (StringUtil.isEmpty(couponCode)) {
      throw new ProtocolException("coupon code cannot be empty");
    }
   
    CouponResult cResult = _objectFact.createCouponResult();
    cResult.setCalculatedAmount(createMoney(couponValue));
    cResult.setCode(couponCode);
    cResult.setValid(isCodeValid);
    cResult.setMessage(additionalMsg);
    return cResult;
  }
View Full Code Here

   * value indicating whether tax is applied to the shipping cost
   * @return {@see DefaultTaxRule} object
   */
  private DefaultTaxRule createDefaultTaxRule(DefaultTaxRule.TaxArea taxArea,
      float taxRate, boolean isShippingTaxable) {
    DefaultTaxRule taxRule = _objectFact.createDefaultTaxRule();
    taxRule.setRate(taxRate);
    taxRule.setShippingTaxed(isShippingTaxable);
    taxRule.setTaxArea(taxArea);
    return taxRule;
  }
View Full Code Here

   * value indicating whether tax is applied to the shipping cost
   * @return {@see DefaultTaxRule} object
   */
  private DefaultTaxRule createDefaultTaxRule(DefaultTaxRule.TaxAreaType taxArea,
      float taxRate, boolean isShippingTaxable) throws JAXBException {
    DefaultTaxRule taxRule = _objectFact.createDefaultTaxRule();
    taxRule.setRate(taxRate);
    taxRule.setShippingTaxed(isShippingTaxable);
    taxRule.setTaxArea(taxArea);
    return taxRule;
  }
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.