Compare commits
10 Commits
df7d0e8006
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 735d5581ea | |||
| c581c211d5 | |||
| 49b3072e12 | |||
| b60ff9ef11 | |||
| 3f179fc9c9 | |||
| 8050f36311 | |||
| 4a639fda52 | |||
| 80cb10e062 | |||
| 4c5ac7ac03 | |||
| 6c5dab0a17 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -34,3 +34,4 @@ out/
|
|||||||
|
|
||||||
### VS Code ###
|
### VS Code ###
|
||||||
.vscode/
|
.vscode/
|
||||||
|
logs/application.log
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
package net.ipksindia
|
package net.ipksindia
|
||||||
|
|
||||||
import net.ipksindia.model.TransactionRequest
|
|
||||||
import net.ipksindia.config.AppConfig
|
import net.ipksindia.config.AppConfig
|
||||||
import net.ipksindia.dao.TellerDao
|
import net.ipksindia.dao.TellerDao
|
||||||
import net.ipksindia.dao.TransactionDao
|
import net.ipksindia.dao.TransactionDao
|
||||||
import net.ipksindia.model.NeftTransaction
|
import net.ipksindia.model.NeftTransaction
|
||||||
import net.ipksindia.model.OutwardNeftResponse
|
import net.ipksindia.model.OutwardNeftResponse
|
||||||
|
import net.ipksindia.model.TransactionRequest
|
||||||
import net.ipksindia.model.TransferTransaction
|
import net.ipksindia.model.TransferTransaction
|
||||||
|
import net.ipksindia.response.TransactionFailureResponse
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import response.TransactionFailureResponse
|
|
||||||
import response.TransactionResponse
|
|
||||||
import response.TransactionSuccessResponse
|
import response.TransactionSuccessResponse
|
||||||
|
|
||||||
class NeftRequestProcessor {
|
class NeftRequestProcessor {
|
||||||
@@ -78,9 +77,9 @@ class NeftRequestProcessor {
|
|||||||
): OutwardNeftResponse {
|
): OutwardNeftResponse {
|
||||||
val (transferResponse, neftResponse) = TransactionExecutor().executePair(transactionPair)
|
val (transferResponse, neftResponse) = TransactionExecutor().executePair(transactionPair)
|
||||||
|
|
||||||
return if (isSuccess(transferResponse, neftResponse)) {
|
return if (transferResponse is TransactionSuccessResponse && neftResponse is TransactionSuccessResponse) {
|
||||||
val transferQueueNumber = (transferResponse as TransactionSuccessResponse).queueNumber
|
val transferQueueNumber = transferResponse.queueNumber
|
||||||
val neftQueueNumber = (neftResponse as TransactionSuccessResponse).queueNumber
|
val neftQueueNumber = neftResponse.queueNumber
|
||||||
TransactionDao().updateSuccessTransaction(transactionRequest, transferQueueNumber, neftQueueNumber)
|
TransactionDao().updateSuccessTransaction(transactionRequest, transferQueueNumber, neftQueueNumber)
|
||||||
|
|
||||||
logger.info("TXN: #{} UPDATED RESULTS SUCCESSFULLY", transactionNumber)
|
logger.info("TXN: #{} UPDATED RESULTS SUCCESSFULLY", transactionNumber)
|
||||||
@@ -91,11 +90,6 @@ class NeftRequestProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if both transfer and NEFT responses are successful.
|
|
||||||
*/
|
|
||||||
private fun isSuccess(transferResponse: TransactionResponse, neftResponse: TransactionResponse) = transferResponse is TransactionSuccessResponse && neftResponse is TransactionSuccessResponse
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log errors if the transaction fails.
|
* Log errors if the transaction fails.
|
||||||
*/
|
*/
|
||||||
@@ -104,8 +98,8 @@ class NeftRequestProcessor {
|
|||||||
transferResponse: Any,
|
transferResponse: Any,
|
||||||
neftResponse: Any
|
neftResponse: Any
|
||||||
) {
|
) {
|
||||||
val transferErrorMsg = (transferResponse as? TransactionFailureResponse)?.errorMsg ?: "Unknown Error"
|
val transferErrorMsg = (transferResponse as? TransactionFailureResponse)?.message ?: "Unknown Error"
|
||||||
val neftErrorMsg = (neftResponse as? TransactionFailureResponse)?.errorMsg ?: "Unknown Error"
|
val neftErrorMsg = (neftResponse as? TransactionFailureResponse)?.message ?: "Unknown Error"
|
||||||
|
|
||||||
logger.error("TXN: #{} TRANSFER TXN FAILED DUE TO: {}", transactionNumber, transferErrorMsg)
|
logger.error("TXN: #{} TRANSFER TXN FAILED DUE TO: {}", transactionNumber, transferErrorMsg)
|
||||||
logger.error("TXN: #{} NEFT TXN FAILED DUE TO: {}", transactionNumber, neftErrorMsg)
|
logger.error("TXN: #{} NEFT TXN FAILED DUE TO: {}", transactionNumber, neftErrorMsg)
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import kotlinx.serialization.json.Json
|
|||||||
import net.ipksindia.config.AppConfig
|
import net.ipksindia.config.AppConfig
|
||||||
import net.ipksindia.model.NeftTransaction
|
import net.ipksindia.model.NeftTransaction
|
||||||
import net.ipksindia.model.TransferTransaction
|
import net.ipksindia.model.TransferTransaction
|
||||||
|
import net.ipksindia.response.TransactionFailureResponse
|
||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import response.TransactionFailureResponse
|
|
||||||
import response.TransactionResponse
|
import response.TransactionResponse
|
||||||
import response.TransactionSuccessResponse
|
import response.TransactionSuccessResponse
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
|
|
||||||
class TransactionExecutor() {
|
class TransactionExecutor {
|
||||||
private val logger = LoggerFactory.getLogger(TransactionExecutor::class.java)
|
private val logger = LoggerFactory.getLogger(TransactionExecutor::class.java)
|
||||||
private val transactionUrl = AppConfig.remoteServerConfig.transactionUrl
|
private val transactionUrl = AppConfig.remoteServerConfig.transactionUrl
|
||||||
|
|
||||||
@@ -24,17 +24,18 @@ class TransactionExecutor() {
|
|||||||
|
|
||||||
val transferTransaction = transactionPair.first
|
val transferTransaction = transactionPair.first
|
||||||
val neftTransaction = transactionPair.second
|
val neftTransaction = transactionPair.second
|
||||||
|
logger.debug("TRF-RRN: {}, NEFT-RRN: {}", transferTransaction.rrn, neftTransaction.rrn)
|
||||||
|
|
||||||
val transferResponseString = execute(Json.encodeToString(transferTransaction))
|
val transferResponseString = execute(Json.encodeToString(transferTransaction))
|
||||||
logger.debug("TRANSFER-RRN: {} - CBS Response: {}", transferTransaction.rrn, transferResponseString)
|
|
||||||
val transferResponse = processResponse(transferResponseString)
|
val transferResponse = processResponse(transferResponseString)
|
||||||
|
|
||||||
val neftResponseString = execute(Json.encodeToString(neftTransaction))
|
val neftResponseString = execute(Json.encodeToString(neftTransaction))
|
||||||
logger.debug("NEFT-RRN: {}, CBS Response: {}", neftTransaction.rrn, neftResponseString)
|
|
||||||
val neftResponse = processResponse(neftResponseString)
|
val neftResponse = processResponse(neftResponseString)
|
||||||
return Pair(transferResponse, neftResponse)
|
return Pair(transferResponse, neftResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun execute(postBody: String): String {
|
private fun execute(postBody: String): String {
|
||||||
|
logger.debug("request: {}", postBody)
|
||||||
val jsonMediaType = "application/json; charset=utf-8".toMediaType()
|
val jsonMediaType = "application/json; charset=utf-8".toMediaType()
|
||||||
|
|
||||||
val httpClient = OkHttpClient
|
val httpClient = OkHttpClient
|
||||||
@@ -52,7 +53,9 @@ class TransactionExecutor() {
|
|||||||
if (!response.isSuccessful) {
|
if (!response.isSuccessful) {
|
||||||
throw IOException("Unexpected response: ${response.body}")
|
throw IOException("Unexpected response: ${response.body}")
|
||||||
}
|
}
|
||||||
response.body?.string() ?: throw IOException("no response body")
|
val responseString = response.body?.string() ?: throw IOException("no response body")
|
||||||
|
logger.debug("response: {}", responseString)
|
||||||
|
responseString
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -63,14 +66,11 @@ class TransactionExecutor() {
|
|||||||
val message = responseObj.getString("message")
|
val message = responseObj.getString("message")
|
||||||
val error = responseObj.getInt("error")
|
val error = responseObj.getInt("error")
|
||||||
|
|
||||||
if(responseBody.contains("SUCCESS")) {
|
return if (responseBody.contains("SUCCESS")) {
|
||||||
val queueNo = responseObj.getJSONObject("response").getString("QueueId")
|
val queueNo = responseObj.getJSONObject("response").getString("QueueId")
|
||||||
return TransactionSuccessResponse(status, message, queueNo, error)
|
TransactionSuccessResponse(status, message, queueNo, error)
|
||||||
} else {
|
} else {
|
||||||
val errorMsg = responseObj.getJSONObject("response").getString("errorMsg")
|
TransactionFailureResponse(status, message, error)
|
||||||
return TransactionFailureResponse(status, message, errorMsg, error)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,44 @@
|
|||||||
package net.ipksindia
|
package net.ipksindia
|
||||||
|
|
||||||
import enums.TransactionType
|
import enums.TransactionType
|
||||||
import net.ipksindia.model.NeftTransaction
|
|
||||||
import model.Teller
|
import model.Teller
|
||||||
|
import net.ipksindia.model.NeftTransaction
|
||||||
import net.ipksindia.model.TransactionRequest
|
import net.ipksindia.model.TransactionRequest
|
||||||
import net.ipksindia.model.TransferTransaction
|
import net.ipksindia.model.TransferTransaction
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
class TransactionFactory(private val transactionRequest: TransactionRequest, private val teller: Teller) {
|
class TransactionFactory(private val transactionRequest: TransactionRequest, private val teller: Teller) {
|
||||||
private val bankDccbToSftpMap = mutableMapOf("0015" to "0005", "0003" to "0021")
|
private val bankDccbToSftpMap = mutableMapOf(
|
||||||
|
"0015" to "0005",
|
||||||
|
"0003" to "0021",
|
||||||
|
"0013" to "0016",
|
||||||
|
"0011" to "0018",
|
||||||
|
"0016" to "0001",
|
||||||
|
"0004" to "0004",
|
||||||
|
"0005" to "0007",
|
||||||
|
"0017" to "0020",
|
||||||
|
"0008" to "0006",
|
||||||
|
"0014" to "0009",
|
||||||
|
"0012" to "0014",
|
||||||
|
"0001" to "0012",
|
||||||
|
"0002" to "0003",
|
||||||
|
"0007" to "0013",
|
||||||
|
"0006" to "0002",
|
||||||
|
"0009" to "0015",
|
||||||
|
"0010" to "0017"
|
||||||
|
)
|
||||||
|
|
||||||
private val date = transactionRequest.date.format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
|
private val date = transactionRequest.date.format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))
|
||||||
private val rrn = transactionRequest.date.format(DateTimeFormatter.ofPattern("ddMM")) + transactionRequest.transactionNumber.takeLast(4)
|
private val rrn = transactionRequest.date.format(DateTimeFormatter.ofPattern("ddMM")) + transactionRequest.transactionNumber.takeLast(4)
|
||||||
|
|
||||||
private fun createTransferTransaction(): TransferTransaction {
|
private fun createTransferTransaction(): TransferTransaction {
|
||||||
val bankCode = bankDccbToSftpMap[transactionRequest.dccbCode.padStart(4, '0')] ?: throw ItemNotFoundException("SFTP code for", transactionRequest.dccbCode)
|
val bankCode = bankDccbToSftpMap[transactionRequest.dccbCode.padStart(4, '0')] ?: throw ItemNotFoundException(
|
||||||
|
"SFTP code",
|
||||||
|
transactionRequest.dccbCode
|
||||||
|
)
|
||||||
return TransferTransaction(
|
return TransferTransaction(
|
||||||
bankCode = bankCode,
|
bankCode = bankCode,
|
||||||
branchCode = transactionRequest.branchCode.padStart(3,'0'),
|
branchCode = transactionRequest.branchCode.padStart(3, '0'),
|
||||||
cbsTellerId = teller.tellerId,
|
cbsTellerId = teller.tellerId,
|
||||||
cbsTellerUserType = teller.userType,
|
cbsTellerUserType = teller.userType,
|
||||||
queIdType = "5",
|
queIdType = "5",
|
||||||
@@ -36,7 +58,15 @@ class TransactionFactory(private val transactionRequest: TransactionRequest, pri
|
|||||||
remitterName = transactionRequest.remitterName,
|
remitterName = transactionRequest.remitterName,
|
||||||
ifscCode = "ABCD0000000",
|
ifscCode = "ABCD0000000",
|
||||||
rrn = rrn + "1",
|
rrn = rrn + "1",
|
||||||
mobileOrEmail = transactionRequest.mobileNumber
|
mobileOrEmail = transactionRequest.mobileNumber,
|
||||||
|
remitterAddress = "",
|
||||||
|
beneficiaryName = "",
|
||||||
|
beneficiaryAddress = "",
|
||||||
|
senderAcctType = "",
|
||||||
|
beneficiaryAcctType = "",
|
||||||
|
beneficiaryBankName = "",
|
||||||
|
beneficiaryBranchName = "",
|
||||||
|
commissionAmt = "0"
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -64,8 +94,16 @@ class TransactionFactory(private val transactionRequest: TransactionRequest, pri
|
|||||||
apiType = "OUTWARD_QUEUE_POSTING",
|
apiType = "OUTWARD_QUEUE_POSTING",
|
||||||
remitterName = transactionRequest.remitterName,
|
remitterName = transactionRequest.remitterName,
|
||||||
ifscCode = transactionRequest.ifscCode,
|
ifscCode = transactionRequest.ifscCode,
|
||||||
|
rrn = rrn + "2",
|
||||||
mobileOrEmail = transactionRequest.mobileNumber,
|
mobileOrEmail = transactionRequest.mobileNumber,
|
||||||
rrn = rrn + "2"
|
remitterAddress = transactionRequest.remitterAddress.take(25),
|
||||||
|
beneficiaryName = transactionRequest.beneficiaryName,
|
||||||
|
beneficiaryAddress = transactionRequest.beneficiaryAddress.take(25),
|
||||||
|
senderAcctType = transactionRequest.senderAcctType,
|
||||||
|
beneficiaryAcctType = transactionRequest.beneficiaryAcctType,
|
||||||
|
beneficiaryBankName = transactionRequest.beneficiaryBankName,
|
||||||
|
beneficiaryBranchName = transactionRequest.beneficiaryBranchName,
|
||||||
|
commissionAmt = "0"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,245 @@ class TellerDao {
|
|||||||
"00022" to "1234",
|
"00022" to "1234",
|
||||||
"00026" to "11126"
|
"00026" to "11126"
|
||||||
),
|
),
|
||||||
|
"0013" to mapOf(
|
||||||
|
"00101" to "500",
|
||||||
|
"00102" to "502",
|
||||||
|
"00103" to "503",
|
||||||
|
"00106" to "506",
|
||||||
|
"00107" to "507"
|
||||||
|
),
|
||||||
|
"0011" to mapOf(
|
||||||
|
"00002" to "24",
|
||||||
|
"00008" to "30",
|
||||||
|
"00003" to "25",
|
||||||
|
"00011" to "33",
|
||||||
|
"00010" to "1234",
|
||||||
|
"00012" to "34",
|
||||||
|
"00009" to "5",
|
||||||
|
"00006" to "28",
|
||||||
|
"00004" to "26",
|
||||||
|
"00021" to "1234",
|
||||||
|
"00005" to "27",
|
||||||
|
"00007" to "29",
|
||||||
|
"00001" to "23"
|
||||||
|
),
|
||||||
|
"0004" to mapOf(
|
||||||
|
"00101" to "901",
|
||||||
|
"00103" to "903",
|
||||||
|
"00104" to "904",
|
||||||
|
"00105" to "905",
|
||||||
|
"00106" to "906",
|
||||||
|
"00107" to "907",
|
||||||
|
"00108" to "908"
|
||||||
|
),
|
||||||
|
"0005" to mapOf(
|
||||||
|
"00001" to "901",
|
||||||
|
"00002" to "902",
|
||||||
|
"00003" to "903",
|
||||||
|
"00004" to "904",
|
||||||
|
"00005" to "905",
|
||||||
|
"00007" to "907",
|
||||||
|
"00008" to "908",
|
||||||
|
"00009" to "909"
|
||||||
|
),
|
||||||
|
"0016" to mapOf(
|
||||||
|
"00013" to "913",
|
||||||
|
"00032" to "932",
|
||||||
|
"00042" to "942",
|
||||||
|
"00043" to "943",
|
||||||
|
"00044" to "944",
|
||||||
|
"00045" to "945",
|
||||||
|
"00046" to "946",
|
||||||
|
"00047" to "947",
|
||||||
|
"00048" to "948",
|
||||||
|
"00049" to "949",
|
||||||
|
"00051" to "951",
|
||||||
|
"00052" to "952",
|
||||||
|
"00053" to "953",
|
||||||
|
"00054" to "954",
|
||||||
|
"00055" to "955",
|
||||||
|
"00057" to "957",
|
||||||
|
"00060" to "960",
|
||||||
|
"00062" to "962",
|
||||||
|
"00063" to "963",
|
||||||
|
"00066" to "966",
|
||||||
|
"00067" to "967"
|
||||||
|
),
|
||||||
|
"0017" to mapOf (
|
||||||
|
"00118" to "18",
|
||||||
|
"00127" to "027",
|
||||||
|
"00102" to "002",
|
||||||
|
"00112" to "12",
|
||||||
|
"00119" to "019",
|
||||||
|
"00126" to "026",
|
||||||
|
"00129" to "029",
|
||||||
|
"00103" to "003",
|
||||||
|
"00106" to "006",
|
||||||
|
"00115" to "015",
|
||||||
|
"00131" to "031",
|
||||||
|
"00120" to "20",
|
||||||
|
"00104" to "004",
|
||||||
|
"00125" to "025",
|
||||||
|
"00124" to "024",
|
||||||
|
"00110" to "010",
|
||||||
|
"00105" to "005",
|
||||||
|
"00123" to "023",
|
||||||
|
"00111" to "11",
|
||||||
|
"00135" to "35",
|
||||||
|
"00109" to "009",
|
||||||
|
"00101" to "001",
|
||||||
|
"00108" to "008",
|
||||||
|
"00121" to "021",
|
||||||
|
"00130" to "30",
|
||||||
|
"00116" to "016",
|
||||||
|
"00128" to "028",
|
||||||
|
"00113" to "013",
|
||||||
|
"00117" to "017",
|
||||||
|
"00132" to "032"
|
||||||
|
),
|
||||||
|
"0008" to mapOf (
|
||||||
|
"00016" to "9007",
|
||||||
|
"00002" to "9002",
|
||||||
|
"00004" to "9004",
|
||||||
|
"00005" to "9005",
|
||||||
|
"00003" to "9003",
|
||||||
|
"00006" to "9006"
|
||||||
|
),
|
||||||
|
"0014" to mapOf (
|
||||||
|
"00007" to "1025",
|
||||||
|
"00013" to "1022",
|
||||||
|
"00003" to "456",
|
||||||
|
"00004" to "1023",
|
||||||
|
"00016" to "1026",
|
||||||
|
"00006" to "101",
|
||||||
|
"00010" to "1021",
|
||||||
|
"00011" to "789",
|
||||||
|
"00002" to "123"
|
||||||
|
),
|
||||||
|
"0012" to mapOf (
|
||||||
|
"00014" to "14",
|
||||||
|
"00013" to "13",
|
||||||
|
"00003" to "1003",
|
||||||
|
"00007" to "7",
|
||||||
|
"00008" to "8",
|
||||||
|
"00009" to "9",
|
||||||
|
"00015" to "15",
|
||||||
|
"00004" to "4",
|
||||||
|
"00010" to "10",
|
||||||
|
"00016" to "016",
|
||||||
|
"00001" to "1001",
|
||||||
|
"00022" to "22",
|
||||||
|
"00018" to "18",
|
||||||
|
"00006" to "6",
|
||||||
|
"00011" to "11",
|
||||||
|
"00012" to "12",
|
||||||
|
"00005" to "5"
|
||||||
|
),
|
||||||
|
"0001" to mapOf (
|
||||||
|
"00007" to "107",
|
||||||
|
"00009" to "109",
|
||||||
|
"00011" to "111",
|
||||||
|
"00006" to "106",
|
||||||
|
"00003" to "224",
|
||||||
|
"00002" to "102",
|
||||||
|
"00005" to "105",
|
||||||
|
"00012" to "112",
|
||||||
|
"00010" to "219",
|
||||||
|
"00008" to "108",
|
||||||
|
"00013" to "129",
|
||||||
|
"00014" to "114",
|
||||||
|
"00015" to "119",
|
||||||
|
"00004" to "237"
|
||||||
|
),
|
||||||
|
"0002" to mapOf (
|
||||||
|
"00114" to "1114",
|
||||||
|
"00106" to "1106",
|
||||||
|
"00108" to "1108",
|
||||||
|
"00109" to "1109",
|
||||||
|
"00111" to "1111",
|
||||||
|
"00113" to "1113",
|
||||||
|
"00101" to "1101",
|
||||||
|
"00112" to "1112",
|
||||||
|
"00105" to "1105",
|
||||||
|
"00107" to "1107",
|
||||||
|
"00102" to "1102",
|
||||||
|
"00103" to "1103",
|
||||||
|
"00104" to "1104"
|
||||||
|
),
|
||||||
|
"0007" to mapOf (
|
||||||
|
"00014" to "714",
|
||||||
|
"00007" to "707",
|
||||||
|
"00001" to "1234",
|
||||||
|
"00005" to "705",
|
||||||
|
"00004" to "704",
|
||||||
|
"00003" to "703",
|
||||||
|
"00009" to "709",
|
||||||
|
"00012" to "712",
|
||||||
|
"00008" to "708",
|
||||||
|
"00013" to "713",
|
||||||
|
"00006" to "706",
|
||||||
|
"00002" to "702",
|
||||||
|
"00011" to "711",
|
||||||
|
"00010" to "710"
|
||||||
|
),
|
||||||
|
"0010" to mapOf (
|
||||||
|
"00119" to "919",
|
||||||
|
"00114" to "914",
|
||||||
|
"00113" to "913",
|
||||||
|
"00116" to "916",
|
||||||
|
"00106" to "906",
|
||||||
|
"00111" to "911",
|
||||||
|
"00109" to "901",
|
||||||
|
"00107" to "900",
|
||||||
|
"00102" to "903",
|
||||||
|
"00112" to "912",
|
||||||
|
"00108" to "908",
|
||||||
|
"00118" to "902",
|
||||||
|
"00110" to "910"
|
||||||
|
),
|
||||||
|
"0006" to mapOf (
|
||||||
|
"00104" to "904",
|
||||||
|
"00101" to "901",
|
||||||
|
"00112" to "912",
|
||||||
|
"00105" to "1234",
|
||||||
|
"00107" to "907",
|
||||||
|
"00114" to "1234",
|
||||||
|
"00115" to "915",
|
||||||
|
"00103" to "903",
|
||||||
|
"00106" to "906",
|
||||||
|
"00108" to "908",
|
||||||
|
"00113" to "913",
|
||||||
|
"00117" to "1234",
|
||||||
|
"00110" to "910",
|
||||||
|
"00119" to "919",
|
||||||
|
"00116" to "916",
|
||||||
|
"00102" to "902",
|
||||||
|
"00111" to "911",
|
||||||
|
"00010" to "1234",
|
||||||
|
"00109" to "909",
|
||||||
|
"00120" to "920",
|
||||||
|
"00121" to "921"
|
||||||
|
),
|
||||||
|
"0009" to mapOf(
|
||||||
|
"00006" to "6",
|
||||||
|
"00014" to "14",
|
||||||
|
"00013" to "13",
|
||||||
|
"00012" to "12",
|
||||||
|
"00017" to "17",
|
||||||
|
"00007" to "101",
|
||||||
|
"00016" to "16",
|
||||||
|
"00009" to "9",
|
||||||
|
"00018" to "18",
|
||||||
|
"00008" to "8",
|
||||||
|
"00005" to "5",
|
||||||
|
"00011" to "11",
|
||||||
|
"00004" to "4",
|
||||||
|
"00002" to "22",
|
||||||
|
"00003" to "3",
|
||||||
|
"00015" to "15",
|
||||||
|
"00010" to "10",
|
||||||
|
"00001" to "101"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
fun getTeller(dccbCode: String, branchCode: String): Teller {
|
fun getTeller(dccbCode: String, branchCode: String): Teller {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package net.ipksindia.dao
|
package net.ipksindia.dao
|
||||||
|
|
||||||
import net.ipksindia.model.TransactionRequest
|
|
||||||
import net.ipksindia.ItemNotFoundException
|
import net.ipksindia.ItemNotFoundException
|
||||||
|
import net.ipksindia.model.TransactionRequest
|
||||||
import java.sql.Date
|
import java.sql.Date
|
||||||
import java.sql.ResultSet
|
import java.sql.ResultSet
|
||||||
import java.sql.SQLException
|
import java.sql.SQLException
|
||||||
@@ -32,10 +32,14 @@ class TransactionDao {
|
|||||||
ipks_accno AS pacs_acc_no,
|
ipks_accno AS pacs_acc_no,
|
||||||
da.link_accno AS cbs_sb_acc_no,
|
da.link_accno AS cbs_sb_acc_no,
|
||||||
'pacs_db' AS db_name,
|
'pacs_db' AS db_name,
|
||||||
kh.mobile_no
|
kh.mobile_no,
|
||||||
|
kh.address_1 || kh.address_2 AS remitter_address,
|
||||||
|
if.idi_bank_name AS beneficiary_bank_name,
|
||||||
|
if.idi_branch_name AS beneficiary_branch_name
|
||||||
FROM neft_rtgs_txn t
|
FROM neft_rtgs_txn t
|
||||||
JOIN dep_account da ON t.ipks_accno = da.key_1
|
JOIN dep_account da ON t.ipks_accno = da.key_1
|
||||||
JOIN kyc_hdr kh ON da.customer_no = kh.cif_no
|
JOIN kyc_hdr kh ON da.customer_no = kh.cif_no
|
||||||
|
JOIN idi_ifsc_dir_info if ON if.idi_ifsc_code = t.ifsc_code
|
||||||
WHERE
|
WHERE
|
||||||
t.txn_no = ?
|
t.txn_no = ?
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
@@ -122,8 +126,8 @@ private fun mapToObject(rs: ResultSet): TransactionRequest? {
|
|||||||
date = rs.getDate("txn_date").toLocalDate(),
|
date = rs.getDate("txn_date").toLocalDate(),
|
||||||
tellerId = rs.getString("teller_id"),
|
tellerId = rs.getString("teller_id"),
|
||||||
status = rs.getString("status"),
|
status = rs.getString("status"),
|
||||||
beneficiaryName = rs.getString("beneficiary_name"),
|
beneficiaryName = rs.getString("beneficiary_name") ?: "UNKNOWN",
|
||||||
beneficiaryAddress = rs.getString("beneficiary_add"),
|
beneficiaryAddress = rs.getString("beneficiary_add") ?: "UNKNOWN",
|
||||||
pacsId = rs.getString("pacs_id"),
|
pacsId = rs.getString("pacs_id"),
|
||||||
commissionTransactionNumber = rs.getString("comm_txn_no"),
|
commissionTransactionNumber = rs.getString("comm_txn_no"),
|
||||||
commissionAmount = rs.getString("comm_txn_amt"),
|
commissionAmount = rs.getString("comm_txn_amt"),
|
||||||
@@ -132,7 +136,12 @@ private fun mapToObject(rs: ResultSet): TransactionRequest? {
|
|||||||
remitterName = rs.getString("remitter_name"),
|
remitterName = rs.getString("remitter_name"),
|
||||||
pacsAccountNumber = rs.getString("pacs_acc_no"),
|
pacsAccountNumber = rs.getString("pacs_acc_no"),
|
||||||
linkedCBSAccountNumber = rs.getString("cbs_sb_acc_no"),
|
linkedCBSAccountNumber = rs.getString("cbs_sb_acc_no"),
|
||||||
mobileNumber = rs.getString("mobile_no") ?: "999999999"
|
mobileNumber = rs.getString("mobile_no") ?: "9999999999",
|
||||||
|
remitterAddress = rs.getString("remitter_address"),
|
||||||
|
beneficiaryBankName = rs.getString("beneficiary_bank_name"),
|
||||||
|
beneficiaryBranchName = rs.getString("beneficiary_branch_name"),
|
||||||
|
senderAcctType = "10", //for savings as shared by c-edge
|
||||||
|
beneficiaryAcctType = "10" //for savings as shared by c-edge
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package net.ipksindia.model
|
package net.ipksindia.model
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.ipks.model.Transaction
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class NeftTransaction(
|
class NeftTransaction(
|
||||||
@@ -27,4 +26,12 @@ class NeftTransaction(
|
|||||||
override val ifscCode: String,
|
override val ifscCode: String,
|
||||||
override val mobileOrEmail: String,
|
override val mobileOrEmail: String,
|
||||||
override val rrn: String,
|
override val rrn: String,
|
||||||
|
override val remitterAddress: String,
|
||||||
|
override val beneficiaryName: String,
|
||||||
|
override val beneficiaryAddress: String,
|
||||||
|
override val senderAcctType: String,
|
||||||
|
override val beneficiaryAcctType: String,
|
||||||
|
override val beneficiaryBankName: String,
|
||||||
|
override val beneficiaryBranchName: String,
|
||||||
|
override val commissionAmt: String,
|
||||||
) : Transaction
|
) : Transaction
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.ipks.model
|
package net.ipksindia.model
|
||||||
|
|
||||||
interface Transaction {
|
interface Transaction {
|
||||||
val bankCode: String
|
val bankCode: String
|
||||||
@@ -22,5 +22,13 @@ interface Transaction {
|
|||||||
val remitterName: String
|
val remitterName: String
|
||||||
val ifscCode: String
|
val ifscCode: String
|
||||||
val mobileOrEmail: String
|
val mobileOrEmail: String
|
||||||
|
val remitterAddress: String
|
||||||
|
val beneficiaryName: String
|
||||||
|
val beneficiaryAddress: String
|
||||||
|
val senderAcctType: String
|
||||||
|
val beneficiaryAcctType: String
|
||||||
|
val beneficiaryBankName: String
|
||||||
|
val beneficiaryBranchName: String
|
||||||
|
val commissionAmt: String
|
||||||
val rrn: String
|
val rrn: String
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ data class TransactionRequest(
|
|||||||
val tellerId: String,
|
val tellerId: String,
|
||||||
val status: String,
|
val status: String,
|
||||||
val beneficiaryName: String,
|
val beneficiaryName: String,
|
||||||
val beneficiaryAddress: String?,
|
val beneficiaryAddress: String,
|
||||||
val pacsId: String,
|
val pacsId: String,
|
||||||
val commissionTransactionNumber: String?,
|
val commissionTransactionNumber: String?,
|
||||||
val commissionAmount: String?,
|
val commissionAmount: String?,
|
||||||
@@ -22,6 +22,11 @@ data class TransactionRequest(
|
|||||||
val remitterName: String,
|
val remitterName: String,
|
||||||
val pacsAccountNumber: String,
|
val pacsAccountNumber: String,
|
||||||
val linkedCBSAccountNumber: String,
|
val linkedCBSAccountNumber: String,
|
||||||
val mobileNumber: String
|
val mobileNumber: String,
|
||||||
|
val remitterAddress: String,
|
||||||
|
val beneficiaryBankName: String,
|
||||||
|
val beneficiaryBranchName: String,
|
||||||
|
val senderAcctType: String,
|
||||||
|
val beneficiaryAcctType: String
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package net.ipksindia.model
|
package net.ipksindia.model
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import org.ipks.model.Transaction
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class TransferTransaction(
|
class TransferTransaction(
|
||||||
@@ -27,4 +26,12 @@ class TransferTransaction(
|
|||||||
override val ifscCode: String,
|
override val ifscCode: String,
|
||||||
override val mobileOrEmail: String,
|
override val mobileOrEmail: String,
|
||||||
override val rrn: String,
|
override val rrn: String,
|
||||||
|
override val remitterAddress: String,
|
||||||
|
override val beneficiaryName: String,
|
||||||
|
override val beneficiaryAddress: String,
|
||||||
|
override val senderAcctType: String,
|
||||||
|
override val beneficiaryAcctType: String,
|
||||||
|
override val beneficiaryBankName: String,
|
||||||
|
override val beneficiaryBranchName: String,
|
||||||
|
override val commissionAmt: String,
|
||||||
) : Transaction
|
) : Transaction
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package response
|
package net.ipksindia.response
|
||||||
|
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
import response.TransactionResponse
|
||||||
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class TransactionFailureResponse(
|
data class TransactionFailureResponse(
|
||||||
override val status: String,
|
override val status: String,
|
||||||
override val message: String,
|
override val message: String,
|
||||||
val errorMsg: String,
|
|
||||||
override val error: Int
|
override val error: Int
|
||||||
): TransactionResponse
|
): TransactionResponse
|
||||||
@@ -10,9 +10,9 @@ bank {
|
|||||||
server {
|
server {
|
||||||
protocol = "http"
|
protocol = "http"
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
port = 3000
|
port = 8080
|
||||||
rootRoute = "IPKS_Queue_Generation"
|
rootRoute = "IPKS_Queue_Generation"
|
||||||
transactionRoute = "IpksApi"
|
transactionRoute = "IpksApi"
|
||||||
}
|
}
|
||||||
codes = ["0003", "0015"]
|
codes = ["0003", "0015", "0013"]
|
||||||
}
|
}
|
||||||
@@ -9,10 +9,10 @@ database {
|
|||||||
bank {
|
bank {
|
||||||
server {
|
server {
|
||||||
protocol = "https"
|
protocol = "https"
|
||||||
host = "180.179.110.185"
|
host = "142.79.249.123"
|
||||||
port = 443
|
port = 443
|
||||||
rootRoute = "IPKS_Queue_Generation"
|
rootRoute = "IPKS_Queue_Generation"
|
||||||
transactionRoute = "IpksApi"
|
transactionRoute = "IpksApi"
|
||||||
}
|
}
|
||||||
codes = ["0003", "0015"]
|
codes = ["0003", "0015", "0013", "0011", "0016", "0004", "0005", "0017", "0008", "0014", "0012", "0002", "0001", "0007", "0006", "0009", "0010"]
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
<logger name="io.netty" level="WARN"/>
|
<logger name="io.netty" level="WARN"/>
|
||||||
<logger name="net.ipksindia" level="DEBUG" additivity="false">
|
<logger name="net.ipksindia" level="DEBUG" additivity="false">
|
||||||
<appender-ref ref="FILE-ROLLING"/>
|
<appender-ref ref="FILE-ROLLING"/>
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</logger>
|
</logger>
|
||||||
|
|
||||||
<root level="INFO">
|
<root level="INFO">
|
||||||
|
|||||||
Reference in New Issue
Block a user