preventing multiple executions
This commit is contained in:
@@ -31,6 +31,10 @@ public class IntegrationHandler implements HandlerInterface {
|
||||
public Object process(Transaction transaction) throws Exception {
|
||||
transaction.setType(RequestType.INTEGRATION);
|
||||
|
||||
// if we've done this before then return
|
||||
if(transaction.getIntegrationStatus().equals(Status.SUCCESS))
|
||||
return transaction;
|
||||
|
||||
TransactionEvent transactionEvent = TransactionEvent.builder()
|
||||
.transactionId(transaction.getId().toString())
|
||||
.event(transaction.getType().name())
|
||||
|
||||
@@ -33,6 +33,10 @@ public class PaymentHandler implements HandlerInterface {
|
||||
transaction.setAuthType(incomingTransaction.getAuthType());
|
||||
}
|
||||
|
||||
// if we've done this before then return
|
||||
if(transaction.getPaymentStatus().equals(Status.SUCCESS))
|
||||
return transaction;
|
||||
|
||||
transactionService.save(transaction);
|
||||
|
||||
TransactionEvent transactionEvent = TransactionEvent.builder()
|
||||
|
||||
Reference in New Issue
Block a user