@@ -62,7 +62,8 @@ public void configure() {
62
62
.setBody (e -> {
63
63
String body =e .getIn ().getBody (String .class );
64
64
logger .debug ("Body : {}" ,body );
65
- e .setProperty ("dfspId" ,e .getProperty ("dfspId" ));
65
+ String accountHoldingInstitutionId = String .valueOf (e .getIn ().getHeader ("accountHoldingInstitutionId" ));
66
+ e .setProperty ("accountHoldingInstitutionId" ,accountHoldingInstitutionId );
66
67
return body ;
67
68
})
68
69
.to ("direct:transfer-validation-base" )
@@ -73,8 +74,12 @@ public void configure() {
73
74
// Building the response
74
75
JSONObject responseObject =new JSONObject ();
75
76
responseObject .put ("reconciled" , e .getProperty (PARTY_LOOKUP_FAILED ).equals (false ));
76
- responseObject .put ("AMS" , "roster" );
77
- responseObject .put ("transaction_id" , transactionId );
77
+ responseObject .put ("amsName" , "roster" );
78
+ responseObject .put ("accountHoldingInstitutionId" , e .getProperty ("accountHoldingInstitutionId" ));
79
+ responseObject .put (TRANSACTION_ID , e .getProperty (TRANSACTION_ID ));
80
+ responseObject .put ("amount" , e .getProperty ("amount" ));
81
+ responseObject .put ("currency" , e .getProperty ("currency" ));
82
+ responseObject .put ("msisdn" , e .getProperty ("msisdn" ));
78
83
logger .debug ("response object " +responseObject );
79
84
e .getIn ().setBody (responseObject .toString ());
80
85
});
@@ -89,15 +94,23 @@ public void configure() {
89
94
.process (exchange -> {
90
95
// processing success case
91
96
exchange .setProperty (PARTY_LOOKUP_FAILED , false );
92
- exchange .setProperty ("dfspId" ,exchange .getProperty ("dfspId" ));
97
+ exchange .setProperty ("accountHoldingInstitutionId" , exchange .getProperty ("accountHoldingInstitutionId" ));
98
+ exchange .setProperty (TRANSACTION_ID , exchange .getProperty (TRANSACTION_ID ));
99
+ exchange .setProperty ("amount" , exchange .getProperty ("amount" ));
100
+ exchange .setProperty ("currency" , exchange .getProperty ("currency" ));
101
+ exchange .setProperty ("msisdn" , exchange .getProperty ("msisdn" ));
93
102
logger .debug ("Pesacore Validation Success" );
94
103
})
95
104
.otherwise ()
96
105
.log (LoggingLevel .ERROR , "Validation unsuccessful" )
97
106
.process (exchange -> {
98
107
// processing unsuccessful case
99
108
exchange .setProperty (PARTY_LOOKUP_FAILED , true );
100
- exchange .setProperty ("dfspId" ,exchange .getProperty ("dfspId" ));
109
+ exchange .setProperty ("accountHoldingInstitutionId" , exchange .getProperty ("accountHoldingInstitutionId" ));
110
+ exchange .setProperty (TRANSACTION_ID , exchange .getProperty (TRANSACTION_ID ));
111
+ exchange .setProperty ("amount" , exchange .getProperty ("amount" ));
112
+ exchange .setProperty ("currency" , exchange .getProperty ("currency" ));
113
+ exchange .setProperty ("msisdn" , exchange .getProperty ("msisdn" ));
101
114
logger .debug ("Pesacore Validation Failure" );
102
115
});
103
116
@@ -122,10 +135,12 @@ public void configure() {
122
135
JSONObject paybillRequest = new JSONObject (exchange .getIn ().getBody (String .class ));
123
136
PesacoreRequestDTO pesacoreRequestDTO = PesacoreUtils .convertPaybillPayloadToAmsPesacorePayload (paybillRequest );
124
137
125
- String transactionId = pesacoreRequestDTO .getRemoteTransactionId ();
126
- log .info (pesacoreRequestDTO .toString ());
127
- exchange .setProperty (TRANSACTION_ID , transactionId );
128
- exchange .setProperty ("dfspId" ,exchange .getProperty ("dfspId" ));
138
+ log .debug (pesacoreRequestDTO .toString ());
139
+ exchange .setProperty (TRANSACTION_ID , pesacoreRequestDTO .getRemoteTransactionId ());
140
+ exchange .setProperty ("amount" , pesacoreRequestDTO .getAmount ());
141
+ exchange .setProperty ("currency" , pesacoreRequestDTO .getCurrency ());
142
+ exchange .setProperty ("msisdn" , pesacoreRequestDTO .getPhoneNumber ());
143
+ exchange .setProperty ("accountHoldingInstitutionId" , exchange .getProperty ("accountHoldingInstitutionId" ));
129
144
logger .debug ("Validation request DTO: \n \n \n " + pesacoreRequestDTO );
130
145
return pesacoreRequestDTO ;
131
146
}
0 commit comments