Skip to content

Commit

Permalink
[fix] Added check on transaction origin when checking payer fiscal code
Browse files Browse the repository at this point in the history
  • Loading branch information
svariant committed Jan 23, 2024
1 parent 91f3c6e commit df2289f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,13 @@ private static boolean hasValidFiscalCode(BizEvent bizEvent) {
if(bizEvent.getDebtor() != null && isValidFiscalCode(bizEvent.getDebtor().getEntityUniqueIdentifierValue())){
isValidDebtor = true;
}
if(bizEvent.getTransactionDetails() != null && bizEvent.getTransactionDetails().getUser() != null && isValidFiscalCode(bizEvent.getTransactionDetails().getUser().getFiscalCode())){
isValidPayer = true;
}
if(bizEvent.getPayer() != null && isValidFiscalCode(bizEvent.getPayer().getEntityUniqueIdentifierValue())){
isValidPayer = true;
if(BizEventToReceiptUtils.isFromAuthenticatedOrigin(bizEvent)){
if(bizEvent.getTransactionDetails() != null && bizEvent.getTransactionDetails().getUser() != null && isValidFiscalCode(bizEvent.getTransactionDetails().getUser().getFiscalCode())){
isValidPayer = true;
}
if(bizEvent.getPayer() != null && isValidFiscalCode(bizEvent.getPayer().getEntityUniqueIdentifierValue())){
isValidPayer = true;
}
}

return isValidDebtor || isValidPayer;
Expand Down

0 comments on commit df2289f

Please sign in to comment.