// This test relies on the server asynchronously marking the charge as disputed.
// TODO: find a more reliable way to do this instead of sleeping
private Charge createDisputedCharge(int chargeValueCents, RequestOptions options) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException, InterruptedException {
		Map<String, Object> chargeParams = new HashMap<String, Object>();
		chargeParams.putAll(defaultChargeParams);
		chargeParams.put("amount", chargeValueCents);
		chargeParams.put("source", "tok_createDispute");
		Charge charge = Charge.create(chargeParams, options);
		// This test relies on the server asynchronously marking the charge as disputed.
		// TODO: find a more reliable way to do this instead of sleeping
		Thread.sleep(10000);
		Map<String, Object> retrieveParams = new HashMap<String, Object>();
		retrieveParams.put("expand[]", "dispute");
		return Charge.retrieve(charge.getId(), retrieveParams, options);
	}
chargeParams.put("source", "tok_createDispute");
Charge charge = Charge.create(chargeParams, options);
// This test relies on the server asynchronously marking the charge as disputed.
// TODO: find a more reliable way to do this instead of sleeping
Thread.sleep(10000);
Map<String, Object> retrieveParams = new HashMap<String, Object>();
private Charge createDisputedCharge(int chargeValueCents, RequestOptions options) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException, InterruptedException {
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.putAll(defaultChargeParams);
chargeParams.put("amount", chargeValueCents);
chargeParams.put("source", "tok_createDispute");
Charge charge = Charge.create(chargeParams, options);
// This test relies on the server asynchronously marking the charge as disputed.
// TODO: find a more reliable way to do this instead of sleeping
Thread.sleep(10000);
Map<String, Object> retrieveParams = new HashMap<String, Object>();
retrieveParams.put("expand[]", "dispute");
return Charge.retrieve(charge.getId(), retrieveParams, options);
}
private Charge createDisputedCharge(int chargeValueCents, RequestOptions options) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException, InterruptedException {
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.putAll(defaultChargeParams);
chargeParams.put("amount", chargeValueCents);
chargeParams.put("source", "tok_createDispute");
Charge charge = Charge.create(chargeParams, options);
// This test relies on the server asynchronously marking the charge as disputed.
// TODO: find a more reliable way to do this instead of sleeping
Thread.sleep(10000);
Map<String, Object> retrieveParams = new HashMap<String, Object>();
retrieveParams.put("expand[]", "dispute");
return Charge.retrieve(charge.getId(), retrieveParams, options);
}