updating status changes
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -83,11 +83,6 @@
|
|||||||
<artifactId>jakarta.persistence-api</artifactId>
|
<artifactId>jakarta.persistence-api</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.googlecode.libphonenumber</groupId>
|
|
||||||
<artifactId>libphonenumber</artifactId>
|
|
||||||
<version>8.12.10</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
@@ -167,12 +162,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.googlecode.libphonenumber</groupId>
|
<groupId>com.googlecode.libphonenumber</groupId>
|
||||||
<artifactId>libphonenumber</artifactId>
|
<artifactId>libphonenumber</artifactId>
|
||||||
<version>8.13.36</version> <!-- Use the latest version -->
|
<version>8.13.36</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-mail</artifactId>
|
|
||||||
<version>3.1.5</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Maven -->
|
<!-- Maven -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ public class GatewayPaymentHandler implements HandlerInterface {
|
|||||||
try {
|
try {
|
||||||
// MAIN TRANSACTION LOGIC!
|
// MAIN TRANSACTION LOGIC!
|
||||||
transaction = (Transaction) transactionProcessorInterface.process(transaction);
|
transaction = (Transaction) transactionProcessorInterface.process(transaction);
|
||||||
transaction.setPaymentStatus(transaction.getPaymentStatus());
|
|
||||||
transaction.setPollingStatus(Status.PENDING);
|
transaction.setPollingStatus(Status.PENDING);
|
||||||
transactionService.save(transaction);
|
transactionService.save(transaction);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class PollStatusHandlerTest {
|
|||||||
transaction.setUserId("user-1");
|
transaction.setUserId("user-1");
|
||||||
transaction.setPaymentProcessorLabel("ecocash");
|
transaction.setPaymentProcessorLabel("ecocash");
|
||||||
transaction.setAuthType(AuthType.MOBILE);
|
transaction.setAuthType(AuthType.MOBILE);
|
||||||
|
transaction.setPaymentStatus(Status.SUCCESS); // Required for polling to proceed
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -59,7 +60,7 @@ class PollStatusHandlerTest {
|
|||||||
.thenReturn(transactionProcessor);
|
.thenReturn(transactionProcessor);
|
||||||
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
||||||
Transaction tx = invocation.getArgument(0);
|
Transaction tx = invocation.getArgument(0);
|
||||||
tx.setStatus(Status.SUCCESS);
|
tx.setPollingStatus(Status.SUCCESS);
|
||||||
return tx;
|
return tx;
|
||||||
});
|
});
|
||||||
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
||||||
@@ -127,7 +128,7 @@ class PollStatusHandlerTest {
|
|||||||
.thenReturn(transactionProcessor);
|
.thenReturn(transactionProcessor);
|
||||||
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
||||||
Transaction tx = invocation.getArgument(0);
|
Transaction tx = invocation.getArgument(0);
|
||||||
tx.setStatus(Status.SUCCESS);
|
tx.setPollingStatus(Status.SUCCESS);
|
||||||
return tx;
|
return tx;
|
||||||
});
|
});
|
||||||
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
||||||
@@ -146,7 +147,7 @@ class PollStatusHandlerTest {
|
|||||||
.thenReturn(transactionProcessor);
|
.thenReturn(transactionProcessor);
|
||||||
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
when(transactionProcessor.poll(any(Transaction.class))).thenAnswer(invocation -> {
|
||||||
Transaction tx = invocation.getArgument(0);
|
Transaction tx = invocation.getArgument(0);
|
||||||
tx.setStatus(Status.SUCCESS);
|
tx.setPollingStatus(Status.SUCCESS);
|
||||||
return tx;
|
return tx;
|
||||||
});
|
});
|
||||||
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
when(transactionService.save(any(Transaction.class))).thenReturn(transaction);
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.ser
|
|||||||
|
|
||||||
# Disable jobrunr for tests
|
# Disable jobrunr for tests
|
||||||
jobrunr.enabled=false
|
jobrunr.enabled=false
|
||||||
|
jobrunr.dashboard.enabled=false
|
||||||
|
jobrunr.storage.enabled=false
|
||||||
|
|
||||||
|
# Use in-memory database for JobRunr if enabled
|
||||||
|
spring.datasource.jobrunr.url=jdbc:h2:mem:jobrunr-test;DB_CLOSE_DELAY=-1
|
||||||
|
spring.datasource.jobrunr.driver-class-name=org.h2.Driver
|
||||||
|
spring.datasource.jobrunr.username=sa
|
||||||
|
spring.datasource.jobrunr.password=
|
||||||
|
|
||||||
# Disable mail for tests
|
# Disable mail for tests
|
||||||
spring.mail.enabled=false
|
spring.mail.enabled=false
|
||||||
Reference in New Issue
Block a user