updating sequence of flows
This commit is contained in:
@@ -76,7 +76,7 @@ public class StewardIntegrationProcessor implements TransactionProcessorInterfac
|
||||
.build();
|
||||
|
||||
if(Objects.equals(powertelClientId, transaction.getBillClientId())) {
|
||||
logger.info("send confirmation again");
|
||||
logger.info("send confirmation again for - " + transaction.getBillClientId());
|
||||
String url = aggregatorUrl + "/merchant/aggregation/transaction";
|
||||
LinkedHashMap response = restService.postWithToken(token, url, request, LinkedHashMap.class);
|
||||
logger.info("response: {}", response.toString());
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TransactionWorkflow extends WorkflowDefinition {
|
||||
permit(GATEWAY_PAYMENT_SUCCESS, INTEGRATION);
|
||||
permit(INTEGRATION, PURCHASE_INVOICE, TRAN_FAILED);
|
||||
permit(PURCHASE_INVOICE, PURCHASE_INVOICE_PAYMENT);
|
||||
permit(PURCHASE_INVOICE_PAYMENT, PURCHASE_INVOICE_PAYMENT_SUCCESS);
|
||||
permit(PURCHASE_INVOICE_PAYMENT, PURCHASE_INVOICE_PAYMENT_SUCCESS, DONE);
|
||||
permit(PURCHASE_INVOICE_PAYMENT_SUCCESS, POLL_STATUS);
|
||||
permit(POLL_STATUS, SALES_INVOICE, TRAN_FAILED);
|
||||
permit(SALES_INVOICE, JOURNAL_ENTRY);
|
||||
@@ -219,6 +219,13 @@ public class TransactionWorkflow extends WorkflowDefinition {
|
||||
transaction = (Transaction) handlerInterface.process(transaction);
|
||||
|
||||
execution.setVariable("body", Utils.toJson(transaction));
|
||||
|
||||
// it's possible to have a flow that ends up event though
|
||||
// polling has already happened
|
||||
if(transaction.getPollingStatus() == Status.SUCCESS){
|
||||
return NextAction.moveToState(DONE,
|
||||
"Polling already complete");
|
||||
}
|
||||
return NextAction.moveToState(PURCHASE_INVOICE_PAYMENT_SUCCESS,
|
||||
"Purchase invoice payment generated - id: " + transaction.getErpPurchasePaymentRef());
|
||||
}catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user