Examples of Charge


Examples of com.stripe.model.Charge

    assertEquals(created.getId(), retrieved.getId());
  }

  @Test
  public void testChargeRefundCreateApiKey() throws StripeException {
    Charge ch = Charge.create(defaultChargeParams);
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("amount", 10);
    Refund created = ch.getRefunds().create(params, Stripe.apiKey);
    Refund retrieved = ch.getRefunds().retrieve(created.getId(), Stripe.apiKey);
    assertEquals(created.getId(), retrieved.getId());
  }
View Full Code Here

Examples of com.stripe.model.Charge

  }

  @Test
  public void testChargeRefundListAndRetrieve()
      throws StripeException {
    Charge ch = Charge.create(defaultChargeParams);
    ch = ch.refund();
    Map<String, Object> listParams = new HashMap<String, Object>();
    listParams.put("count", 1);
    Refund created = ch.getRefunds().all(listParams).getData().get(0);
    Refund retrieved = ch.getRefunds().retrieve(created.getId());
    assertEquals(created.getId(), retrieved.getId());
  }
View Full Code Here

Examples of com.stripe.model.Charge


  @Test
  public void testChargeRefundListAndRetrievePerCallAPIKey()
      throws StripeException {
    Charge ch = Charge.create(defaultChargeParams);
    ch = ch.refund();
    Map<String, Object> listParams = new HashMap<String, Object>();
    listParams.put("count", 1);
    Refund created = ch.getRefunds().all(listParams,
        Stripe.apiKey).getData().get(0);
    Refund retrieved = ch.getRefunds().retrieve(created.getId(), Stripe.apiKey);
    assertEquals(created.getId(), retrieved.getId());
  }
View Full Code Here

Examples of com.stripe.model.Charge

  @Test
  public void testChargeCapture() throws StripeException {
    Map<String, Object> options = new HashMap<String, Object>(defaultChargeParams);
    options.put("capture", false);

    Charge created = Charge.create(options);
    assertFalse(created.getCaptured());

    Charge captured = created.capture();
    assertTrue(captured.getCaptured());
  }
View Full Code Here

Examples of com.stripe.model.Charge

    assertTrue(captured.getCaptured());
  }

  @Test
  public void testChargePartialRefund() throws StripeException {
    Charge createdCharge = Charge.create(defaultChargeParams);
    Map<String, Object> refundParams = new HashMap<String, Object>();
    final Integer REFUND_AMOUNT = 50;
    refundParams.put("amount", REFUND_AMOUNT);
    Charge refundedCharge = createdCharge.refund(refundParams);
    assertFalse(refundedCharge.getRefunded());
    assertEquals(refundedCharge.getAmountRefunded(), REFUND_AMOUNT);
  }
View Full Code Here

Examples of com.stripe.model.Charge

    invalidCardParams.put("address_zip", "94024");
    invalidCardParams.put("address_line1", "42 Foo Street");
    invalidCardParams.put("exp_month", 12);
    invalidCardParams.put("exp_year", 2015);
    invalidChargeParams.put("card", invalidCardParams);
    Charge charge = Charge.create(invalidChargeParams);
    assertEquals(charge.getPaid(), true);
    assertEquals(charge.getCard().getAddressZipCheck(), "fail");
    assertEquals(charge.getCard().getAddressLine1Check(), "pass");
  }
View Full Code Here

Examples of com.stripe.model.Charge

    invalidCardParams.put("address_zip", "94024");
    invalidCardParams.put("address_line1", "42 Foo Street");
    invalidCardParams.put("exp_month", 12);
    invalidCardParams.put("exp_year", 2015);
    invalidChargeParams.put("card", invalidCardParams);
    Charge charge = Charge.create(invalidChargeParams);
    assertEquals(charge.getPaid(), true);
    assertEquals(charge.getCard().getAddressZipCheck(), "pass");
    assertEquals(charge.getCard().getAddressLine1Check(), "fail");
  }
View Full Code Here

Examples of net.sf.l2j.gameserver.handler.skillhandlers.Charge

    _skillHandler.registerSkillHandler(new Manadam());
    _skillHandler.registerSkillHandler(new Heal());
        _skillHandler.registerSkillHandler(new CombatPointHeal());
    _skillHandler.registerSkillHandler(new ManaHeal());
    _skillHandler.registerSkillHandler(new BalanceLife());
    _skillHandler.registerSkillHandler(new Charge());
    _skillHandler.registerSkillHandler(new Continuous());
    _skillHandler.registerSkillHandler(new Resurrect());
        _skillHandler.registerSkillHandler(new Spoil());
        _skillHandler.registerSkillHandler(new Sweep());
        _skillHandler.registerSkillHandler(new StrSiegeAssault());
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.task.charge.Charge

        double daysRemainingToReturn = 0;
       
        // if charges is null or empty, return the days estimated
        if (charges != null && !charges.isEmpty()) {
            // else find time remaining
            Charge previousCharge = null;
            for (Charge charge : charges) {
               
                if (previousCharge == null ) {
                    // if it is the first loop
                    previousCharge = charge;
                    daysRemainingToReturn = charge.getDaysNeededToFinish();
                } else if (charge.getDay().after(previousCharge.getDay())) {
                    // if the charge is more recent than the previous one
                    previousCharge = charge;
                    daysRemainingToReturn = charge.getDaysNeededToFinish();
                } else if (charge.getDay().equals(previousCharge.getDay())) {
                    // if the charge is the same day than the previous one
                    previousCharge = charge;
                    daysRemainingToReturn = daysRemainingToReturn + charge.getDaysNeededToFinish();
                }
            }
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.task.charge.Charge

    /**
     * test quand la task est trouv�e
     */
    public void testFindByIdWhenChargeIsFound() {
       
        Charge charge = (Charge) chargeMapper.findById(chargeToFind.getPersistanceId());
       
    assertEquals("id", chargeToFind.getPersistanceId(), charge.getPersistanceId());
    assertEquals("pmu_id", chargeToFind.getUser().getPersistanceId(), charge.getUser().getPersistanceId());
    assertEquals("day", chargeToFind.getDay(), charge.getDay());
    assertEquals("timeused", chargeToFind.getTimeUsedToday(), charge.getTimeUsedToday());
    assertEquals("daysneededtofinish", chargeToFind.getDaysNeededToFinish(), charge.getDaysNeededToFinish());
    assertEquals("version", chargeToFind.getPersistanceVersion(), charge.getPersistanceVersion());
               
    }
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.