| Summary: | user could pay for dish with negative balance | ||
|---|---|---|---|
| Product: | Group20 | Reporter: | awkakavou2-c |
| Component: | Canteen | Assignee: | Anders <agmller2-c> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | awkakavou2-c |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Windows | ||
|
Description
awkakavou2-c
2019-10-25 13:39:16 HKT
We have identified the problem, and within the Payment.java class we have added a "try and catch" exception. Initially are we trying to deduct the money of a users balance, but if it not possible (the balance is lower than the price of the order), then we throw an exception:
public void makePayemt() {
try {
user.removeFromBalance(order.getPrice());
} catch (Exception e) {
//TODO: Handle exception makePayment
System.out.println(e.getMessage());
}
}
I report the bug as fixed.
We have identified the problem, and within the Payment.java class we have added a "try and catch" exception. Initially are we trying to deduct the money of a users balance, but if it not possible (the balance is lower than the price of the order), then we throw an exception:
public void makePayemt() {
try {
user.removeFromBalance(order.getPrice());
} catch (Exception e) {
//TODO: Handle exception makePayment
System.out.println(e.getMessage());
}
}
I report the bug as fixed.
|