diff --git a/api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/TransferMethod.kt b/api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/TransferMethod.kt index 477927f16..3cfd6a8a3 100644 --- a/api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/TransferMethod.kt +++ b/api/api-core/src/main/kotlin/co/nilin/opex/api/core/inout/TransferMethod.kt @@ -1,5 +1,5 @@ package co.nilin.opex.api.core.inout enum class TransferMethod { - CARD, SHEBA, IPG, EXCHANGE , MANUALLY , VOUCHER, MPG , REWARD + CARD, SHEBA, IPG, EXCHANGE , MANUALLY , VOUCHER, MPG , REWARD, BANK_DEPOSIT, ACCOUNT } diff --git a/common/src/main/kotlin/co/nilin/opex/common/OpexError.kt b/common/src/main/kotlin/co/nilin/opex/common/OpexError.kt index 4142b1c5e..6edb3ba9d 100644 --- a/common/src/main/kotlin/co/nilin/opex/common/OpexError.kt +++ b/common/src/main/kotlin/co/nilin/opex/common/OpexError.kt @@ -117,6 +117,7 @@ enum class OpexError(val code: Int, val message: String?, val status: HttpStatus ForbiddenSwapPair(6052, null, HttpStatus.BAD_REQUEST), TerminalLocalizationNotFound(6053, "Terminal localization not found", HttpStatus.NOT_FOUND), CurrencyLocalizationNotFound(6051, "Currency localization not found", HttpStatus.NOT_FOUND), + IdentifierNotFound(6052, "Identifier not found", HttpStatus.NOT_FOUND), // code 7000: api diff --git a/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/config/SecurityConfig.kt b/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/config/SecurityConfig.kt index e10790d8d..f8248c9d9 100644 --- a/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/config/SecurityConfig.kt +++ b/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/config/SecurityConfig.kt @@ -95,6 +95,7 @@ class SecurityConfig(private val webClient: WebClient) { http.csrf().disable() .authorizeExchange() // .pathMatchers("/transaction/**").hasAuthority("SCOPE_trust") + .pathMatchers("/v1/deposit/webhook").permitAll() .pathMatchers("/admin/**").hasRoleAndLevel("Admin") .pathMatchers(HttpMethod.PUT, "/otc/**").hasRoleAndLevel("Admin") .pathMatchers(HttpMethod.POST, "/otc/**").hasRoleAndLevel("Admin") diff --git a/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/service/DepositService.kt b/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/service/DepositService.kt index d6b7ccc45..bc056b6f9 100644 --- a/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/service/DepositService.kt +++ b/wallet/wallet-app/src/main/kotlin/co/nilin/opex/wallet/app/service/DepositService.kt @@ -33,7 +33,7 @@ class DepositService( ) { private val logger = LoggerFactory.getLogger(DepositService::class.java) - + // ------------------------------------------------------------------------- // Helpers (NO LOGIC CHANGE) // ------------------------------------------------------------------------- @@ -121,8 +121,8 @@ class DepositService( ) val receiverUuid = walletOwnerManager.findWalletOwnerByExternalIdentifier(request.externalIdentifier)?.uuid - ?: throw OpexError.BadRequest.exception("Identifier ${request.externalIdentifier} not fount") - + ?: throw OpexError.IdentifierNotFound.exception("Identifier ${request.externalIdentifier} not found") + //todo to have meaningful transfer labels in deposits section we have added BANK_DEPOSIT to cover sheba and account transfers in this service with(request) { deposit( symbol = symbol, @@ -136,7 +136,7 @@ class DepositService( attachment = null, depositType = DepositType.OFF_CHAIN, gatewayUuid = null, - transferMethod = TransferMethod.SHEBA, + transferMethod = TransferMethod.BANK_DEPOSIT, persistInvalidDeposit = false ) } diff --git a/wallet/wallet-core/src/main/kotlin/co/nilin/opex/wallet/core/inout/TransferMethod.kt b/wallet/wallet-core/src/main/kotlin/co/nilin/opex/wallet/core/inout/TransferMethod.kt index 30fceb6d2..fc4d3082a 100644 --- a/wallet/wallet-core/src/main/kotlin/co/nilin/opex/wallet/core/inout/TransferMethod.kt +++ b/wallet/wallet-core/src/main/kotlin/co/nilin/opex/wallet/core/inout/TransferMethod.kt @@ -1,5 +1,5 @@ package co.nilin.opex.wallet.core.inout enum class TransferMethod { - CARD, SHEBA, IPG, EXCHANGE , MANUALLY , VOUCHER, MPG , REWARD + CARD, SHEBA, IPG, EXCHANGE , MANUALLY , VOUCHER, MPG , REWARD, BANK_DEPOSIT, ACCOUNT } diff --git a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt index 8df546227..a3692e6b7 100644 --- a/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt +++ b/wallet/wallet-ports/wallet-persister-postgres/src/main/kotlin/co/nilin/opex/wallet/ports/postgres/dao/OffChainGatewayRepository.kt @@ -18,6 +18,7 @@ interface OffChainGatewayRepository : ReactiveCrudRepository