use of com.stripe.model.EvidenceDetails in project stripe-java by stripe.
the class DisputeTest method testSubmitEvidence.
@Test
public void testSubmitEvidence() throws StripeException, InterruptedException {
int chargeValueCents = 100;
Charge disputedCharge = createDisputedCharge(chargeValueCents, null);
Dispute initialDispute = disputedCharge.getDisputeObject();
assertNull(initialDispute.getEvidence());
EvidenceSubObject emptyEvidence = new EvidenceSubObject();
assertEquals(emptyEvidence, initialDispute.getEvidenceSubObject());
assertEquals(0, initialDispute.getEvidenceDetails().getSubmissionCount().intValue());
Map<String, Object> evidenceHashParams = new HashMap<String, Object>();
// TODO: assert on all param types
evidenceHashParams.put("product_description", "my productDescription");
evidenceHashParams.put("customer_name", "my customerName");
evidenceHashParams.put("uncategorized_text", "my uncategorizedText");
Map<String, Object> providedEvidenceParams = ImmutableMap.<String, Object>of("evidence", evidenceHashParams);
Dispute updatedDispute = disputedCharge.updateDispute(providedEvidenceParams);
assertNotNull(updatedDispute);
EvidenceSubObject evidenceSubObject = updatedDispute.getEvidenceSubObject();
assertNotSame(emptyEvidence, evidenceSubObject);
assertEquals(1, updatedDispute.getEvidenceDetails().getSubmissionCount().intValue());
assertNull(updatedDispute.getEvidence());
assertEquals("my productDescription", evidenceSubObject.getProductDescription());
assertEquals("my customerName", evidenceSubObject.getCustomerName());
assertEquals("my uncategorizedText", evidenceSubObject.getUncategorizedText());
EvidenceDetails evidenceDetails = updatedDispute.getEvidenceDetails();
assertNotNull(evidenceDetails);
assertEquals(1, evidenceDetails.getSubmissionCount().intValue());
}
Aggregations