-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrderPgData.java
38 lines (32 loc) · 1.18 KB
/
OrderPgData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public class OrderPgData {
String PgType;
int productPrice;
int paymentAmount;
private boolean isPaymentAmountTampered;
public OrderPgData(String PgType, int productPrice, int paymentAmount) {
this.PgType = PgType;
this.productPrice = productPrice;
this.paymentAmount = paymentAmount;
}
public void setIsPaymentAmountTampered(boolean isPaymentAmountTampered) {
this.isPaymentAmountTampered = isPaymentAmountTampered;
}
public boolean getIsPaymentAmountTampered() {
return this.isPaymentAmountTampered;
}
public int getProductPrice() {
return this.productPrice;
}
public int getPaymentAmount() {
return this.paymentAmount;
}
public void validateAmount() {
if (this.productPrice == this.paymentAmount) {
this.setIsPaymentAmountTampered(false);
System.out.println("isPaymentAmountTampered is changed to "+this.getIsPaymentAmountTampered()+".");
} else {
this.setIsPaymentAmountTampered(true);
System.out.println("isPaymentAmountTampered is changed to "+this.getIsPaymentAmountTampered()+".");
}
}
}