Interface AccountService

  • All Known Implementing Classes:
    NoopAccountService

    public interface AccountService
    Implemented by a bank to support Token integration.
    • Method Summary

      All Methods Instance Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default boolean confirmFunds​(io.token.proto.common.account.AccountProtos.BankAccount account, io.token.proto.common.money.MoneyProtos.Money toConfirm)
      Deprecated.
      default boolean confirmFunds​(io.token.proto.common.account.AccountProtos.BankAccount account, io.token.proto.common.money.MoneyProtos.Money toConfirm, java.lang.String consentId)
      Confirms if an account has enough funds for an amount.
      default io.token.proto.bankapi.Bankapi.GetAccountResponse.Account getAccount​(io.token.proto.common.account.AccountProtos.BankAccount account)
      Deprecated.
      default io.token.proto.bankapi.Bankapi.GetAccountResponse.Account getAccount​(io.token.proto.common.account.AccountProtos.BankAccount account, java.util.Optional<java.lang.String> consentId)
      Returns Bankapi.GetAccountResponse.Account associated with a given account.
      default io.token.proto.common.account.AccountProtos.AccountDetails getAccountDetails​(io.token.proto.common.account.AccountProtos.BankAccount account)
      Deprecated.
      default Balance getBalance​(io.token.proto.common.account.AccountProtos.BankAccount account)
      Deprecated.
      default Balance getBalance​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String consentId)
      Returns account balance information.
      default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String standingOrderId)
      default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String standingOrderId, java.lang.String consentId)
      Returns bank standing order associated with the standing order ID.
      default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrders​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String offset, int limit)
      default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrders​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String consentId, java.lang.String offset, int limit)
      Returns a list of standing orders for the specified account.
      default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String transactionId)
      default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String transactionId, java.lang.String consentId)
      Returns bank transaction associated with the transaction id.
      default java.util.List<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account, int offset, int limit)
      Deprecated.
      default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String offset, int limit)
      default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String offset, int limit, java.util.Optional<java.time.LocalDate> startDate, java.util.Optional<java.time.LocalDate> endDate)
      default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String consentId, java.lang.String offset, int limit, java.util.Optional<java.time.LocalDate> startDate, java.util.Optional<java.time.LocalDate> endDate)
      Returns a list of transactions for the specified account.
      default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferEndpoint> resolveTransferDestination​(io.token.proto.common.account.AccountProtos.BankAccount account)
      Deprecated.
      default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinations​(io.token.proto.common.account.AccountProtos.BankAccount account)
      default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinations​(io.token.proto.common.account.AccountProtos.BankAccount account, java.lang.String consentId)
      Resolves destinations for the specific bank account.
    • Method Detail

      • getBalance

        default Balance getBalance​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                   java.lang.String consentId)
        Returns account balance information.

        Used, for example, when client app shows user her account balances.

        Parameters:
        account - the account to lookup the balance for
        consentId - the consent id
        Returns:
        account balance
      • getBalance

        @Deprecated
        default Balance getBalance​(io.token.proto.common.account.AccountProtos.BankAccount account)
        Deprecated.
        Returns account balance information.
        Parameters:
        account - the account to lookup the balance for
        Returns:
        account balance
      • confirmFunds

        default boolean confirmFunds​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                     io.token.proto.common.money.MoneyProtos.Money toConfirm,
                                     java.lang.String consentId)
        Confirms if an account has enough funds for an amount.
        Parameters:
        account - the account
        toConfirm - the amount and currency
        consentId - the consent id
        Returns:
        whether the account has enough funds
      • confirmFunds

        @Deprecated
        default boolean confirmFunds​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                     io.token.proto.common.money.MoneyProtos.Money toConfirm)
        Deprecated.
        Confirms if an account has enough funds for an amount.
        Parameters:
        account - the account
        toConfirm - the amount and currency
        Returns:
        whether the account has enough funds
      • getTransaction

        default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                   java.lang.String transactionId,
                                                                                                                   java.lang.String consentId)
        Returns bank transaction associated with the transaction id.
        Parameters:
        account - the account to lookup the transaction for
        transactionId - the id of the transaction
        consentId - the consent id
        Returns:
        an observable transaction associated with the given transaction id
      • getTransaction

        @Deprecated
        default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                   java.lang.String transactionId)
        Returns bank transaction associated with the transaction id.
        Parameters:
        account - the account to lookup the transaction for
        transactionId - the id of the transaction
        Returns:
        an observable transaction associated with the given transaction id
      • getTransactions

        default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                 java.lang.String consentId,
                                                                                                                                                 java.lang.String offset,
                                                                                                                                                 int limit,
                                                                                                                                                 java.util.Optional<java.time.LocalDate> startDate,
                                                                                                                                                 java.util.Optional<java.time.LocalDate> endDate)
        Returns a list of transactions for the specified account.

        Used, for example, when client app shows user her account transactions.

        This API does "paging". It should only return up to 'limit' transactions, starting from the most recent. It also returns 'offset', which marks the place in the full transaction history. For example, the offset could be the ID of the last transaction returned. Then, if the next call to getTransactions has that ID as the offset parameter, the implementation should skip that transaction as well as every transaction more recent than it. The offset parameter does not need to be comprehensible as it will just be passed directly from the response of one call to the request of the next.

        NOTE: The default implementation is only for backwards compatibility and should not be relied upon.

        Parameters:
        account - the account to lookup the balance for
        consentId - the consent id
        offset - the result offset
        limit - the limit on the number of results returned
        startDate - optional lower bound for a transaction's booking date. If specified, then only transactions whose bank booking date is equal to or later than the given date will be regarded.
        endDate - optional upper bound for a transaction's booking date. If specified, then only transactions whose bank booking date is equal to or earlier than the given date will be regarded.
        Returns:
        a list of transactions and offset for the next getTransactions call
      • getTransactions

        @Deprecated
        default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                 java.lang.String offset,
                                                                                                                                                 int limit,
                                                                                                                                                 java.util.Optional<java.time.LocalDate> startDate,
                                                                                                                                                 java.util.Optional<java.time.LocalDate> endDate)
        Returns a list of transactions for the specified account.

        Used, for example, when client app shows user her account transactions.

        This API does "paging". It should only return up to 'limit' transactions, starting from the most recent. It also returns 'offset', which marks the place in the full transaction history. For example, the offset could be the ID of the last transaction returned. Then, if the next call to getTransactions has that ID as the offset parameter, the implementation should skip that transaction as well as every transaction more recent than it. The offset parameter does not need to be comprehensible as it will just be passed directly from the response of one call to the request of the next.

        NOTE: The default implementation is only for backwards compatibility and should not be relied upon.

        Parameters:
        account - the account to lookup the balance for
        offset - the result offset
        limit - the limit on the number of results returned
        startDate - optional lower bound for a transaction's booking date. If specified, then only transactions whose bank booking date is equal to or later than the given date will be regarded.
        endDate - optional upper bound for a transaction's booking date. If specified, then only transactions whose bank booking date is equal to or earlier than the given date will be regarded.
        Returns:
        a list of transactions and offset for the next getTransactions call
      • getTransactions

        @Deprecated
        default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                 java.lang.String offset,
                                                                                                                                                 int limit)
        Returns a list of transactions for the specified account.

        Used, for example, when client app shows user her account transactions.

        This API does "paging". It should only return up to 'limit' transactions, starting from the most recent. It also returns 'offset', which marks the place in the full transaction history. For example, the offset could be the ID of the last transaction returned. Then, if the next call to getTransactions has that ID as the offset parameter, the implementation should skip that transaction as well as every transaction more recent than it. The offset parameter does not need to be comprehensible as it will just be passed directly from the response of one call to the request of the next.

        NOTE: The default implementation is only for backwards compatibility and should not be relied upon.

        Parameters:
        account - the account to lookup the balance for
        offset - the result offset
        limit - the limit on the number of results returned
        Returns:
        a list of transactions and offset for the next getTransactions call
      • getTransactions

        @Deprecated
        default java.util.List<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransactions​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                int offset,
                                                                                                                int limit)
        Deprecated.
        DEPRECATED: implement getTransactions(BankAccount account, String offset, int limit) instead.

        Returns a list of transactions for the specified account.

        Used, for example, when client app shows user her account balances.

        This API does "paging". It should return up to `limit` recent Transactions, starting at `offset`. E.g., if `offset` is 20 and `limit` is 10, it should return the 20-29th recent Transactions.

        Parameters:
        account - the account to lookup the balance for
        offset - the result offset
        limit - the limit on the number of results returned
        Returns:
        a list of transactions
      • getStandingOrder

        default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                       java.lang.String standingOrderId,
                                                                                                                       java.lang.String consentId)
        Returns bank standing order associated with the standing order ID.
        Parameters:
        account - the account to lookup the transaction for
        standingOrderId - the ID of the standing order
        consentId - the consent id
        Returns:
        an observable standing order associated with the given standing order ID
      • getStandingOrder

        @Deprecated
        default java.util.Optional<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                       java.lang.String standingOrderId)
        Returns bank standing order associated with the standing order ID.
        Parameters:
        account - the account to lookup the transaction for
        standingOrderId - the ID of the standing order
        Returns:
        an observable standing order associated with the given standing order ID
      • getStandingOrders

        default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrders​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                     java.lang.String consentId,
                                                                                                                                                     java.lang.String offset,
                                                                                                                                                     int limit)
        Returns a list of standing orders for the specified account.

        See note on paging in getTransactions(BankAccount, String, int).

        Parameters:
        account - the account to lookup the balance for
        consentId - the consent id
        offset - the result offset
        limit - the limit on the number of results returned
        Returns:
        a list of standing orders and offset for the next getStandingOrders call
      • getStandingOrders

        default io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrders​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                     java.lang.String offset,
                                                                                                                                                     int limit)
        Returns a list of standing orders for the specified account.

        See note on paging in getTransactions(BankAccount, String, int).

        Parameters:
        account - the account to lookup the balance for
        offset - the result offset
        limit - the limit on the number of results returned
        Returns:
        a list of standing orders and offset for the next getStandingOrders call
      • resolveTransferDestination

        @Deprecated
        default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferEndpoint> resolveTransferDestination​(io.token.proto.common.account.AccountProtos.BankAccount account)
        Deprecated.
        Resolves destinations for the specific bank account.
        Parameters:
        account - The bank account to resolve. This is the same account the bank specified when linking the account.
        Returns:
        a list of destination bank accounts
      • resolveTransferDestinations

        default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinations​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                                                                                      java.lang.String consentId)
        Resolves destinations for the specific bank account.
        Parameters:
        account - The bank account to resolve. This is the same account the bank specified when linking the account.
        consentId - the consent id
        Returns:
        a list of destination bank accounts
      • resolveTransferDestinations

        @Deprecated
        default java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinations​(io.token.proto.common.account.AccountProtos.BankAccount account)
        Resolves destinations for the specific bank account.
        Parameters:
        account - The bank account to resolve. This is the same account the bank specified when linking the account.
        Returns:
        a list of destination bank accounts
      • getAccountDetails

        @Deprecated
        default io.token.proto.common.account.AccountProtos.AccountDetails getAccountDetails​(io.token.proto.common.account.AccountProtos.BankAccount account)
        Deprecated.
        Returns AccountProtos.AccountDetails associated with a given account.
        Parameters:
        account - customer account
        Returns:
        account details
      • getAccount

        default io.token.proto.bankapi.Bankapi.GetAccountResponse.Account getAccount​(io.token.proto.common.account.AccountProtos.BankAccount account,
                                                                                     java.util.Optional<java.lang.String> consentId)
        Returns Bankapi.GetAccountResponse.Account associated with a given account. The consent id will be empty if Token platform is requesting this endpoint for information. If this endpoint is invoked by the consent redeemer, the corresponding consent id will be available.
        Parameters:
        account - customer account
        consentId - the consent id
        Returns:
        account
      • getAccount

        @Deprecated
        default io.token.proto.bankapi.Bankapi.GetAccountResponse.Account getAccount​(io.token.proto.common.account.AccountProtos.BankAccount account)
        Deprecated.
        Returns Bankapi.GetAccountResponse.Account associated with a given account.
        Parameters:
        account - customer account
        Returns:
        account