Package com.stripe.model

Examples of com.stripe.model.ChargeRefundCollection


  @Test
  public void testChargeRefund() throws StripeException {
    Charge createdCharge = Charge.create(defaultChargeParams);
    Charge refundedCharge = createdCharge.refund();
    assertTrue(refundedCharge.getRefunded());
    ChargeRefundCollection refunds = refundedCharge.getRefunds();
    assertTrue(refunds.getData() instanceof List);
    assertEquals(1, refunds.getData().size());
    assertTrue(refunds.getData().get(0) instanceof Refund);
  }
View Full Code Here


  }

  @Test
  public void testChargeRefundUpdateApiKey() throws StripeException {
    Charge createdCharge = Charge.create(defaultChargeParams);
    ChargeRefundCollection refunds = createdCharge.refund().getRefunds();
    Refund refund = refunds.getData().get(0);

    Map<String, String> metadata = new HashMap<String, String>();
    metadata.put("foo", "bar");

    Map<String, Object> updateParams = new HashMap<String, Object>();
View Full Code Here

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

TOP

Related Classes of com.stripe.model.ChargeRefundCollection

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.