payment window fix
This commit is contained in:
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PaymentGatewayPaymentSense implements PaymentGateway {
|
public class PaymentGatewayPaymentSense implements PaymentGateway {
|
||||||
@@ -34,13 +35,26 @@ public class PaymentGatewayPaymentSense implements PaymentGateway {
|
|||||||
public PaymentGatewayPaymentSense() {
|
public PaymentGatewayPaymentSense() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Window getPaymentWindow() {
|
Window getPaymentWindow(double amount) {
|
||||||
for (Window window : Window.getWindows()) {
|
if (amount > 0) {
|
||||||
if (window.isActive()) {
|
ArrayList<JPaymentSelectReceipt> paymentWindows = new ArrayList<>();
|
||||||
return window;
|
for (Window window : Window.getWindows()) {
|
||||||
|
if (window instanceof JPaymentSelectReceipt) {
|
||||||
|
paymentWindows.add((JPaymentSelectReceipt) window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return paymentWindows.get(paymentWindows.size()-1);
|
||||||
}
|
}
|
||||||
return null;
|
else {
|
||||||
|
ArrayList<JPaymentSelectRefund> paymentWindows = new ArrayList<>();
|
||||||
|
for (Window window : Window.getWindows()) {
|
||||||
|
if (window instanceof JPaymentSelectRefund) {
|
||||||
|
paymentWindows.add((JPaymentSelectRefund) window);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paymentWindows.get(paymentWindows.size()-1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user