payment window fix
This commit is contained in:
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Slf4j
|
||||
public class PaymentGatewayPaymentSense implements PaymentGateway {
|
||||
@@ -34,13 +35,26 @@ public class PaymentGatewayPaymentSense implements PaymentGateway {
|
||||
public PaymentGatewayPaymentSense() {
|
||||
}
|
||||
|
||||
Window getPaymentWindow() {
|
||||
for (Window window : Window.getWindows()) {
|
||||
if (window.isActive()) {
|
||||
return window;
|
||||
Window getPaymentWindow(double amount) {
|
||||
if (amount > 0) {
|
||||
ArrayList<JPaymentSelectReceipt> paymentWindows = new ArrayList<>();
|
||||
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