plaid / plaid-node

Node bindings for Plaid

Home Page:https://plaid.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Institution logo not being retrieved on optional metadata true in v10.9.0 but v8.5.2 was returning logo correctly

AlexString opened this issue · comments

Hello, I have been checking this out and maybe I'm forgetting something while I did this version migration. My apologies if I opened this issue and is not big deal but I really want to know why the logo is no longer retrieved when in a previous version it worked just fine, I'm curious if is it something that is not being fully supported per institution standards as it is said in the docs:

Note: I find this behavior strange because I used the same institutions for both versions tests

include_optional_metadata - boolean
When true, return an institution's logo, brand color, and URL. When available, the bank's logo is returned as a base64 encoded 152x152 PNG, the brand color is in hexadecimal format. The default value is false.
Note that Plaid does not own any of the logos shared by the API and that by accessing or using these logos, you agree that you are doing so at your own risk and will, if necessary, obtain all required permissions from the appropriate rights holders and adhere to any applicable usage guidelines. Plaid disclaims all express or implied warranties with respect to the logos.

  • Ocurrs when calling:

institutionsGetById({ institution_id, country_codes }, { include_optional_metadata: true });

implementation (v.10.9.0) :

try {
      const response = await this.plaidClient.institutionsGetById(
       { institution_id, country_codes },
       { include_optional_metadata: true }
      );
      const { institution, request_id } = response.data;
      plaidRequestId = request_id;

      const { logo, name, primary_color } = institution;
      return { logo, name, primary_color, country_codes, institution_id };
} catch (error) { ... }

implementation (8.5.2) :

try {
      const response = await this.plaidClient.getInstitutionById(
        institution_id, country_codes, { include_optional_metadata: true }
      );
      const { institution, request_id } = response;

      const { logo, name, primary_color } = institution;
      return { logo, name, primary_color, country_codes, institution_id };
} catch (error) { ... }

Installed the minimum version required for Account Select V2 and Institution logo is not retrieved either, is there a version I could use to ensure institution logo retrieving is working?

Note: forgot to mention that I'm running in the sandbox environment

commented

I just tried this with v.10.9.0 and it worked for me -- looking at your sample code, I think the issue may be the syntax you're using. The test suite has an example of how to set include_optional_metadata:

https://github.com/plaid/plaid-node/blob/master/test/institutions.spec.ts#L42

  it('get with include_optional_metadata', async () => {
    const request: InstitutionsGetRequest = {
      count: 10,
      offset: 0,
      country_codes: [CountryCode.Us],
      options: {
        include_optional_metadata: true,
      },
    };
commented

closing this as it doesn't seem to be an issue with the library -- feel free to open a new issue or reopen this if you still need help