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
  • Loading branch information
logoutdhaval committed Aug 14, 2024
1 parent df5ffb6 commit c8da821
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
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) {
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 c8da821

Please sign in to comment.