Package org.openquark.cal.internal.runtime.lecc

Examples of org.openquark.cal.internal.runtime.lecc.RTPartialApp$_11$_2


  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createMerchantCalResultsByGiftCert(List, float, float, boolean, String)'
  */
  public void testCreateMerchantCalResultsByGiftCert() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    GiftCertificateResult giftCert1 = builder.createGiftCertResult(true, 1F,
        "G100001A", "gift certA");
    GiftCertificateResult giftCert2 = builder.createGiftCertResult(true, 1F,
        "G10023343B", "gift certB");
    List giftList = new ArrayList();
    giftList.add(giftCert1);
    giftList.add(giftCert2);
   
View Full Code Here


  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();
    couponList.add(coupon);
   
View Full Code Here

    Document doc = _docBuilder.newDocument();
    Element elem = doc.createElement("item-notes");
    Text textValue = doc.createTextNode("SalesID# 3445");
    elem.appendChild(textValue);
   
    Item item = pBuilder.createShoppingItem(itemName, itemDesc, quantity,
      unitPrice, null, currency, elem);
   
    assertEquals(itemName, item.getItemName());
    assertEquals(itemDesc, item.getItemDescription());
    assertEquals(quantity, item.getQuantity());
    assertEquals(4999.99F, item.getUnitPrice().getValue().floatValue());
    assertEquals(currency, item.getUnitPrice().getCurrency());
    assertEquals(elem, item.getMerchantPrivateItemData().getAny());
  }
View Full Code Here

    String[] itemDescs = new String[] {"mp3 player", "podcast subscription"};
    int[] quantities = new int[] {2, 1};
    float[] prices = new float[] {249.99F, 3.99F};
    List<Item> itemList = new ArrayList<Item>();
    for (int i = 0; i < itemNames.length; i++) {
      Item cartItem = pBuilder.createShoppingItem(itemNames[i], itemDescs[i],
        quantities[i], prices[i], null, null, null);
      itemList.add(cartItem);
    }
   
    return itemList;
View Full Code Here

  public Item createShoppingItem(String itemName, String itemDesc,
      int quantity, float unitPrice, String currency,
      String taxTableSelector, Element privateItemData)
      throws ProtocolException {
    Money money = createMoney(unitPrice, currency);
    Item item = _objectFact.createItem();
    item.setItemName(itemName);
    item.setItemDescription(itemDesc);
    item.setQuantity(quantity);
    item.setUnitPrice(money);

    if (taxTableSelector != null) {
      item.setTaxTableSelector(taxTableSelector);
    }
   
    if (privateItemData != null) {
      AnyType anyType = _objectFact.createAnyType();
      anyType.setAny(privateItemData);
      item.setMerchantPrivateItemData(anyType);
    }
   
    return item;
  }
View Full Code Here

   * @return ShippingMethods object
   */
  public ShippingMethods createMerchantShipping(String shippingName,
      float shippingCost, String currency, ShippingRestrictions shipRestrictions)
      throws ProtocolException {
    MerchantCalculatedShipping merchantCal
        = _objectFact.createMerchantCalculatedShipping();
    merchantCal.setName(shippingName);
    merchantCal.setPrice(createMoney(shippingCost, currency));
    merchantCal.setShippingRestrictions(shipRestrictions);
    return addShippingMethod(merchantCal);
 
View Full Code Here

   * should send &lt;merchant-calculation-callback&gt; requests.
   */
  public MerchantCalculations createMerchantCalculations(boolean acceptCoupon,
      boolean acceptGiftCerts, String merchantCalculateUrl)
      throws ProtocolException {
    MerchantCalculations mCal = _objectFact.createMerchantCalculations();
    mCal.setAcceptGiftCertificates(acceptGiftCerts);
    mCal.setAcceptMerchantCoupons(acceptCoupon);
    mCal.setMerchantCalculationsUrl(merchantCalculateUrl);
    return mCal;
  }
View Full Code Here

   
    TaxTables taxTables = _objectFact.createTaxTables();
    taxTables.setDefaultTaxTable(defaultTaxTable);
    taxTables.setAlternateTaxTables(aTables);
   
    MerchantCheckoutFlowSupport mChkoutSupport
        = _objectFact.createMerchantCheckoutFlowSupport();
    mChkoutSupport.setContinueShoppingUrl(continueShoppingUrl);
    mChkoutSupport.setEditCartUrl(editCartUrl);
    mChkoutSupport.setMerchantCalculations(couponInfo);
    mChkoutSupport.setShippingMethods(methods);
    mChkoutSupport.setTaxTables(taxTables);
    return mChkoutSupport;
  }
View Full Code Here

   * @param amount Numeric amount to charge the customer.
   * @param currency 3-letter ISO-4217 currency code: USD, JPY, GBP
   */
  public Document chargeOrder(String orderNumber, float amount, String currency)
      throws ProtocolException {
    Money money = createMoney(amount, currency);
    ChargeOrderRequest chargeReq = _objectFact.createChargeOrderRequest();
    chargeReq.setGoogleOrderNumber(orderNumber);
    chargeReq.setAmount(money);
    JAXBElement<ChargeOrderRequest> elem
        = _objectFact.createChargeOrder(chargeReq);
View Full Code Here

   
    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);
View Full Code Here

TOP

Related Classes of org.openquark.cal.internal.runtime.lecc.RTPartialApp$_11$_2

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.