Skip to content

Commit 484f7e4

Browse files
authored
Merge pull request #183 from finbox-in/feature/add-session-config
Add Configuration for Session API
2 parents 2874900 + 3c826b8 commit 484f7e4

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

docs/bank-connect/android.md

+18
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ FinBoxBankConnect.Builder(applicationContext)
169169
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
170170
.bank("sbi") // Optional: Short code of the bank
171171
.mode(PDF) // Optional: PDF Mode
172+
.mobileNumber("9876543210") // Optional: Mobile number
173+
.journeyMode(MULTI_PDF) // Optional: Multi PDF journey
174+
.aaJourneyMode(ONLY_RECURRING) // Optional: Recurring AA pulls
175+
.aaRecurringTenureMonthCount(3) // Optional: Consent duration is valid for 3 months
176+
.aaRecurringFrequecyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
177+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
172178
.build()
173179
```
174180

@@ -183,6 +189,12 @@ new FinBoxBankConnect.Builder(getApplicationContext())
183189
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
184190
.bank("sbi") // Optional: Short code of the bank
185191
.mode(PDF) // Optional: PDF Mode
192+
.mobileNumber("9876543210") // Optional: Mobile number
193+
.journeyMode(MULTI_PDF) // Optional: Multi PDF journey
194+
.aaJourneyMode(ONLY_RECURRING) // Optional: Recurring AA pulls
195+
.aaRecurringTenureMonthCount(3) // Optional: Consent duration is valid for 3 months
196+
.aaRecurringFrequecyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
197+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
186198
.build();
187199
```
188200

@@ -197,6 +209,12 @@ new FinBoxBankConnect.Builder(getApplicationContext())
197209
| `toDate` | specifies the end period of the statement in `DD/MM/YYYY` format | No |
198210
| `bank` | pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No |
199211
| `mode` | set the mode as pdf (manual upload) or aa (Account Aggregator) or online (Net Banking) | No |
212+
| `mobile_number` | Prefills phone number in Account Aggregator mode | No |
213+
| `journey_mode` | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No |
214+
| `aa_journey_mode` | set the journey mode for AA (i.e only_once or only_recurring) | No |
215+
| `aa_recurring_tenure_month_count` | set the recurring consent duration (min: 1 and max: 24) | No |
216+
| `aa_recurring_frequecy_unit` | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No |
217+
| `aa_recurring_frequency_value` | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No |
200218

201219
`fromDate` and `toDate` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `fromDate` will be today's date - 6 months and `toDate` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
202220

docs/bank-connect/flutter.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ We have hosted a sample project on GitHub, you can check it out here:
110110
## Show SDK Screen
111111

112112
```dart
113-
FinBoxBcPlugin.initSdk("CLIENT_API_KEY","FROM_DATE","TO_DATE","BANK_NAME","MODE");
113+
FinBoxBcPlugin.initSdk("CLIENT_API_KEY","FROM_DATE","TO_DATE","BANK_NAME","MODE", "MOBILE_NUMBER", "JOURNEY_MODE", "AA_JOURNEY_MODE", "AA_RECURRING_TENURE_MONTH_COUNT", "AA_RECURRING_FREQUENCY_UNIT", "AA_RECURRING_FREQUENCY_VALUE");
114114
```
115115

116116
| Builder Property | Description | Required |
@@ -121,6 +121,12 @@ FinBoxBcPlugin.initSdk("CLIENT_API_KEY","FROM_DATE","TO_DATE","BANK_NAME","MODE"
121121
| `toDate` | specifies the end period of the statement in `DD/MM/YYYY` format | No |
122122
| `bank` | pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No |
123123
| `mode` | set the mode as pdf (manual upload) or aa (Account Aggregator) or online (Net Banking) | No |
124+
| `mobile_number` | Prefills phone number in Account Aggregator mode | No |
125+
| `journey_mode` | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No |
126+
| `aa_journey_mode` | set the journey mode for AA (i.e only_once or only_recurring) | No |
127+
| `aa_recurring_tenure_month_count` | set the recurring consent duration (min: 1 and max: 24) | No |
128+
| `aa_recurring_frequecy_unit` | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No |
129+
| `aa_recurring_frequency_value` | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No |
124130

125131
`fromDate` and `toDate` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `fromDate` will be today's date - 6 months and `toDate` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
126132

docs/bank-connect/javascript.md

+36-7
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@ base_url: https://apis.bankconnect.finbox.in/bank-connect #base URL for the API
33
version: v1 # version of API
44
---
55
# BankConnect: JavaScript
6+
67
The JavaScript SDK helps user submit their bank statements via upload or net banking credentials in your Web applications. The SDK will be opened via a web URL.
78

89
The first step in integration involves calling the [Session API](/bank-connect/javascript.html#session-api)
910
Then the workflow can be implemented in one of the following ways:
11+
1012
- [Load in a new page with redirect URL](/bank-connect/javascript.html#redirect-workflow)
1113
- [Embedding inside an Inline Frame (`<iframe>`)](/bank-connect/javascript.html#inline-frame-workflow)
1214

1315
## Session API
16+
1417
To start with the integration, call the following API to create a session:
1518

1619
::: tip Endpoint
1720
POST **{{$page.frontmatter.base_url}}/{{$page.frontmatter.version}}/session/**
1821
:::
1922

2023
### Parameters
24+
2125
| Name | Type | Description | Required | Default |
2226
| - | - | - | - | - |
2327
| link_id | string | link_id value | Yes | - |
@@ -28,31 +32,42 @@ POST **{{$page.frontmatter.base_url}}/{{$page.frontmatter.version}}/session/**
2832
| logo_url | string | An optional parameter to show logo branding in bankconnect SDK. Should be a URL.| No | - |
2933
| bank_name | string | pass the [bank identifier](/bank-connect/appendix.html#bank-identifiers) to skip the bank selection screen and directly open a that bank's screen instead | No | - |
3034
| mode | string | optional parameter to set the mode(i.e. pdf, aa, and online) | No | - |
35+
| mobile_number | string | Prefills phone number in Account Aggregator mode | No | - |
36+
| journey_mode | string | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No | - |
37+
| aa_journey_mode | string | set the journey mode for AA (i.e only_once or only_recurring) | No | - |
38+
| aa_recurring_tenure_month_count | integer | set the recurring consent duration (min: 1 and max: 24) | No | - |
39+
| aa_recurring_frequecy_unit | string | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No | - |
40+
| aa_recurring_frequency_value | integer | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No | - |
3141

3242
`from_date` and `to_date` specify the period for which the statements will be fetched. For example, if you need the last 6 months of statements, `from_date` will be today's date - 6 months and `to_date` will be today's date - 1 day. If not provided the default date range is 6 months from the current date. It should be in `DD/MM/YYYY` format.
3343

3444
<b>Note</b>: If the `to-date` lies in the first week of the month, the respective month is not considered in the journey.
3545

3646
::: warning NOTE
47+
3748
- `redirect_url` in request is a compulsory field in [Redirect Workflow](/bank-connect/javascript.html#redirect-workflow) but is not required with the [Inline Frame workflow](/bank-connect/javascript.html#inline-frame-workflow)
3849
- Please make sure `from_date` is always less than `to_date`
3950
- Make sure `to_date` is never today's date, the maximum possible value for it is today's date - 1 day
4051
:::
4152

4253
### Response
54+
4355
On successful API call, it gives a **200 HTTP code** with a response in following format:
56+
4457
```json
4558
{
4659
"redirect_url": "https://bankconnectclient.finbox.in/?session_id=127d12db1d71bd182b"
4760
}
4861
```
62+
4963
Use `redirect_url` to open up the BankConnect SDK. This URL can be used embedded inside an `<iframe>` or can be opened in a new tab or current window.
5064

5165
## Redirect Workflow
5266

5367
<img src="/javascript_redirect.jpg" alt="JavaScript SDK Redirect Workflow" />
5468

5569
The flow for this involves following steps:
70+
5671
- Create a session using [Session API](/bank-connect/javascript.html#session-api)
5772
- Get the URL received from above API and open it in a new tab
5873
- On success / exit, SDK will redirect to the specified redirect URL with parameters as follows:
@@ -68,11 +83,13 @@ Since there is no callback received on this flow, it is recommended to configure
6883
<img src="/javascript_iframe.jpg" alt="JavaScript SDK iframe Workflow" />
6984

7085
The flow for this involves the following steps:
86+
7187
- Create a session using [Session API](/bank-connect/javascript.html#session-api)
7288
- Get the URL received from above API and embed it in an `<iframe>`
7389
- You'll [receive callbacks](/bank-connect/javascript.html#receive-callbacks) by implementing an event listener. Based on the event you can close / hide the inline frame.
7490

7591
## Receive callbacks
92+
7693
1. To receive callbacks in `<iframe>` workflow, you need to implement an event listener. It can be implemented as follows:
7794

7895
```html
@@ -90,20 +107,25 @@ The flow for this involves the following steps:
90107
```
91108

92109
2. To receive callbacks in `Android WebView`, a [Javascript Interface](https://developer.android.com/guide/webapps/webview#UsingJavaScript) can be used to get the events.
110+
93111
- Interface Name: `BankConnectAndroid`
94112
- Callback Functions
95-
- All Events: `onResult`
96-
- Error: `onError`
97-
- Exit: `onExit`
98-
- Success: `onSuccess`
99-
- Extra Info: `onInfo`
113+
- All Events: `onResult`
114+
- Error: `onError`
115+
- Exit: `onExit`
116+
- Success: `onSuccess`
117+
- Extra Info: `onInfo`
100118

101119
### Event Object
120+
102121
The `event` object received by the listener can be one of the following:
122+
103123
#### Success
124+
104125
This is received when user completes the upload process.
105126

106127
1. Iframe
128+
107129
```js
108130
{
109131
type: "finbox-bankconnect",
@@ -118,6 +140,7 @@ This is received when user completes the upload process.
118140
2. WebView
119141

120142
`BankConnectAndroid.onSuccess`
143+
121144
```js
122145
{
123146
"entityId": "1d1f-sfdrf-17hf-asda", //Unique ID that will used to fetch statement data
@@ -126,9 +149,11 @@ This is received when user completes the upload process.
126149
```
127150

128151
#### Exit
152+
129153
This is received when user exits the SDK.
130154

131155
1. Iframe
156+
132157
```js
133158
{
134159
type: "finbox-bankconnect",
@@ -151,9 +176,11 @@ This is received when user exits the SDK.
151176
```
152177

153178
#### Error
179+
154180
This is received whenever any error occurs in the user flow.
155181

156182
1. Iframe
183+
157184
```js
158185
{
159186
type: "finbox-bankconnect",
@@ -182,11 +209,12 @@ In case an error occurs, you'll receive `OnError` event payload, and then if the
182209
:::
183210

184211
##### Error types
212+
185213
In case of Error, error_type of ```MUXXX``` implies an error in Manual PDF Upload and ```NBXXX``` implies its from Netbanking.
186214

187215
| Case | error_type | Sample payload|
188216
| - | - | - |
189-
| Trial Expired for Dev Credentials | MU002 | ```{"reason:"Trial Expired for Dev Credentials",linkID:"<USER_ID_PASSED>","error_type":"MU002"}```|
217+
| Trial Expired for Dev Credentials | MU002 | ```{"reason:"Trial Expired for Dev Credentials",linkID:"<USER_ID_PASSED>","error_type":"MU002"}```|
190218
| PDF Password Incorrect | MU003 | ```{"reason:"Password Incorrect",linkID:"<USER_ID_PASSED>","error_type":"MU003"}```|
191219
| Specified bank doesn't match with detected bank | MU004 | ```{"reason:"Not axis statement",linkID:"<USER_ID_PASSED>","error_type":"MU004"}```|
192220
| Non Parsable PDF - PDF file is corrupted or has no selectable text (only scanned images)| MU006 | ```{"reason:"",linkID:"<USER_ID_PASSED>","error_type":"MU006"}```|
@@ -197,11 +225,12 @@ In case of Error, error_type of ```MUXXX``` implies an error in Manual PDF Uplo
197225
| Captcha Error | NB004 | ```{"reason:"Invalid Captcha",linkID:"<USER_ID_PASSED>","error_type":"NB004"}```|
198226
| Security Error | NB005 | ```{"reason:"failure_message",linkID:"<USER_ID_PASSED>","error_type":"NB005"}```|
199227

200-
201228
#### Info Events
229+
202230
Android and JS events are passed which can used for purposes such as analytics.The object passed is of the following format.
203231

204232
1. Iframe
233+
205234
```js
206235
{
207236
type: "finbox-bankconnect",

0 commit comments

Comments
 (0)