if (checkRequestParameters(response, rules)) {
String serverReferenceCode="DEF-456";
String resourceURL=getRequestHostnameAndContext(request)+request.getServletPath()+"/1/payment/"+(endUserId!=null?urlEncode(endUserId):"")+"/transactions/amountReservation/"+urlEncode(transactionId);
AmountReservationTransaction responseData=new AmountReservationTransaction();
/*
* Processing of the request to charge the amount
*/
responseData.setClientCorrelator(clientCorrelator);
responseData.setEndUserId(endUserId);
AmountReservationTransaction.PaymentAmount.ChargingInformation charge=new AmountReservationTransaction.PaymentAmount.ChargingInformation();
charge.setAmount(amount);
charge.setCurrency(currency);
charge.setDescription(description);
charge.setPurchaseCategoryCode(purchaseCategoryCode);
AmountReservationTransaction.PaymentAmount payment=new AmountReservationTransaction.PaymentAmount();
payment.setChargingInformation(charge);
payment.setAmountReserved(0.0);
payment.setTotalAmountCharged(amount);
responseData.setPaymentAmount(payment);
responseData.setReferenceCode(referenceCode);
if (callbackURL==null) {
responseData.setTransactionOperationStatus(transactionOperationStatus);
} else {
responseData.setTransactionOperationStatus("Processing");
}
responseData.setResourceURL(resourceURL);
responseData.setClientCorrelator(clientCorrelator);
responseData.setReferenceSequence(referenceSequence);
responseData.setServerReferenceCode(serverReferenceCode);
ObjectMapper mapper=new ObjectMapper();
String jsonResponse="{\"amountReservationTransaction\":"+mapper.writeValueAsString(responseData)+"}";
if (callbackURL==null) {