Skip to content

Commit

Permalink
Merge pull request #165 from SetuHQ/aa-account-discovery-gifs
Browse files Browse the repository at this point in the history
Add explainer text to AA account discovery method GIFs
  • Loading branch information
vivek-nexus authored Apr 16, 2024
2 parents 256caa4 + ff924fe commit fe77153
Showing 1 changed file with 103 additions and 90 deletions.
193 changes: 103 additions & 90 deletions content/data/account-aggregator/embed-setu-aa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,97 +18,110 @@ You can theme these screens according to your brand colors and logo.
The Account Aggregator ecosystem does not have a native method to truly auto discover accounts of a user. Hence, various methods are implemented to discover accounts, for use in different scenarios.

<table>
<tr>
<th>Managed by</th>
<th>Sub type</th>
<th>Suitable for</th>
<th>User experience</th>
</tr>
<tr>
<td rowspan="2">
<b>Setu managed</b> <br /> FIU does not know the user's bank(s)
before AA flow
</td>
<td>Lite auto discovery</td>
<td>When the user is likely to have accounts in popular banks</td>
<td>
Accounts in top banks are auto discovered. Can fallback to manual
discovery, allowing user to select banks manually.
</td>
</tr>
<tr>
<td>Manual discovery</td>
<td>When the user may or may not have accounts in popular banks</td>
<td>User must explicitly choose their banks and discover accounts</td>
</tr>
<tr>
<td>
<b>FIU managed</b> <br /> FIU knows the user's bank(s) before AA
flow
</td>
<td>Guided auto discovery</td>
<td>
<ul>
<li>When the FIU wants control over what banks users choose</li>
<li>
When FIU wants to route users smartly between AA and other
backup data sharing methods of their own
</li>
</ul>
</td>
<td>Accounts are auto discovered from FIU specified banks (max 6)</td>
</tr>
<tr>
<th>Managed by</th>
<th>Sub type</th>
<th>Suitable for</th>
<th>User experience</th>
</tr>
<tr>
<td rowspan="2">
<b>Setu managed</b> <br /> FIU does not know the user's bank(s) before AA
flow
</td>
<td>Lite auto discovery</td>
<td>When the user is likely to have accounts in popular banks</td>
<td>
Accounts in top banks are auto discovered. Can fallback to manual
discovery, allowing user to select banks manually.
</td>
</tr>
<tr>
<td>Manual discovery</td>
<td>When the user may or may not have accounts in popular banks</td>
<td>User must explicitly choose their banks and discover accounts</td>
</tr>
<tr>
<td>
<b>FIU managed</b> <br /> FIU knows the user's bank(s) before AA flow
</td>
<td>Guided auto discovery</td>
<td>
<ul>
<li>When the FIU wants control over what banks users choose</li>
<li>
When FIU wants to route users smartly between AA and other backup data
sharing methods of their own
</li>
</ul>
</td>
<td>Accounts are auto discovered from FIU specified banks (max 6)</td>
</tr>
</table>

<Row>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<img src="https://storage.googleapis.com/strapi-assets/latest/Lite-auto-discovery/Lite-auto-discovery.gif" />
<Text align="center" marginTop="none">
<b>Setu managed lite auto discovery</b>
</Text>
</Portion>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<img src="https://storage.googleapis.com/strapi-assets/latest/Manual-discovery/Manual-discovery.gif" />
<Text align="center">
<b>Setu managed manual discovery</b>
</Text>
</Portion>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<img src="https://storage.googleapis.com/strapi-assets/latest/Guided-auto-discovery/Guided-auto-discovery.gif" />
<Text align="center">
<b>FIU managed guided auto discovery</b>
</Text>
</Portion>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<Element as="div" shadow="soft" shape="rounded">
<img src="https://storage.googleapis.com/strapi-assets/latest/Lite-auto-discovery/Lite-auto-discovery.gif" />
</Element>
<Text marginTop="none">
<b>Setu managed lite auto discovery</b>—<i>Setu FIP</i> is the popular
sample bank used to auto discover accounts and <i>Setu FIP 2</i> sample
bank is manually selected by the user.
</Text>
</Portion>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<Element as="div" shadow="soft" shape="rounded">
<img src="https://storage.googleapis.com/strapi-assets/latest/Manual-discovery/Manual-discovery.gif" />
</Element>
<Text>
<b>Setu managed manual discovery</b>—<i>Setu FIP</i> and <i>Setu FIP 2</i>{" "}
sample banks are manually selected by the user.
</Text>
</Portion>
<Portion
desktopSpan="8"
tabletLandscapeSpan="4"
tabletPortraitSpan="12"
mobileSpan="12"
>
<Element as="div" shadow="soft" shape="rounded">
<img src="https://storage.googleapis.com/strapi-assets/latest/Guided-auto-discovery/Guided-auto-discovery.gif" />
</Element>
<Text>
<b>FIU managed guided auto discovery</b>—<i>Setu FIP</i> and{" "}
<i>Setu FIP 2</i> sample banks are specified by the FIU.
</Text>
</Portion>
</Row>
<Callout type="tip">
These discovery methods apply to non bank FI types as well. Banks have been
used for ease of understanding.
</Callout>
<br />

##### FIU managed guided auto discovery

To implement this discovery method, FIUs must send the list of FIPs (max 6) that should be used for a particular consent, via the <a href="/data/account-aggregator/consent-object#consent-request-object">context</a> property of the consent object.

<Callout type="warning">
FIUs must ensure to send only those FIPs with status as <code>active</code>,
which can be determined with the{" "}
<a href="/data/account-aggregator/api-integration/fip-apis#categories-of-fip-status">
Get Active FIPs
</a>{" "}
API. FIP status should be determined in realtime, before creation of each
consent using this API.
FIUs must ensure to send only those FIPs with status as <code>active</code>,
which can be determined with the{" "}
<a href="/data/account-aggregator/api-integration/fip-apis#categories-of-fip-status">
Get Active FIPs
</a>{" "}
API. FIP status should be determined in realtime, before creation of each
consent using this API.
</Callout>

<hr class="primary" />
Expand All @@ -119,15 +132,15 @@ Once you make the Create Consent request, a `url` is returned which can easily b

`https://< fiu-base-url >/consents/webview/< consent-request-id >`

- **< fiu-base-url >** — This is the base URL of the FIU service provided by Setu.
- **< consent-request-id >** — This is the request ID of the consent generated returned after the create consent request.
- **< fiu-base-url >** — This is the base URL of the FIU service provided by Setu.
- **< consent-request-id >** — This is the request ID of the consent generated returned after the create consent request.

The create consent request also takes a `redirectUrl`. Once the approval/rejection flow has been completed by the user, Setu redirects back to the specified `redirectUrl` with some query params:

- **success** — This is a boolean representing whether the approval was successful or not. (`true` for approved and `false` for rejection)
- **id** — Request ID of the consent
- **errorcode** — This is the error code representing the reason for failure. Sent only if `success = false`. Error code `1` means user rejected the consent and `5` means user cancelled the consent.
- **errormsg** — This is the error message representing the detailed reason for failure. Sent only if `success = false`. To know more about the error messages and it's meaning, please refer to the <a href="/data/account-aggregator/api-integration/notifications#consent-error-codes">Consent error codes</a> section.
- **success** — This is a boolean representing whether the approval was successful or not. (`true` for approved and `false` for rejection)
- **id** — Request ID of the consent
- **errorcode** — This is the error code representing the reason for failure. Sent only if `success = false`. Error code `1` means user rejected the consent and `5` means user cancelled the consent.
- **errormsg** — This is the error message representing the detailed reason for failure. Sent only if `success = false`. To know more about the error messages and it's meaning, please refer to the <a href="/data/account-aggregator/api-integration/notifications#consent-error-codes">Consent error codes</a> section.

<br />
The redirect URL can be configured separately for each consent request, and would
Expand All @@ -151,13 +164,13 @@ For cross-platform apps built using React Native, Setu’s consent manager can b

Below are the steps to embed the consent manager into React Native app,

- Implement a web view. Setu uses the WebView component from <a href="https://github.com/react-native-webview/react-native-webview" target="_blank">react-native-webview</a> library. You’re free to choose any other library for implementing this.
- Implement a web view. Setu uses the WebView component from <a href="https://github.com/react-native-webview/react-native-webview" target="_blank">react-native-webview</a> library. You’re free to choose any other library for implementing this.

- Pass the consent manager URL into the `uri` parameter on the WebView component. Ideally, this URL can be sent as a parameter from the previous screen to the WebView screen.
- Pass the consent manager URL into the `uri` parameter on the WebView component. Ideally, this URL can be sent as a parameter from the previous screen to the WebView screen.

- WebView component exposes a function `onNavigationStateChange` which is called every time there is a change in the navigation of web view.
- WebView component exposes a function `onNavigationStateChange` which is called every time there is a change in the navigation of web view.

- Use this function to check if the current navigation state URL of the web view is the same as the redirect URL you passed in consent manager URL. If yes, you can intercept that and change the screen from web view to a different screen in your app.
- Use this function to check if the current navigation state URL of the web view is the same as the redirect URL you passed in consent manager URL. If yes, you can intercept that and change the screen from web view to a different screen in your app.

<CodeBlockWithCopy language="jsx">
{`
Expand Down

0 comments on commit fe77153

Please sign in to comment.