I have a Response Class with the set of private fields. Front end developers asked me to send the response of a service in this JSON format. So far Response should in JSON format and like this
{
"status": "SUCCESS",
"message": {
"code": "040",
"description": "verified"
},
"qrContent": "aaa | bbb"
}
QrCodePaymentResponse response = new QrCodePaymentResponse();
if (firstThree.equalsIgnoreCase(QRType.EZDYNAMIC.getDescription())) {
axiPayQrCodePaymentService.ezCashDynamicQR(axiPayQrCodePayment,serviceContext);
response.setStatus(RequestStatus.SUCCESS.getStatus());
response.setMessage(----------------);
response.setQrContent(returnValue.getQrContent);
}
How to modify above code to send requested format? Thanks.
QrCodePaymentResponse