diff --git a/.circleci/config.yml b/.circleci/config.yml index 40ab5cc6..72a15248 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,11 +59,7 @@ jobs: # Install Docker to build and push the image - setup_remote_docker: version: 20.10.24 - - kubernetes/install-kubectl - checkout - - aws-eks/update-kubeconfig-with-authenticator: - cluster-name: "sit" - aws-region: "$REGION" # Build the Docker image - run: name: Build Docker image diff --git a/src/main/java/org/mifos/connector/channel/api/definition/GSMATransactionApi.java b/src/main/java/org/mifos/connector/channel/api/definition/GSMATransactionApi.java index 66d1e913..2cca72d8 100644 --- a/src/main/java/org/mifos/connector/channel/api/definition/GSMATransactionApi.java +++ b/src/main/java/org/mifos/connector/channel/api/definition/GSMATransactionApi.java @@ -15,5 +15,6 @@ public interface GSMATransactionApi { GsmaP2PResponseDto gsmatransaction(@RequestBody GsmaTransfer requestBody, @RequestHeader(value = CLIENTCORRELATIONID, required = false) String correlationId, @RequestHeader(value = "amsName") String amsName, @RequestHeader(value = "accountHoldingInstitutionId") String accountHoldId, - @RequestHeader(value = "X-CallbackURL") String callbackURL) throws JsonProcessingException; + @RequestHeader(value = "X-CallbackURL") String callbackURL, + @RequestHeader(value = "Platform-TenantId", required = false) String tenantId) throws JsonProcessingException; } diff --git a/src/main/java/org/mifos/connector/channel/api/implementation/GSMATransactionApiController.java b/src/main/java/org/mifos/connector/channel/api/implementation/GSMATransactionApiController.java index d072a31b..9fe75b32 100644 --- a/src/main/java/org/mifos/connector/channel/api/implementation/GSMATransactionApiController.java +++ b/src/main/java/org/mifos/connector/channel/api/implementation/GSMATransactionApiController.java @@ -28,9 +28,10 @@ public class GSMATransactionApiController implements GSMATransactionApi { @Override public GsmaP2PResponseDto gsmatransaction(GsmaTransfer requestBody, String correlationId, String amsName, String accountHoldId, - String callbackURL) throws JsonProcessingException { + String callbackURL, String tenantId) throws JsonProcessingException { Headers headers = new Headers.HeaderBuilder().addHeader("X-CorrelationID", correlationId).addHeader("amsName", amsName) - .addHeader("accountHoldingInstitutionId", accountHoldId).addHeader("X-CallbackURL", callbackURL).build(); + .addHeader("accountHoldingInstitutionId", accountHoldId).addHeader("X-CallbackURL", callbackURL) + .addHeader("Platform-TenantId", tenantId).build(); Exchange exchange = SpringWrapperUtil.getDefaultWrappedExchange(producerTemplate.getCamelContext(), headers, objectMapper.writeValueAsString(requestBody)); producerTemplate.send("direct:post-gsma-transaction", exchange); diff --git a/src/main/java/org/mifos/connector/channel/camel/routes/ChannelRouteBuilder.java b/src/main/java/org/mifos/connector/channel/camel/routes/ChannelRouteBuilder.java index dd583f24..ef4b4b51 100644 --- a/src/main/java/org/mifos/connector/channel/camel/routes/ChannelRouteBuilder.java +++ b/src/main/java/org/mifos/connector/channel/camel/routes/ChannelRouteBuilder.java @@ -682,14 +682,21 @@ private void inboundTransferC2bImplementationRoutes() { String accountHoldingInstitutionId = e.getIn().getHeader("accountHoldingInstitutionId").toString(); String clientCorrelationId = e.getIn().getHeader("X-CorrelationID", String.class); String callbackURL = e.getIn().getHeader("X-CallbackURL").toString(); - // inbound-transfer-mifos-lion + String tenantId = (String) e.getIn().getHeader("Platform-TenantId"); Map variables = amsUtils.setZeebeVariables(gsmaTranfer.getCustomData(), timer); - variables.put(TENANT_ID, accountHoldingInstitutionId); + if (tenantId != null && !tenantId.isEmpty()) { + variables.put(TENANT_ID, tenantId); + } else { + variables.put(TENANT_ID, accountHoldingInstitutionId); + tenantId = accountHoldingInstitutionId; + } + variables.put("accountHoldingInstitutionId", accountHoldingInstitutionId); variables.put(CHANNEL_REQUEST, objectMapper.writeValueAsString(gsmaTranfer)); variables.put("clientCorrelationId", clientCorrelationId); variables.put("X-CallbackURL", callbackURL); + // tenantId in workflowName should be changed to accountHoldingInstitutionId; String workflowName = new StringBuilder().append(subtype).append("_").append(type).append("_").append(amsName) - .append("-").append(accountHoldingInstitutionId).toString(); + .append("-").append(tenantId).toString(); logger.info("Workflow Name:{}", workflowName); String transactionId = zeebeProcessStarter.startZeebeWorkflowC2B(workflowName, variables); GsmaP2PResponseDto responseDto = new GsmaP2PResponseDto();