diff --git a/src/main/java/zw/qantra/tm/domain/services/processors/integrations/StewardIntegrationProcessor.java b/src/main/java/zw/qantra/tm/domain/services/processors/integrations/StewardIntegrationProcessor.java index b59cdf5..203093e 100644 --- a/src/main/java/zw/qantra/tm/domain/services/processors/integrations/StewardIntegrationProcessor.java +++ b/src/main/java/zw/qantra/tm/domain/services/processors/integrations/StewardIntegrationProcessor.java @@ -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()); diff --git a/src/main/java/zw/qantra/tm/domain/workflows/TransactionWorkflow.java b/src/main/java/zw/qantra/tm/domain/workflows/TransactionWorkflow.java index c0a2db4..9d85112 100644 --- a/src/main/java/zw/qantra/tm/domain/workflows/TransactionWorkflow.java +++ b/src/main/java/zw/qantra/tm/domain/workflows/TransactionWorkflow.java @@ -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) { diff --git a/src/main/resources/application-lab.properties b/src/main/resources/application-lab.properties index 5839325..2946fd1 100644 --- a/src/main/resources/application-lab.properties +++ b/src/main/resources/application-lab.properties @@ -52,3 +52,6 @@ nflow.db.postgresql.user=postgres nflow.db.postgresql.password=zdDZMzq6F4B4L1IUl powertel.clientid=powertel_zesa + +ecocash.apikey=OUzGezwTgktLg_9v0I48I6WUM4LVLGFl +ecocash.url=https://developers.ecocash.co.zw/api/ecocash_pay/api/v2/payment/instant/c2b/sandbox diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index eec13ee..db4a3e6 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -66,4 +66,7 @@ spring.mail.password=QdZucpJMJIZ spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true -powertel.clientid=zesa_prepaid_usd \ No newline at end of file +powertel.clientid=zesa_prepaid_usd + +ecocash.apikey=OUzGezwTgktLg_9v0I48I6WUM4LVLGFl +ecocash.url=https://developers.ecocash.co.zw/api/ecocash_pay/api/v2/payment/instant/c2b/sandbox