Class AccountReferenceInConsentUpdater


  • @Service
    public class AccountReferenceInConsentUpdater
    extends Object
    This service is designed to update AccountReferences in AisConsent. Also for bank offered consent and global consent AccountReferences needed to be saved in AisConsent in order to be used in next GET calls.
    • Constructor Detail

      • AccountReferenceInConsentUpdater

        public AccountReferenceInConsentUpdater()
    • Method Detail

      • rewriteAccountAccess

        public void rewriteAccountAccess​(@NotNull
                                         @NotNull String consentId,
                                         @NotNull
                                         @NotNull de.adorsys.psd2.core.data.AccountAccess newAccountAccess,
                                         de.adorsys.psd2.xs2a.core.consent.ConsentType consentType)
        Overwrites existing account access with the new one. To be used with caution. Only allowed when you get new AccountAccess from ASPSP side, NOT ALLOWED to update consent by something coming from TPP side!
        Parameters:
        consentId - an external ID of consent, where account access to be stored
        newAccountAccess - new object with account accesses
        consentType - type of the consent
      • updateAccountReferences

        public de.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.core.data.ais.AisConsent> updateAccountReferences​(@NotNull
                                                                                                                         @NotNull String consentId,
                                                                                                                         @NotNull
                                                                                                                         @NotNull de.adorsys.psd2.core.data.ais.AisConsent aisConsent,
                                                                                                                         @NotNull
                                                                                                                         @NotNull List<Xs2aAccountDetails> accountDetails)
        Updates account resourceIDs in existing account access. If account is not found in consent's account access, will be ignored.
        Parameters:
        consentId - an external ID of consent, where account access to be stored
        aisConsent - consent for which references are being updated
        accountDetails - list of account details with referenceId set
        Returns:
        Response containing AIS Consent
      • updateCardAccountReferences

        public de.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.core.data.ais.AisConsent> updateCardAccountReferences​(String consentId,
                                                                                                                             de.adorsys.psd2.core.data.ais.AisConsent aisConsent,
                                                                                                                             List<Xs2aCardAccountDetails> accountDetails)
        Updates card account resource IDs in existing account access. If account is not found in consent's account access, will be ignored. Masked PAN and PAN corresponding is implemented here.
        Parameters:
        consentId - an external ID of consent, where account access to be stored
        aisConsent - consent for which references are being updated
        accountDetails - list of account details with referenceId set
        Returns:
        Response containing AIS Consent