Statement Image Adapter Extension Tutorial

The StatementImage adapter type is invoked when navigating to the statements page:

../../../_images/statement_image_uux.png

First, let’s create the extension:

q2 create_extension
New Extension Name: StatementOfTheArt
What type of extension are you creating?

    1) Online (default)
    2) SSO (Third Party Integration)
    3) Ardent (API)
    4) Q2Console (Backoffice)
    5) Central (Legacy Backoffice)
    6) Adapter <--------
    7) Audit Action
    8) Custom Health Check
    9) Message Bus
    10) Caliper API Custom Endpoint
    11) Base Extension

Please make a selection and press Return [1]: 6

Select adapter type to generate

    1) Account Details
    2) Authentication Token
    3) Check Image
    4) Domestic Wire
    5) Deposit Item Image
    6) FX Rate
    7) Instant Payments
    8) International Wire
    9) Remote Deposit
    10) Statement Image   <--------

Please make a selection and press Return: 6

There are two methods necessary to override:

async def get_statement_periods(self, statement_image_request: StatementImageRequest) -> list[StatementPeriodInfo]:
    """This will be called after an Account is chosen on the statements landing page and is expected to return the names of the statements possible to download"""

async def get_statement_image(self, statement_image_request: StatementImageRequest) -> StatementImage:
    """After a statement period is selected, this method is called to generate the actual statement image requested"""

StatementImageRequest is an object with the metadata of the Statement/Account being requested (account_number, etc), and your responsibility is to return one or more StatementPeriodInfo instances (for instance: Feb, Mar).

After a quick q2 install, your extension will be registered and use of that page will call back to your server.