use of com.forgerock.openbanking.common.model.openbanking.domain.common.FRAccountIdentifier in project openbanking-aspsp by OpenBankingToolkit.
the class FRAccountIdentifierConverterTest method FRAccountIdentifier_toOBFundsConfirmationConsent1DataDebtorAccount.
@Test
public void FRAccountIdentifier_toOBFundsConfirmationConsent1DataDebtorAccount() {
// Given
FRAccountIdentifier accountIdentifier = new FRAccountIdentifier();
accountIdentifier.setName(this.name);
accountIdentifier.setIdentification(this.identification);
accountIdentifier.setSchemeName(this.schemeName);
accountIdentifier.setSecondaryIdentification(this.secondaryIdentification);
// When
OBFundsConfirmationConsent1DataDebtorAccount account = toOBFundsConfirmationConsent1DataDebtorAccount(accountIdentifier);
// Then
assertThat(account.getName()).isEqualTo(this.name);
assertThat(account.getIdentification()).isEqualTo(this.identification);
assertThat(account.getSchemeName()).isEqualTo(this.schemeName);
assertThat(account.getSecondaryIdentification()).isEqualTo(this.secondaryIdentification);
}
use of com.forgerock.openbanking.common.model.openbanking.domain.common.FRAccountIdentifier in project openbanking-aspsp by OpenBankingToolkit.
the class FRAccountRepositoryImpl method filterAccount.
private void filterAccount(FRAccount account, List<FRExternalPermissionsCode> permissions) {
for (FRExternalPermissionsCode permission : permissions) {
switch(permission) {
case READACCOUNTSBASIC:
account.getAccount().setAccounts(null);
account.getAccount().setServicer(null);
break;
case READACCOUNTSDETAIL:
if (!CollectionUtils.isEmpty(account.getAccount().getAccounts())) {
for (FRAccountIdentifier subAccount : account.getAccount().getAccounts()) {
if (!permissions.contains(FRExternalPermissionsCode.READPAN) && OBExternalAccountIdentification3Code.PAN.toString().equals(subAccount.getSchemeName())) {
subAccount.setIdentification("xxx");
}
}
}
break;
}
}
}
Aggregations