Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading