Examples of GiftCertificateResult


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

  * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createGiftCertResult(boolean, float, String, String)'
  */
  public void testCreateGiftCertResult() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    GiftCertificateResult gift1 = builder.createGiftCertResult(true, 100F,
        "GIFT100", "100$USD value");
    assertEquals("GIFT100", gift1.getCode());
   
    try {
      GiftCertificateResult invalidGiftCert
        = builder.createGiftCertResult(false, -100.00F, "X1093432222",
            "negative gift value");
    } catch (ProtocolException protoEx) {
      assertContains(protoEx.getMessage(), "negative");
    }
View Full Code Here

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

  * 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

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

  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

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

      throws ProtocolException {
    if (StringUtil.isEmpty(certificateCode)) {
      throw new ProtocolException();
    }
   
    GiftCertificateResult gResult = _objectFact.createGiftCertificateResult();
    gResult.setCalculatedAmount(createMoney(certificateValue));
    gResult.setCode(certificateCode);
    gResult.setValid(isCodeValid);
    gResult.setMessage(additionalMsg);
    return gResult;
  }
View Full Code Here

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

    if (StringUtil.isEmpty(certificateCode)) {
      throw new ProtocolException();
    }
   
    try {
      GiftCertificateResult gResult
        = _objectFact.createResultMerchantCodeResultsTypeGiftCertificateResult();
      gResult.setCalculatedAmount(createMoney(certificateValue));
      gResult.setCode(certificateCode);
      gResult.setValid(isCodeValid);
      gResult.setMessage(additionalMsg);
      return gResult;
    } catch (JAXBException jaxbEx) {
      throw new ProtocolException(jaxbEx.getMessage());
    }
  }
View Full Code Here

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

   * Test method for 'com.google.checkout.sample.protocol.MerchantCalculationResultBuilder.createGiftCertResult(boolean, float, String, String)'
   */
  public void testCreateGiftCertResult() throws Exception {
    MerchantCalculationResultBuilder builder
        = MerchantCalculationResultBuilder.getInstance();
    GiftCertificateResult gift1 = builder.createGiftCertResult(true, 100F,
        "GIFT100", "100$USD value");
    String giftCert1 = builder.unmarshal(builder.convertToDOM(gift1));
    assertEquals(giftResultOne, giftCert1);
   
    try {
      GiftCertificateResult invalidGiftCert
        = builder.createGiftCertResult(false, -100.00F, "X1093432222",
            "negative gift value");
    } catch (ProtocolException protoEx) {
      assertContains(protoEx.getMessage(), "negative");
    }
View Full Code Here

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

   * 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

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.