This is the api document
1. Upload Transation https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/UploadBilledTransaction { "TransactionNumber":"${TxnNo}", "SequenceNumber": 1, "AllowedPaymentMode": "10", "MerchantStorePosCode": "${mspc}", "Amount": "${100}", "UserID": "", "MerchantID":${mid} , "SecurityToken": "${st}", "IMEI": "${IMEI}", "AutoCancelDurationInMinutes":5 } 2. Get status api.. https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/GetCloudBasedTxnStatus { "MerchantID":${mid}, "SecurityToken":"${st}", "IMEI":"${imei}", "MerchantStorePosCode":"${mspc}", "PlutusTransactionReferenceID":${PTRN} } 3. Cancel api.. https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/CancelTransaction { "MerchantID":${mid}, "SecurityToken":"${st}", "IMEI":"${imei}", "MerchantStorePosCode":"${storeposcode}", "PlutusTransactionReferenceID":${ptrn}, "Amount":${amt} }

This is my service class
public class PinelabsPayment implements Payment { private static final String UPLOAD_TRANSACTION_URL = "https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/UploadBilledTransaction"; private static final String GET_STATUS_URL = "https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/GetCloudBasedTxnStatus"; private static final String CANCEL_URL = "https://www.plutuscloudserviceuat.in:8201/API/CloudBasedIntegration/V1/CancelTransaction"; @Override public String initiatePayment(JSONObject paymentRequest) { try { URL url = new URL(UPLOAD_TRANSACTION_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); // Construct the request body OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(paymentRequest.toJSONString()); wr.flush(); // Read the response BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder response = new StringBuilder(); String line; while ((line = in.readLine()) != null) { response.append(line); } in.close(); // Parse the response JSON JSONParser parser = new JSONParser(); JSONObject jsonResponse = (JSONObject) parser.parse(response.toString()); // Process the response String responseMessage = jsonResponse.get("response_message").toString(); // Handle the response message accordingly return "Initiated payment with Pinelabs. Response: " + responseMessage; } catch (Exception e) { return "Error initiating payment with Pinelabs: " + e.getMessage(); } } @Override public String verifyPaymentStatus(String deviceID, String transactionID) { try { URL url = new URL(GET_STATUS_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); // Construct the request body JSONObject requestBody = new JSONObject(); // Add necessary parameters to the request body OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(requestBody.toJSONString()); wr.flush(); // Read the response BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder response = new StringBuilder(); String line; while ((line = in.readLine()) != null) { response.append(line); } in.close(); // Parse the response JSON JSONParser parser = new JSONParser(); JSONObject jsonResponse = (JSONObject) parser.parse(response.toString()); // Process the response String responseMessage = jsonResponse.get("response_message").toString(); // Handle the response message accordingly return "Verified payment status with Pinelabs. Response: " + responseMessage; } catch (Exception e) { return "Error verifying payment status with Pinelabs: " + e.getMessage(); } } @Override public String cancelPayment(String deviceID, String transactionID) { try { URL url = new URL(CANCEL_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); // Construct the request body JSONObject requestBody = new JSONObject(); // Add necessary parameters to the request body OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); wr.write(requestBody.toJSONString()); wr.flush(); // Read the response BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder response = new StringBuilder(); String line; while ((line = in.readLine()) != null) { response.append(line); } in.close(); // Parse the response JSON JSONParser parser = new JSONParser(); JSONObject jsonResponse = (JSONObject) parser.parse(response.toString()); // Process the response String responseMessage = jsonResponse.get("response_message").toString(); // Handle the response message accordingly return "Cancelled payment with Pinelabs. Response: " + responseMessage; } catch (Exception e) { return "Error cancelling payment with Pinelabs: " + e.getMessage(); } } @Override public JSONObject getConfiguration() { // Implement Pinelabs-specific logic for retrieving configuration return new JSONObject(); } @Override public JSONObject preparePaymentRequest(HttpServletRequest request) throws ServletException { try { JSONObject requestBody = new JSONObject(); requestBody.put("TransactionNumber", request.getParameter("TxnNo")); requestBody.put("MerchantStorePosCode", request.getParameter("mspc")); requestBody.put("Amount", request.getParameter("amount")); requestBody.put("MerchantID", request.getParameter("mid")); requestBody.put("SecurityToken", request.getParameter("st")); requestBody.put("IMEI", request.getParameter("IMEI")); return requestBody; } catch (Exception ex) { throw new ServletException("Error preparing payment request for Pinelabs: " + ex.getMessage(), ex); } } }

Will this service works exactly and implemented correctly ?