public static void main(String[] args) {
BasicConfigurator.configure();
dumpRequestAndResponse=true;
ServiceEndpoints serviceEndpoints=CommandLineOptions.getServiceEndpoints(args);
String username=CommandLineOptions.getUsername(args);
String password=CommandLineOptions.getPassword(args);
if (username==null) username="Fred.Jones";
if (password==null) password="1234";
if (serviceEndpoints==null) serviceEndpoints=new ServiceEndpoints();
logger.debug("Reservation endpoint="+serviceEndpoints.getAmountReserveEndpoint());
String authorisationHeader=JSONRequest.getAuthorisationHeader(username, password);
logger.debug("AuthorisationHeader="+authorisationHeader);
Reservation me=new Reservation(serviceEndpoints, authorisationHeader);
PaymentResponse reserveInitialResponse=me.reserveInitialAmount("tel:1234567890", "REF-12345", "The Big Fight", "USD", 3.0, "C258", "CORR-0001", "Jupiter TV", "Video", "Wap", 0.0, "JUP-1", "JUP-001234");
if (reserveInitialResponse!=null) {
logger.debug("Reserve initial response:\n"+reserveInitialResponse.toString());
} else {
logger.debug("No response obtained");
}
int sequenceNumber=2;
logger.debug("Reserve additional endpoint="+serviceEndpoints.getAmountReserveAdditionalEndpoint());
PaymentResponse reserveAdditionalResponse=me.reserveAdditionalAmount("tel:1234567890", "REF-12345", "The Big Fight", "USD", 1.5, sequenceNumber++, "C258");
if (reserveAdditionalResponse!=null) {
logger.debug("Reserve additional response:\n"+reserveAdditionalResponse.toString());
} else {
logger.debug("No response obtained");
}
logger.debug("Reservation charge endpoint="+serviceEndpoints.getAmountReservationChargeEndpoint());
PaymentResponse chargeResponse=me.chargeAmount("tel:1234567890", "REF-12345", "The Big Fight", "USD", 3.0, sequenceNumber++, "C528", "http://notaurl.com", "CORR-0001", "Jupiter TV", "Video", "Wap", 0.0, "JUP-1", "JUP-001234");
if (reserveInitialResponse!=null) {
logger.debug("Reservation charge response:\n"+chargeResponse.toString());
} else {
logger.debug("No response obtained");
}
logger.debug("Reservation release endpoint="+serviceEndpoints.getAmountReservationReleaseEndpoint());
PaymentResponse releaseResponse=me.releaseReservation("tel:1234567890", "REF-12345", sequenceNumber);
if (releaseResponse!=null) {
logger.debug("Reservation response:\n"+releaseResponse.toString());