| Line 477... |
Line 477... |
| 477 |
// (e.g. cheque numbers like "000310") are not globally unique and collide across
|
477 |
// (e.g. cheque numbers like "000310") are not globally unique and collide across
|
| 478 |
// partners; without this filter a legitimate payment is wrongly blocked as
|
478 |
// partners; without this filter a legitimate payment is wrongly blocked as
|
| 479 |
// "Entry already Approved Please reject" because a different store used the same ref.
|
479 |
// "Entry already Approved Please reject" because a different store used the same ref.
|
| 480 |
if (requests.stream().filter(x -> x.getId() != addWalletRequest.getId()).filter(x -> x.getRetailerId() == addWalletRequest.getRetailerId()).filter(x -> x.getStatus().equals(approved)).count() != 1) {
|
480 |
if (requests.stream().filter(x -> x.getId() != addWalletRequest.getId()).filter(x -> x.getRetailerId() == addWalletRequest.getRetailerId()).filter(x -> x.getStatus().equals(approved)).count() != 1) {
|
| 481 |
HdfcPayment hdfcPayment = hdfcPaymentRepository.selectByUtrNo(addWalletRequest.getTransaction_reference());
|
481 |
HdfcPayment hdfcPayment = hdfcPaymentRepository.selectByUtrNo(addWalletRequest.getTransaction_reference());
|
| - |
|
482 |
// Block only when the UTR was actually auto-credited to a wallet. Since r36927,
|
| - |
|
483 |
// hdfc_payment also holds merely-captured rows (VA missing/unmatched) that never
|
| - |
|
484 |
// credited — those MUST be approvable here, so guard on the credited flag, not
|
| - |
|
485 |
// mere row existence.
|
| 482 |
if (hdfcPayment != null) {
|
486 |
if (hdfcPayment != null && hdfcPayment.isCredited()) {
|
| 483 |
String rejectReason = "Payment for UTR Already added via Auto Update";
|
487 |
String rejectReason = "Payment for UTR Already added via Auto Update";
|
| 484 |
throw new ProfitMandiBusinessException(rejectReason, rejectReason, rejectReason);
|
488 |
throw new ProfitMandiBusinessException(rejectReason, rejectReason, rejectReason);
|
| 485 |
}
|
489 |
}
|
| 486 |
} else {
|
490 |
} else {
|
| 487 |
String rejectReason = "Entry already Approved Please reject";
|
491 |
String rejectReason = "Entry already Approved Please reject";
|