@@ -184,28 +184,17 @@ public void configure() {
184
184
.setHeader ("Content-Type" , constant ("application/json" ))
185
185
.setHeader ("Authorization" , simple ("Token " + authHeader ))
186
186
.setBody (exchange -> {
187
- if (exchange .getProperty (CHANNEL_REQUEST ).toString ().contains ("customData" )){
188
- JSONObject channelRequest = (JSONObject ) exchange .getProperty (CHANNEL_REQUEST );
189
- String transactionId = exchange .getProperty (TRANSACTION_ID , String .class );
190
- String mpesaReceiptNumber = exchange .getProperty (EXTERNAL_ID , String .class );
187
+ JSONObject channelRequest = (JSONObject ) exchange .getProperty (CHANNEL_REQUEST );
188
+ String transactionId = exchange .getProperty (TRANSACTION_ID , String .class );
189
+ String mpesaReceiptNumber = exchange .getProperty (EXTERNAL_ID , String .class );
191
190
192
- PesacoreRequestDTO confirmationRequestDTO = buildPesacoreDtoFromChannelRequest (channelRequest ,
193
- mpesaReceiptNumber );
194
- confirmationRequestDTO .setStatus ("successful" );
195
- confirmationRequestDTO .setReceiptId (mpesaReceiptNumber );
196
-
197
- logger .info ("Confirmation request DTO: \n \n \n " + confirmationRequestDTO );
198
- return confirmationRequestDTO ;
199
- }else {
200
- JSONObject paybillRequest = new JSONObject (exchange .getIn ().getBody (String .class ));
201
- PesacoreRequestDTO pesacoreRequestDTO = PesacoreUtils .convertPaybillPayloadToAmsPesacorePayload (paybillRequest );
191
+ PesacoreRequestDTO confirmationRequestDTO = buildPesacoreDtoFromChannelRequest (channelRequest ,
192
+ mpesaReceiptNumber );
193
+ confirmationRequestDTO .setStatus ("successful" );
194
+ confirmationRequestDTO .setReceiptId (mpesaReceiptNumber );
202
195
203
- String transactionId = pesacoreRequestDTO .getRemoteTransactionId ();
204
- log .debug (pesacoreRequestDTO .toString ());
205
- exchange .setProperty (TRANSACTION_ID , transactionId );
206
- logger .debug ("Confirmation request DTO: {}" ,pesacoreRequestDTO );
207
- return pesacoreRequestDTO ;
208
- }
196
+ logger .debug ("Confirmation request DTO: \n \n \n " + confirmationRequestDTO );
197
+ return confirmationRequestDTO ;
209
198
})
210
199
.marshal ().json (JsonLibrary .Jackson )
211
200
.toD (getConfirmationEndpoint () + "?bridgeEndpoint=true&throwExceptionOnFailure=false&" +
0 commit comments