use of com.stripe.model.Dispute in project stripe-java by stripe.
the class DisputeTest method testCloseDispute.
@Test
public void testCloseDispute() throws StripeException, InterruptedException {
int chargeValueCents = 100;
Charge disputedCharge = createDisputedCharge(chargeValueCents, null);
Dispute dispute = disputedCharge.getDisputeObject();
assertEquals("needs_response", dispute.getStatus());
Dispute closedDispute = dispute.close();
assertEquals(dispute.getId(), closedDispute.getId());
assertEquals("lost", closedDispute.getStatus());
}
use of com.stripe.model.Dispute in project stripe-java by stripe.
the class DisputeTest method testRetrieveDisputeWithExpand.
@Test
public void testRetrieveDisputeWithExpand() throws StripeException, InterruptedException {
int chargeValueCents = 100;
Charge disputedCharge = createDisputedCharge(chargeValueCents, null);
Dispute dispute = disputedCharge.getDisputeObject();
List<String> expandList = new LinkedList<String>();
expandList.add("charge");
Map<String, Object> retrieveParams = new HashMap<String, Object>();
retrieveParams.put("expand", expandList);
Dispute retrievedDispute = Dispute.retrieve(dispute.getId(), retrieveParams, null);
assertEquals(dispute.getId(), retrievedDispute.getId());
Charge expandedCharge = retrievedDispute.getChargeObject();
assertNotNull(expandedCharge);
assertEquals(disputedCharge.getId(), expandedCharge.getId());
Card card = (Card) expandedCharge.getSource();
assertEquals("0259", card.getLast4());
}
Aggregations