Skip to content

Commit 7b9ae44

Browse files
authored
Merge pull request #224 from finbox-in/feature/add-ios-docs
Add IOS Docs for BankConnect and Lending Product
2 parents feff681 + 88315aa commit 7b9ae44

File tree

12 files changed

+505
-46
lines changed

12 files changed

+505
-46
lines changed

docs/.vuepress/config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ module.exports = {
169169
title: 'Cordova',
170170
path: '/bank-connect/cordova.html'
171171
},
172+
{
173+
title: 'Ionic Capacitor',
174+
path: '/bank-connect/ionic-capacitor.html'
175+
},
176+
{
177+
title: 'IOS',
178+
path: '/bank-connect/ios.html'
179+
},
172180
{
173181
title: 'JavaScript',
174182
path: '/bank-connect/javascript.html'
@@ -405,6 +413,10 @@ module.exports = {
405413
title: 'Flutter',
406414
path: '/middleware/flutter.html'
407415
},
416+
{
417+
title: 'IOS',
418+
path: '/middleware/ios.html'
419+
},
408420
{
409421
title: 'REST API',
410422
path: '/middleware/sourcing-rest-api.html'

docs/.vuepress/styles/index.styl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@
6666
text-decoration: none !important
6767

6868
.custom-block.tip
69-
border-color: $accentColor
69+
border-color: $accentColor
70+
71+
.theme-default-content:not(.custom) {
72+
max-width: 800px; /* Adjust to your desired width */
73+
}

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ footer: Copyright © 2023 Moshpit Technologies Pvt. Ltd.
3838
Lets businesses get access to enriched transaction data of customers using bank statements uploaded manually or via Net Banking.
3939
</p>
4040
<p>
41-
<a href="bank-connect/" class="doc_link">See Documentation →</a>
41+
<a href="session-flow/" class="doc_link">See Documentation →</a>
4242
</p>
4343
</div>
4444
</div>

docs/bank-connect/android.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ Build the `FinBoxBankConnect` object by passing `apiKey`, `linkId`, `fromDate`,
165165
FinBoxBankConnect.Builder(applicationContext)
166166
.apiKey("CLIENT_API_KEY")
167167
.linkId("LINK_ID")
168-
.fromDate("01/01/2021") // Optional: Default 6 months old date
169-
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
170-
.bank("sbi") // Optional: Short code of the bank
171-
.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-
.aaRecurringFrequencyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
177-
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
168+
.fromDate("01/01/2021") // Optional: Default 6 months old date
169+
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
170+
.bank("sbi") // Optional: Short code of the bank
171+
.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+
.aaRecurringFrequencyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
177+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
178178
.build()
179179
```
180180

@@ -185,16 +185,16 @@ FinBoxBankConnect.Builder(applicationContext)
185185
new FinBoxBankConnect.Builder(getApplicationContext())
186186
.apiKey("CLIENT_API_KEY")
187187
.linkId("LINK_ID")
188-
.fromDate("01/01/2021") // Optional: Default 6 months old date
189-
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
190-
.bank("sbi") // Optional: Short code of the bank
191-
.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-
.aaRecurringFrequencyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
197-
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
188+
.fromDate("01/01/2021") // Optional: Default 6 months old date
189+
.toDate("01/04/2021") // Optional: Default value 1 day less than current date
190+
.bank("sbi") // Optional: Short code of the bank
191+
.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+
.aaRecurringFrequencyUnit(TimeUnit.DAYS) // Optional: Frequency value is in Days
197+
.aaRecurringFrequencyValue(2) // Optional: Number of times to pull the data
198198
.build();
199199
```
200200

docs/bank-connect/flutter.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@ We have hosted a sample project on GitHub, you can check it out here:
112112
```dart
113113
FinBoxBcPlugin.initSdk(
114114
"CLIENT_API_KEY",
115-
"FROM_DATE",
116-
"TO_DATE",
117-
"BANK_NAME",
118-
"MODE",
119-
"MOBILE_NUMBER",
120-
"JOURNEY_MODE",
121-
"AA_JOURNEY_MODE",
122-
"AA_RECURRING_TENURE_MONTH_COUNT",
123-
"AA_RECURRING_FREQUENCY_UNIT",
124-
"AA_RECURRING_FREQUENCY_VALUE"
115+
"FROM_DATE", // Optional: Default 6 months old date
116+
"TO_DATE", // Optional: Default value 1 day less than current date
117+
"BANK_NAME", // Optional: Short code of the bank
118+
"MODE", // Optional: PDF Mode
119+
"MOBILE_NUMBER", // Optional: Mobile number
120+
"JOURNEY_MODE", // Optional: Multi PDF journey
121+
"AA_JOURNEY_MODE", // Optional: Recurring AA pulls
122+
"AA_RECURRING_TENURE_MONTH_COUNT", // Optional: Consent duration is valid for 3 months
123+
"AA_RECURRING_FREQUENCY_UNIT", // Optional: Frequency value is in Days
124+
"AA_RECURRING_FREQUENCY_VALUE" // Optional: Number of times to pull the data
125125
);
126126
```
127127

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# BankConnect: Ionic Capacitor
2+
3+
Bank Connect Ionic Capacitor SDK helps user submits their bank statements via upload or net banking credentials in your Android application.
4+
5+
## Requirements
6+
7+
Bank Connect SDK works on Android 5.0+ (API level 21+), Java 8+ and AndroidX. In addition to the changes, enable desugaring to support older versions.
8+
9+
<CodeSwitcher :languages="{kotlin:'Kotlin',groovy:'Groovy'}">
10+
<template v-slot:kotlin>
11+
12+
```kotlin
13+
android {
14+
...
15+
defaultConfig {
16+
...
17+
// Minimum 5.0+ devices
18+
minSdkVersion(21)
19+
...
20+
}
21+
...
22+
compileOptions {
23+
// Flag to enable support for the new language APIs
24+
coreLibraryDesugaringEnabled = true
25+
// Sets Java compatibility to Java 8
26+
sourceCompatibility = JavaVersion.VERSION_1_8
27+
targetCompatibility = JavaVersion.VERSION_1_8
28+
}
29+
// For Kotlin projects
30+
kotlinOptions {
31+
jvmTarget = "1.8"
32+
}
33+
}
34+
35+
dependencies {
36+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
37+
}
38+
```
39+
40+
</template>
41+
<template v-slot:groovy>
42+
43+
```groovy
44+
android {
45+
...
46+
defaultConfig {
47+
...
48+
// Minimum 5.0+ devices
49+
minSdkVersion 21
50+
...
51+
}
52+
...
53+
compileOptions {
54+
// Flag to enable support for the new language APIs
55+
coreLibraryDesugaringEnabled true
56+
// Sets Java compatibility to Java 8
57+
sourceCompatibility JavaVersion.VERSION_1_8
58+
targetCompatibility JavaVersion.VERSION_1_8
59+
}
60+
// For Kotlin projects
61+
kotlinOptions {
62+
jvmTarget = "1.8"
63+
}
64+
}
65+
66+
dependencies {
67+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
68+
}
69+
```
70+
71+
</template>
72+
</CodeSwitcher>
73+
74+
## Add Plugin
75+
76+
Specify the following in `local.properties` file:
77+
78+
```properties
79+
ACCESS_KEY=<ACCESS_KEY>
80+
SECRET_KEY=<SECRET_KEY>
81+
BC_SDK_VERSION=<BC_SDK_VERSION>
82+
```
83+
84+
In the project level `build.gradle` file or `settings.gradle`, add the repository URLs to all `allprojects` block or `repositories` block inside `dependencyResolutionManagement`.
85+
86+
<CodeSwitcher :languages="{kotlin:'Kotlin',groovy:'Groovy'}">
87+
<template v-slot:kotlin>
88+
89+
```kotlin
90+
maven {
91+
setUrl("s3://risk-manager-android-sdk/artifacts")
92+
credentials(AwsCredentials::class) {
93+
accessKey = <ACCESS_KEY>
94+
secretKey = <SECRET_KEY>
95+
}
96+
content {
97+
includeGroup("in.finbox.bankconnect")
98+
}
99+
}
100+
```
101+
102+
</template>
103+
<template v-slot:groovy>
104+
105+
```groovy
106+
maven {
107+
url "s3://risk-manager-android-sdk/artifacts"
108+
credentials(AwsCredentials) {
109+
accessKey = <ACCESS_KEY>
110+
secretKey = <SECRET_KEY>
111+
}
112+
content {
113+
includeGroup("in.finbox.bankconnect")
114+
}
115+
}
116+
```
117+
118+
</template>
119+
</CodeSwitcher>
120+
121+
Add plugin dependency
122+
123+
<CodeSwitcher :languages="{npm:'NPM',yarn:'Yarn'}">
124+
<template v-slot:yarn>
125+
126+
```sh
127+
yarn add ionic-bank-connect-sdk
128+
```
129+
130+
</template>
131+
<template v-slot:npm>
132+
133+
```sh
134+
yarn add ionic-bank-connect-sdk
135+
```
136+
137+
</template>
138+
</CodeSwitcher>
139+
140+
::: warning NOTE
141+
Following will be shared by FinBox team at the time of integration:
142+
143+
- `ACCESS_KEY`
144+
- `SECRET_KEY`
145+
- `BC_SDK_VERSION`
146+
- `CLIENT_API_KEY`
147+
:::
148+
149+
## Integration Workflow
150+
151+
The diagram below illustrates the integration workflow in a nutshell:
152+
<img src="/client_sdk.jpg" alt="Client SDK Workflow" />
153+
154+
## Sample Project
155+
156+
We have hosted a sample project on GitHub, you can check it out here:
157+
<div class="button_holder">
158+
<a class="download_button" target="_blank" href="https://github.com/finbox-in/bank-connect-sample-ionic-capacitor">Open GitHub Repository</a>
159+
</div>
160+
161+
## Build Bank Connect
162+
163+
Build the `IonicBankConnectSdk` object by passing `apiKey`, `linkId`, `fromDate`, `toDate`, `bank`, `mode` and others.
164+
165+
```javascript
166+
// Build BankConnect
167+
IonicBankConnectSdk.buildBankConnect(options: {
168+
apiKey: "CLIENT_API_KEY",
169+
linkId: "LINK_ID",
170+
fromDate: "FROM_DATE", // Optional: Default 6 months old date
171+
toDate: "TO_DATE", // Optional: Default value 1 day less than current date
172+
bank: "BANK_NAME", // Optional: Short code of the bank
173+
mode: "MODE", // Optional: PDF Mode
174+
mobileNumber: "MOBILE_NUMBER", // Optional: Mobile number
175+
journeyMode: "JOURNEY_MODE", // Optional: Multi PDF journey
176+
aaJourneyMode: "AA_JOURNEY_MODE", // Optional: Recurring AA pulls
177+
aaRecurringTenureMonthCount: "AA_RECURRING_TENURE_MONTH_COUNT", // Optional: Consent duration is valid for 3 months
178+
aaRecurringFrequencyUnit: "AA_RECURRING_FREQUENCY_UNIT", // Optional: Frequency value is in Days
179+
aaRecurringFrequencyValue: "AA_RECURRING_FREQUENCY_VALUE", // Optional: Number of times to pull the data
180+
});
181+
```
182+
183+
| Builder Property | Description | Required |
184+
| - | - | - |
185+
| `apiKey` | specifies the `api_key` | Yes |
186+
| `linkId` | specifies the `link_id` | Yes |
187+
| `fromDate` | specifies the starting period of the statement in `DD/MM/YYYY`format | No |
188+
| `toDate` | specifies the end period of the statement in `DD/MM/YYYY` format | No |
189+
| `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 |
190+
| `mode` | set the mode as pdf (manual upload) or aa (Account Aggregator) or online (Net Banking) | No |
191+
| `mobile_number` | Prefills phone number in Account Aggregator mode | No |
192+
| `journey_mode` | Optional parameter to set the journey (i.e.multi_pdf or multi_banking) | No |
193+
| `aa_journey_mode` | set the journey mode for AA (i.e only_once or only_recurring) | No |
194+
| `aa_recurring_tenure_month_count` | set the recurring consent duration (min: 1 and max: 24) | No |
195+
| `aa_recurring_frequency_unit` | set the frequency unit to pull the data during the recurring consent duration (year, month, day, hour) | No |
196+
| `aa_recurring_frequency_value` | set the frequency value to pull the data during the recurring consent duration (min: 1 and max: 3) | No |
197+
198+
`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.
199+
200+
Once the above statement is added, a series of checks are done to make sure the SDK is implemented correctly. A `RunTimeException` will be thrown while trying to build the project in case any of the checks are not completed.
201+
202+
::: warning Minimal Requirements for SDK to work:
203+
204+
1. `apiKey` is is mandatory
205+
2. `linkId` is mandatory, and should be at least 8 characters long
206+
3. In case `fromDate` / `toDate` is provided, make sure they are of correct date format: `DD/MM/YYYY`.
207+
4. Make sure `fromDate` is always less than `toDate`
208+
5. Make sure `toDate` is never today's date, the maximum possible value for it is today's date - 1 day
209+
Once all these conditions are met, the BankConnect object will build.
210+
:::
211+
212+
## Show SDK Screen
213+
214+
Start Bank Screen and listen for the result
215+
216+
```javascript
217+
// Show BankConnect UI
218+
IonicBankConnectSdk.showBankConnect((error: any) => {
219+
// error callback
220+
}, (entityId: any, sessionId: any) => {
221+
// Success callback
222+
});
223+
```
224+
225+
## Parse Results
226+
227+
Once the user navigates through the banks and uploads the bank statement, the sdk automatically closes `IonicBankConnectSdk` and returns the results.
228+
229+
Success callback contains `entityId` (or `sessionId`). A successful upload contains a unique `entityId` (or `sessionId`).
230+
231+
- entityId - Unique id of a successful statement upload during Entity flow
232+
- sessionId - Session id of a successful statement upload during Session flow

0 commit comments

Comments
 (0)