Skip to content

Commit 3c826b8

Browse files
committed
Correct Spacing in Javascript page
1 parent 9051d66 commit 3c826b8

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

docs/bank-connect/javascript.md

+30-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 | - |
@@ -40,25 +44,30 @@ POST **{{$page.frontmatter.base_url}}/{{$page.frontmatter.version}}/session/**
4044
<b>Note</b>: If the `to-date` lies in the first week of the month, the respective month is not considered in the journey.
4145

4246
::: warning NOTE
47+
4348
- `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)
4449
- Please make sure `from_date` is always less than `to_date`
4550
- Make sure `to_date` is never today's date, the maximum possible value for it is today's date - 1 day
4651
:::
4752

4853
### Response
54+
4955
On successful API call, it gives a **200 HTTP code** with a response in following format:
56+
5057
```json
5158
{
5259
"redirect_url": "https://bankconnectclient.finbox.in/?session_id=127d12db1d71bd182b"
5360
}
5461
```
62+
5563
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.
5664

5765
## Redirect Workflow
5866

5967
<img src="/javascript_redirect.jpg" alt="JavaScript SDK Redirect Workflow" />
6068

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

7685
The flow for this involves the following steps:
86+
7787
- Create a session using [Session API](/bank-connect/javascript.html#session-api)
7888
- Get the URL received from above API and embed it in an `<iframe>`
7989
- 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.
8090

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

8495
```html
@@ -96,20 +107,25 @@ The flow for this involves the following steps:
96107
```
97108

98109
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+
99111
- Interface Name: `BankConnectAndroid`
100112
- Callback Functions
101-
- All Events: `onResult`
102-
- Error: `onError`
103-
- Exit: `onExit`
104-
- Success: `onSuccess`
105-
- Extra Info: `onInfo`
113+
- All Events: `onResult`
114+
- Error: `onError`
115+
- Exit: `onExit`
116+
- Success: `onSuccess`
117+
- Extra Info: `onInfo`
106118

107119
### Event Object
120+
108121
The `event` object received by the listener can be one of the following:
122+
109123
#### Success
124+
110125
This is received when user completes the upload process.
111126

112127
1. Iframe
128+
113129
```js
114130
{
115131
type: "finbox-bankconnect",
@@ -124,6 +140,7 @@ This is received when user completes the upload process.
124140
2. WebView
125141

126142
`BankConnectAndroid.onSuccess`
143+
127144
```js
128145
{
129146
"entityId": "1d1f-sfdrf-17hf-asda", //Unique ID that will used to fetch statement data
@@ -132,9 +149,11 @@ This is received when user completes the upload process.
132149
```
133150

134151
#### Exit
152+
135153
This is received when user exits the SDK.
136154

137155
1. Iframe
156+
138157
```js
139158
{
140159
type: "finbox-bankconnect",
@@ -157,9 +176,11 @@ This is received when user exits the SDK.
157176
```
158177

159178
#### Error
179+
160180
This is received whenever any error occurs in the user flow.
161181

162182
1. Iframe
183+
163184
```js
164185
{
165186
type: "finbox-bankconnect",
@@ -188,11 +209,12 @@ In case an error occurs, you'll receive `OnError` event payload, and then if the
188209
:::
189210

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

193215
| Case | error_type | Sample payload|
194216
| - | - | - |
195-
| 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"}```|
196218
| PDF Password Incorrect | MU003 | ```{"reason:"Password Incorrect",linkID:"<USER_ID_PASSED>","error_type":"MU003"}```|
197219
| Specified bank doesn't match with detected bank | MU004 | ```{"reason:"Not axis statement",linkID:"<USER_ID_PASSED>","error_type":"MU004"}```|
198220
| Non Parsable PDF - PDF file is corrupted or has no selectable text (only scanned images)| MU006 | ```{"reason:"",linkID:"<USER_ID_PASSED>","error_type":"MU006"}```|
@@ -203,11 +225,12 @@ In case of Error, error_type of ```MUXXX``` implies an error in Manual PDF Uplo
203225
| Captcha Error | NB004 | ```{"reason:"Invalid Captcha",linkID:"<USER_ID_PASSED>","error_type":"NB004"}```|
204226
| Security Error | NB005 | ```{"reason:"failure_message",linkID:"<USER_ID_PASSED>","error_type":"NB005"}```|
205227

206-
207228
#### Info Events
229+
208230
Android and JS events are passed which can used for purposes such as analytics.The object passed is of the following format.
209231

210232
1. Iframe
233+
211234
```js
212235
{
213236
type: "finbox-bankconnect",

0 commit comments

Comments
 (0)