plaid-link-android icon indicating copy to clipboard operation
plaid-link-android copied to clipboard

Account verificationStatus typing is inconsistent between android and ios

Open michberr opened this issue 2 years ago • 2 comments

The problem

I'm using react-native-plaid-link-sdk v8.0.0. The verificationStatus field on the LinkAccount interface is typed like so:

export interface LinkAccount {
    id: string;
    name?: string;
    mask?: string;
    type: LinkAccountType;
    subtype: LinkAccountSubtype;
    verificationStatus?: LinkAccountVerificationStatus;
}

However, on android this field is being returned as verification_status.

Environment

N/A

Steps to Reproduce

Examine the result of a LinkAccount

Expected Result

The verificationStatus field should be consistent on both android and ios and match the types defined in the sdk.

Code To Reproduce Issue

  const onSuccess = (linkSuccess: LinkSuccess) => {
    const { publicToken, metadata } = linkSuccess;
   console.log(metadata.accounts);
}

michberr avatar Sep 08 '22 14:09 michberr

Having similar issue within the LinkEvent metadata, where it's snake_case on Android and CamelCase on iOS

mhafizul avatar Sep 09 '22 03:09 mhafizul

Plus one on this one. As a temporary fix you can use metadata.metadataJson field. Looks like both android and ios returned verification_status field.

I used like this one

const parsedMetadata = metadata.metadataJson ? JSON.parse(metadata.metadataJson) : null;

After that you can use parsedMetadata.verification_status

bilousov94 avatar Jan 17 '23 18:01 bilousov94