| Line 159... |
Line 159... |
| 159 |
dbUdf5 = attribute.getValue();
|
159 |
dbUdf5 = attribute.getValue();
|
| 160 |
}
|
160 |
}
|
| 161 |
}
|
161 |
}
|
| 162 |
// verify 3 things: udf5, amount and paymentid
|
162 |
// verify 3 things: udf5, amount and paymentid
|
| 163 |
//FIXME should we first dump the data and then verify these things. ??
|
163 |
//FIXME should we first dump the data and then verify these things. ??
|
| - |
|
164 |
double returnedAmount = Double.parseDouble(amount);
|
| 164 |
log.info(paymentId+ ":"+ payment.getGatewayPaymentId() + "\n" + Double.parseDouble(amount) + ":" + dbAmount + "\n" + dbUdf5 + ":" + udf5 );
|
165 |
log.info(paymentId+ ":"+ payment.getGatewayPaymentId() + "\n" + returnedAmount + ":" + dbAmount + "\n" + dbUdf5 + ":" + udf5 );
|
| 165 |
if(!(paymentId.equalsIgnoreCase(payment.getGatewayPaymentId()) && dbAmount == Double.parseDouble(amount) && udf5.equalsIgnoreCase(dbUdf5))){
|
166 |
if(!(paymentId.equalsIgnoreCase(payment.getGatewayPaymentId()) && (Math.abs(dbAmount - returnedAmount) <= 0.50) && udf5.equalsIgnoreCase(dbUdf5))){
|
| 166 |
log.error("Checks and balance failed on returned data");
|
167 |
log.error("Checks and balance failed on returned data");
|
| 167 |
this.redirectUrl = errorUrl + "?paymentId="+merchantPaymentId;
|
168 |
this.redirectUrl = errorUrl + "?paymentId="+merchantPaymentId;
|
| 168 |
return false;
|
169 |
return false;
|
| 169 |
}
|
170 |
}
|
| 170 |
return true;
|
171 |
return true;
|