Skip to content

Commit

Permalink
[PHEE-721] Fix /gsma/transcation API to work with different dfspids. (#…
Browse files Browse the repository at this point in the history
…164)

* [PHEE-721] Fix /gsma/transcation API to work with different dfspids.

* fix circleci

* updated changes
  • Loading branch information
logoutdhaval authored Aug 14, 2024
1 parent df5ffb6 commit abdd770
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> 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();
Expand Down

0 comments on commit abdd770

Please sign in to comment.