@finverse/sdk-typescript 0.0.1-1646812798 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -105
- package/dist/api.d.ts +144 -15
- package/dist/api.js +71 -4
- package/dist/test/responses/identity.js +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,155 +11,154 @@ npm install @finverse/sdk-typescript
|
|
|
11
11
|
|
|
12
12
|
### 1. Authenticate with Finverse API: Obtain Customer Access Token
|
|
13
13
|
```typescript
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
// Obtain these from https://dashboard.finverse.com
|
|
15
|
+
const apiHost = "https://api.sandbox.finverse.net"
|
|
16
|
+
const clientId = process.env.FINVERSE_CLIENTID
|
|
17
|
+
const clientSecret = process.env.FINVERSE_SECRET
|
|
18
|
+
const redirectUri = process.env.REDIRECT_URI
|
|
19
|
+
|
|
20
|
+
const configuration = new Configuration({ basePath: apiHost });
|
|
21
|
+
// Obtain customer access token
|
|
22
|
+
const customerTokenResp = await new PublicApi(configuration).generateCustomerAccessToken({
|
|
23
|
+
client_id: clientId,
|
|
24
|
+
client_secret: clientSecret,
|
|
25
|
+
grant_type: 'client_credentials',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const customerAccessToken = customerTokenResp.access_token
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
### 2. Link new institution: Obtain Link Token and Link URL to launch Finverse Link UI
|
|
32
32
|
```typescript
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
// generate a link token
|
|
34
|
+
|
|
35
|
+
// reference back to your system userId, finverse does not use this
|
|
36
|
+
const userId = "someUserId"
|
|
37
|
+
// this will be sent in the redirectUri callback, can be used to identify the state
|
|
38
|
+
const state = "someUniqueState"
|
|
39
|
+
const configuration = new Configuration({
|
|
40
|
+
basePath: apiHost,
|
|
41
|
+
accessToken: customerToken.access_token
|
|
42
|
+
});
|
|
43
|
+
const linkTokenResp = await new CustomerApi(configuration).generateLinkToken({
|
|
44
|
+
ClientId: clientId,
|
|
45
45
|
UserId: userId,
|
|
46
46
|
RedirectUri: redirectUri,
|
|
47
47
|
State: state,
|
|
48
48
|
ResponseMode: "form_post",
|
|
49
49
|
ResponseType: "code",
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
GrantType: "client_credentials",
|
|
51
|
+
});
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
// The linkUrl can be used to initiate Finverse Link
|
|
54
|
+
console.log("linkUrl: " + linkTokenResp.link_url)
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
### 3. Finalize linking: Exchange code for Login Identity Access Token
|
|
58
58
|
```typescript
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
// when Finverse Link UI is successful, obtain the code from Finverse Link
|
|
60
|
+
// exchange it for a Login Identity Access Token
|
|
61
|
+
const code = "obtainAfterLink"
|
|
62
|
+
const configuration = new Configuration({
|
|
63
|
+
basePath: apiHost,
|
|
64
|
+
accessToken: customerToken.access_token
|
|
65
|
+
});
|
|
66
|
+
const loginIdentityTokenResp = await new LinkApi(configuration).token(
|
|
67
|
+
"authorization_code",
|
|
68
|
+
code,
|
|
69
|
+
clientId,
|
|
70
|
+
redirectURI,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// The loginIdentityToken can be used to retrieve data
|
|
74
|
+
const loginIdentityToken = loginIdentityTokenResp.access_token
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
### 4. Retrieve data: Get data using Login Identity Access Token
|
|
78
78
|
```typescript
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
// get LoginIdentity
|
|
80
|
+
const configuration = new Configuration({
|
|
81
|
+
basePath: apiHost,
|
|
82
|
+
accessToken: loginIdentityToken.access_token
|
|
83
|
+
});
|
|
84
|
+
const loginIdentityResp = await new LoginIdentityApi(configuration).getLoginIdentity();
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
console.log("login identity: " + loginIdentityResp.login_identity)
|
|
88
|
+
|
|
89
|
+
// get other products (Accounts, Account Numbers, Transactions)
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
### 5. Poll loginIdentityStatus until ready
|
|
94
94
|
```typescript
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// get other products (Accounts, Account Numbers, Transactions)
|
|
95
|
+
enum FinalStatus {
|
|
96
|
+
ERROR = 'ERROR',
|
|
97
|
+
DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL = 'DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL',
|
|
98
|
+
DATA_RETRIEVAL_COMPLETE = 'DATA_RETRIEVAL_COMPLETE',
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const configuration = new Configuration({
|
|
102
|
+
basePath: apiHost,
|
|
103
|
+
accessToken: loginIdentityToken.access_token
|
|
104
|
+
});
|
|
105
|
+
let loginIdentity: AxiosResponse<GetLoginIdentityByIdResponse>;
|
|
106
|
+
|
|
107
|
+
// Poll until loginIdentityStatus is ready
|
|
108
|
+
for (let i = 0; i < 20; i++) {
|
|
109
|
+
loginIdentity = await new LoginIdentityApi(configuration).getLoginIdentity();
|
|
110
|
+
const loginIdentityStatus = loginIdentity.data.login_identity.status;
|
|
111
|
+
if (
|
|
112
|
+
loginIdentityStatus === FinalStatus.ERROR ||
|
|
113
|
+
loginIdentityStatus === FinalStatus.DATA_RETRIEVAL_COMPLETE ||
|
|
114
|
+
loginIdentityStatus === FinalStatus.DATA_RETRIEVAL_PARTIALLY_SUCCESSFUL
|
|
115
|
+
) { break; }
|
|
116
|
+
|
|
117
|
+
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
console.log("login identity: " + loginIdentityResp.login_identity)
|
|
121
|
+
// get other products (Accounts, Account Numbers, Transactions)
|
|
123
122
|
```
|
|
124
123
|
|
|
125
124
|
### 6. Get Accounts
|
|
126
125
|
```typescript
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
// Get Accounts
|
|
127
|
+
const configuration = new Configuration({ basePath: apiHost, accessToken: loginIdentityToken.access_token });
|
|
128
|
+
const accountsRsp = await new LoginIdentityApi(configuration).listAccounts();
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
console.log("accounts: " + accountsResp.accounts)
|
|
132
131
|
```
|
|
133
132
|
|
|
134
133
|
### 7. Get Transactions
|
|
135
134
|
```typescript
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
// Get Transactions with pagination using offset and limit
|
|
136
|
+
let offset = 0
|
|
137
|
+
while(true) {
|
|
138
|
+
const configuration = new Configuration({ basePath: apiHost, accessToken: loginIdentityToken.access_token });
|
|
140
139
|
const transactionsResp = await new LoginIdentityApi(configuration).listTransactionsByLoginIdentityId();
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
console.log(`total: ${transactionsResp.total_transactions}, transactions: ${transactionsResp.transactions}`)
|
|
142
|
+
offset += transactionsResp.transactions.length
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
if offset >= transactionsResp.total_transactions {
|
|
146
145
|
break
|
|
147
|
-
}
|
|
148
146
|
}
|
|
147
|
+
}
|
|
149
148
|
```
|
|
150
149
|
|
|
151
150
|
### 8. Get Statements
|
|
152
151
|
```typescript
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
// Get Statements metadata
|
|
153
|
+
const configuration = new Configuration({ basePath: apiHost, accessToken: loginIdentityToken.access_token });
|
|
154
|
+
const statements = await new LoginIdentityApi(configuration).getStatements();
|
|
156
155
|
|
|
157
|
-
|
|
156
|
+
console.log("statements: " + statementsResp.statements)
|
|
158
157
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
// Get link to statement
|
|
159
|
+
// Assuming there is only one statement
|
|
160
|
+
const statementId = statements.data.statements[0].id;
|
|
162
161
|
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
// Can download statement from here
|
|
163
|
+
const satementLink = await new LoginIdentityApi(configuration).getStatementLink(statementId);
|
|
165
164
|
```
|
package/dist/api.d.ts
CHANGED
|
@@ -381,6 +381,19 @@ export interface CreateCustomerResponse {
|
|
|
381
381
|
*/
|
|
382
382
|
webhook_uris?: Array<string>;
|
|
383
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
* @export
|
|
387
|
+
* @interface CreatePaymentInstructionResponse
|
|
388
|
+
*/
|
|
389
|
+
export interface CreatePaymentInstructionResponse {
|
|
390
|
+
/**
|
|
391
|
+
*
|
|
392
|
+
* @type {string}
|
|
393
|
+
* @memberof CreatePaymentInstructionResponse
|
|
394
|
+
*/
|
|
395
|
+
payment_instruction_id?: string;
|
|
396
|
+
}
|
|
384
397
|
/**
|
|
385
398
|
*
|
|
386
399
|
* @export
|
|
@@ -835,10 +848,10 @@ export interface IdentityAddress {
|
|
|
835
848
|
source?: string;
|
|
836
849
|
/**
|
|
837
850
|
*
|
|
838
|
-
* @type {string}
|
|
851
|
+
* @type {Array<string>}
|
|
839
852
|
* @memberof IdentityAddress
|
|
840
853
|
*/
|
|
841
|
-
|
|
854
|
+
source_ids?: Array<string>;
|
|
842
855
|
/**
|
|
843
856
|
*
|
|
844
857
|
* @type {Array<string>}
|
|
@@ -872,10 +885,10 @@ export interface IdentityDateOfBirth {
|
|
|
872
885
|
source?: string;
|
|
873
886
|
/**
|
|
874
887
|
*
|
|
875
|
-
* @type {string}
|
|
888
|
+
* @type {Array<string>}
|
|
876
889
|
* @memberof IdentityDateOfBirth
|
|
877
890
|
*/
|
|
878
|
-
|
|
891
|
+
source_ids?: Array<string>;
|
|
879
892
|
/**
|
|
880
893
|
*
|
|
881
894
|
* @type {Array<string>}
|
|
@@ -915,10 +928,10 @@ export interface IdentityEmail {
|
|
|
915
928
|
source?: string;
|
|
916
929
|
/**
|
|
917
930
|
*
|
|
918
|
-
* @type {string}
|
|
931
|
+
* @type {Array<string>}
|
|
919
932
|
* @memberof IdentityEmail
|
|
920
933
|
*/
|
|
921
|
-
|
|
934
|
+
source_ids?: Array<string>;
|
|
922
935
|
/**
|
|
923
936
|
*
|
|
924
937
|
* @type {Array<string>}
|
|
@@ -970,10 +983,10 @@ export interface IdentityName {
|
|
|
970
983
|
source?: string;
|
|
971
984
|
/**
|
|
972
985
|
*
|
|
973
|
-
* @type {string}
|
|
986
|
+
* @type {Array<string>}
|
|
974
987
|
* @memberof IdentityName
|
|
975
988
|
*/
|
|
976
|
-
|
|
989
|
+
source_ids?: Array<string>;
|
|
977
990
|
/**
|
|
978
991
|
*
|
|
979
992
|
* @type {Array<string>}
|
|
@@ -1019,10 +1032,10 @@ export interface IdentityPhoneNumber {
|
|
|
1019
1032
|
source?: string;
|
|
1020
1033
|
/**
|
|
1021
1034
|
*
|
|
1022
|
-
* @type {string}
|
|
1035
|
+
* @type {Array<string>}
|
|
1023
1036
|
* @memberof IdentityPhoneNumber
|
|
1024
1037
|
*/
|
|
1025
|
-
|
|
1038
|
+
source_ids?: Array<string>;
|
|
1026
1039
|
/**
|
|
1027
1040
|
*
|
|
1028
1041
|
* @type {Array<string>}
|
|
@@ -1316,6 +1329,18 @@ export interface LinkTokenRequest {
|
|
|
1316
1329
|
* @memberof LinkTokenRequest
|
|
1317
1330
|
*/
|
|
1318
1331
|
products_supported?: Array<string>;
|
|
1332
|
+
/**
|
|
1333
|
+
* products that is requested
|
|
1334
|
+
* @type {Array<string>}
|
|
1335
|
+
* @memberof LinkTokenRequest
|
|
1336
|
+
*/
|
|
1337
|
+
products_requested?: Array<string>;
|
|
1338
|
+
/**
|
|
1339
|
+
* The identifier returned after creating payment instruction
|
|
1340
|
+
* @type {string}
|
|
1341
|
+
* @memberof LinkTokenRequest
|
|
1342
|
+
*/
|
|
1343
|
+
payment_instruction_id?: string;
|
|
1319
1344
|
}
|
|
1320
1345
|
export declare const LinkTokenRequestUiModeEnum: {
|
|
1321
1346
|
readonly Iframe: "iframe";
|
|
@@ -1774,6 +1799,73 @@ export interface PaymentDetails {
|
|
|
1774
1799
|
*/
|
|
1775
1800
|
other_info?: OtherInfo;
|
|
1776
1801
|
}
|
|
1802
|
+
/**
|
|
1803
|
+
*
|
|
1804
|
+
* @export
|
|
1805
|
+
* @interface PaymentInstruction
|
|
1806
|
+
*/
|
|
1807
|
+
export interface PaymentInstruction {
|
|
1808
|
+
/**
|
|
1809
|
+
* The recipient name
|
|
1810
|
+
* @type {string}
|
|
1811
|
+
* @memberof PaymentInstruction
|
|
1812
|
+
*/
|
|
1813
|
+
recipient_name?: string;
|
|
1814
|
+
/**
|
|
1815
|
+
* The sender name
|
|
1816
|
+
* @type {string}
|
|
1817
|
+
* @memberof PaymentInstruction
|
|
1818
|
+
*/
|
|
1819
|
+
sender_name?: string;
|
|
1820
|
+
/**
|
|
1821
|
+
* The sender account Id
|
|
1822
|
+
* @type {string}
|
|
1823
|
+
* @memberof PaymentInstruction
|
|
1824
|
+
*/
|
|
1825
|
+
sender_account_id?: string;
|
|
1826
|
+
/**
|
|
1827
|
+
* When the payment should start
|
|
1828
|
+
* @type {string}
|
|
1829
|
+
* @memberof PaymentInstruction
|
|
1830
|
+
*/
|
|
1831
|
+
start_date?: string | null;
|
|
1832
|
+
/**
|
|
1833
|
+
* When the payment should stop
|
|
1834
|
+
* @type {string}
|
|
1835
|
+
* @memberof PaymentInstruction
|
|
1836
|
+
*/
|
|
1837
|
+
end_date?: string | null;
|
|
1838
|
+
/**
|
|
1839
|
+
* The currency for the payment
|
|
1840
|
+
* @type {string}
|
|
1841
|
+
* @memberof PaymentInstruction
|
|
1842
|
+
*/
|
|
1843
|
+
currency?: string;
|
|
1844
|
+
/**
|
|
1845
|
+
* The payment amount
|
|
1846
|
+
* @type {number}
|
|
1847
|
+
* @memberof PaymentInstruction
|
|
1848
|
+
*/
|
|
1849
|
+
amount?: number;
|
|
1850
|
+
/**
|
|
1851
|
+
* How often the payment is executed
|
|
1852
|
+
* @type {string}
|
|
1853
|
+
* @memberof PaymentInstruction
|
|
1854
|
+
*/
|
|
1855
|
+
frequency?: string;
|
|
1856
|
+
/**
|
|
1857
|
+
* Related remarks
|
|
1858
|
+
* @type {string}
|
|
1859
|
+
* @memberof PaymentInstruction
|
|
1860
|
+
*/
|
|
1861
|
+
remarks?: string;
|
|
1862
|
+
/**
|
|
1863
|
+
* A customer provided key to ensure ideompotency
|
|
1864
|
+
* @type {string}
|
|
1865
|
+
* @memberof PaymentInstruction
|
|
1866
|
+
*/
|
|
1867
|
+
idempotence_key?: string;
|
|
1868
|
+
}
|
|
1777
1869
|
/**
|
|
1778
1870
|
*
|
|
1779
1871
|
* @export
|
|
@@ -2125,6 +2217,13 @@ export interface Transaction {
|
|
|
2125
2217
|
* @export
|
|
2126
2218
|
*/
|
|
2127
2219
|
export declare const CustomerApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
2220
|
+
/**
|
|
2221
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
2222
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
2223
|
+
* @param {*} [options] Override http request option.
|
|
2224
|
+
* @throws {RequiredError}
|
|
2225
|
+
*/
|
|
2226
|
+
createPaymentInstruction: (paymentInstruction: PaymentInstruction, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
2128
2227
|
/**
|
|
2129
2228
|
* generate a link token that can be used to create link
|
|
2130
2229
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -2176,6 +2275,13 @@ export declare const CustomerApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
2176
2275
|
* @export
|
|
2177
2276
|
*/
|
|
2178
2277
|
export declare const CustomerApiFp: (configuration?: Configuration) => {
|
|
2278
|
+
/**
|
|
2279
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
2280
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
2281
|
+
* @param {*} [options] Override http request option.
|
|
2282
|
+
* @throws {RequiredError}
|
|
2283
|
+
*/
|
|
2284
|
+
createPaymentInstruction(paymentInstruction: PaymentInstruction, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePaymentInstructionResponse>>;
|
|
2179
2285
|
/**
|
|
2180
2286
|
* generate a link token that can be used to create link
|
|
2181
2287
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -2227,6 +2333,13 @@ export declare const CustomerApiFp: (configuration?: Configuration) => {
|
|
|
2227
2333
|
* @export
|
|
2228
2334
|
*/
|
|
2229
2335
|
export declare const CustomerApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
2336
|
+
/**
|
|
2337
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
2338
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
2339
|
+
* @param {*} [options] Override http request option.
|
|
2340
|
+
* @throws {RequiredError}
|
|
2341
|
+
*/
|
|
2342
|
+
createPaymentInstruction(paymentInstruction: PaymentInstruction, options?: any): AxiosPromise<CreatePaymentInstructionResponse>;
|
|
2230
2343
|
/**
|
|
2231
2344
|
* generate a link token that can be used to create link
|
|
2232
2345
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -2279,6 +2392,14 @@ export declare const CustomerApiFactory: (configuration?: Configuration, basePat
|
|
|
2279
2392
|
* @interface CustomerApi
|
|
2280
2393
|
*/
|
|
2281
2394
|
export interface CustomerApiInterface {
|
|
2395
|
+
/**
|
|
2396
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
2397
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
2398
|
+
* @param {*} [options] Override http request option.
|
|
2399
|
+
* @throws {RequiredError}
|
|
2400
|
+
* @memberof CustomerApiInterface
|
|
2401
|
+
*/
|
|
2402
|
+
createPaymentInstruction(paymentInstruction: PaymentInstruction, options?: AxiosRequestConfig): AxiosPromise<CreatePaymentInstructionResponse>;
|
|
2282
2403
|
/**
|
|
2283
2404
|
* generate a link token that can be used to create link
|
|
2284
2405
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -2338,6 +2459,14 @@ export interface CustomerApiInterface {
|
|
|
2338
2459
|
* @extends {BaseAPI}
|
|
2339
2460
|
*/
|
|
2340
2461
|
export declare class CustomerApi extends BaseAPI implements CustomerApiInterface {
|
|
2462
|
+
/**
|
|
2463
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
2464
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
2465
|
+
* @param {*} [options] Override http request option.
|
|
2466
|
+
* @throws {RequiredError}
|
|
2467
|
+
* @memberof CustomerApi
|
|
2468
|
+
*/
|
|
2469
|
+
createPaymentInstruction(paymentInstruction: PaymentInstruction, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePaymentInstructionResponse>>;
|
|
2341
2470
|
/**
|
|
2342
2471
|
* generate a link token that can be used to create link
|
|
2343
2472
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -2673,7 +2802,7 @@ export declare const LoginIdentityApiAxiosParamCreator: (configuration?: Configu
|
|
|
2673
2802
|
*/
|
|
2674
2803
|
getBalanceHistory: (accountId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
2675
2804
|
/**
|
|
2676
|
-
* Get a list of identity data for a given login identity
|
|
2805
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
2677
2806
|
* @param {*} [options] Override http request option.
|
|
2678
2807
|
* @throws {RequiredError}
|
|
2679
2808
|
*/
|
|
@@ -2774,7 +2903,7 @@ export declare const LoginIdentityApiFp: (configuration?: Configuration) => {
|
|
|
2774
2903
|
*/
|
|
2775
2904
|
getBalanceHistory(accountId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBalanceHistoryResponse>>;
|
|
2776
2905
|
/**
|
|
2777
|
-
* Get a list of identity data for a given login identity
|
|
2906
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
2778
2907
|
* @param {*} [options] Override http request option.
|
|
2779
2908
|
* @throws {RequiredError}
|
|
2780
2909
|
*/
|
|
@@ -2875,7 +3004,7 @@ export declare const LoginIdentityApiFactory: (configuration?: Configuration, ba
|
|
|
2875
3004
|
*/
|
|
2876
3005
|
getBalanceHistory(accountId: string, options?: any): AxiosPromise<GetBalanceHistoryResponse>;
|
|
2877
3006
|
/**
|
|
2878
|
-
* Get a list of identity data for a given login identity
|
|
3007
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
2879
3008
|
* @param {*} [options] Override http request option.
|
|
2880
3009
|
* @throws {RequiredError}
|
|
2881
3010
|
*/
|
|
@@ -2982,7 +3111,7 @@ export interface LoginIdentityApiInterface {
|
|
|
2982
3111
|
*/
|
|
2983
3112
|
getBalanceHistory(accountId: string, options?: AxiosRequestConfig): AxiosPromise<GetBalanceHistoryResponse>;
|
|
2984
3113
|
/**
|
|
2985
|
-
* Get a list of identity data for a given login identity
|
|
3114
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
2986
3115
|
* @param {*} [options] Override http request option.
|
|
2987
3116
|
* @throws {RequiredError}
|
|
2988
3117
|
* @memberof LoginIdentityApiInterface
|
|
@@ -3099,7 +3228,7 @@ export declare class LoginIdentityApi extends BaseAPI implements LoginIdentityAp
|
|
|
3099
3228
|
*/
|
|
3100
3229
|
getBalanceHistory(accountId: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBalanceHistoryResponse>>;
|
|
3101
3230
|
/**
|
|
3102
|
-
* Get a list of identity data for a given login identity
|
|
3231
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
3103
3232
|
* @param {*} [options] Override http request option.
|
|
3104
3233
|
* @throws {RequiredError}
|
|
3105
3234
|
* @memberof LoginIdentityApi
|
package/dist/api.js
CHANGED
|
@@ -40,6 +40,38 @@ exports.LinkTokenRequestUiModeEnum = {
|
|
|
40
40
|
*/
|
|
41
41
|
exports.CustomerApiAxiosParamCreator = function (configuration) {
|
|
42
42
|
return {
|
|
43
|
+
/**
|
|
44
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
45
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
46
|
+
* @param {*} [options] Override http request option.
|
|
47
|
+
* @throws {RequiredError}
|
|
48
|
+
*/
|
|
49
|
+
createPaymentInstruction: (paymentInstruction, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
// verify required parameter 'paymentInstruction' is not null or undefined
|
|
51
|
+
common_1.assertParamExists('createPaymentInstruction', 'paymentInstruction', paymentInstruction);
|
|
52
|
+
const localVarPath = `/payments/instruction`;
|
|
53
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
54
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
55
|
+
let baseOptions;
|
|
56
|
+
if (configuration) {
|
|
57
|
+
baseOptions = configuration.baseOptions;
|
|
58
|
+
}
|
|
59
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
60
|
+
const localVarHeaderParameter = {};
|
|
61
|
+
const localVarQueryParameter = {};
|
|
62
|
+
// authentication Oauth2 required
|
|
63
|
+
// oauth required
|
|
64
|
+
yield common_1.setOAuthToObject(localVarHeaderParameter, 'Oauth2', [], configuration);
|
|
65
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
66
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
67
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
68
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
69
|
+
localVarRequestOptions.data = common_1.serializeDataIfNeeded(paymentInstruction, localVarRequestOptions, configuration);
|
|
70
|
+
return {
|
|
71
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
72
|
+
options: localVarRequestOptions,
|
|
73
|
+
};
|
|
74
|
+
}),
|
|
43
75
|
/**
|
|
44
76
|
* generate a link token that can be used to create link
|
|
45
77
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -246,6 +278,18 @@ exports.CustomerApiAxiosParamCreator = function (configuration) {
|
|
|
246
278
|
exports.CustomerApiFp = function (configuration) {
|
|
247
279
|
const localVarAxiosParamCreator = exports.CustomerApiAxiosParamCreator(configuration);
|
|
248
280
|
return {
|
|
281
|
+
/**
|
|
282
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
283
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
284
|
+
* @param {*} [options] Override http request option.
|
|
285
|
+
* @throws {RequiredError}
|
|
286
|
+
*/
|
|
287
|
+
createPaymentInstruction(paymentInstruction, options) {
|
|
288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
289
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createPaymentInstruction(paymentInstruction, options);
|
|
290
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
291
|
+
});
|
|
292
|
+
},
|
|
249
293
|
/**
|
|
250
294
|
* generate a link token that can be used to create link
|
|
251
295
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -330,6 +374,17 @@ exports.CustomerApiFp = function (configuration) {
|
|
|
330
374
|
exports.CustomerApiFactory = function (configuration, basePath, axios) {
|
|
331
375
|
const localVarFp = exports.CustomerApiFp(configuration);
|
|
332
376
|
return {
|
|
377
|
+
/**
|
|
378
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
379
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
380
|
+
* @param {*} [options] Override http request option.
|
|
381
|
+
* @throws {RequiredError}
|
|
382
|
+
*/
|
|
383
|
+
createPaymentInstruction(paymentInstruction, options) {
|
|
384
|
+
return localVarFp
|
|
385
|
+
.createPaymentInstruction(paymentInstruction, options)
|
|
386
|
+
.then((request) => request(axios, basePath));
|
|
387
|
+
},
|
|
333
388
|
/**
|
|
334
389
|
* generate a link token that can be used to create link
|
|
335
390
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -398,6 +453,18 @@ exports.CustomerApiFactory = function (configuration, basePath, axios) {
|
|
|
398
453
|
* @extends {BaseAPI}
|
|
399
454
|
*/
|
|
400
455
|
class CustomerApi extends base_1.BaseAPI {
|
|
456
|
+
/**
|
|
457
|
+
* Create a new payment instruction to be used when linking to perform debit authorization
|
|
458
|
+
* @param {PaymentInstruction} paymentInstruction Request body for starting a new Link
|
|
459
|
+
* @param {*} [options] Override http request option.
|
|
460
|
+
* @throws {RequiredError}
|
|
461
|
+
* @memberof CustomerApi
|
|
462
|
+
*/
|
|
463
|
+
createPaymentInstruction(paymentInstruction, options) {
|
|
464
|
+
return exports.CustomerApiFp(this.configuration)
|
|
465
|
+
.createPaymentInstruction(paymentInstruction, options)
|
|
466
|
+
.then((request) => request(this.axios, this.basePath));
|
|
467
|
+
}
|
|
401
468
|
/**
|
|
402
469
|
* generate a link token that can be used to create link
|
|
403
470
|
* @param {LinkTokenRequest} linkTokenRequest token request
|
|
@@ -1038,7 +1105,7 @@ exports.LoginIdentityApiAxiosParamCreator = function (configuration) {
|
|
|
1038
1105
|
};
|
|
1039
1106
|
}),
|
|
1040
1107
|
/**
|
|
1041
|
-
* Get a list of identity data for a given login identity
|
|
1108
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
1042
1109
|
* @param {*} [options] Override http request option.
|
|
1043
1110
|
* @throws {RequiredError}
|
|
1044
1111
|
*/
|
|
@@ -1374,7 +1441,7 @@ exports.LoginIdentityApiFp = function (configuration) {
|
|
|
1374
1441
|
});
|
|
1375
1442
|
},
|
|
1376
1443
|
/**
|
|
1377
|
-
* Get a list of identity data for a given login identity
|
|
1444
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
1378
1445
|
* @param {*} [options] Override http request option.
|
|
1379
1446
|
* @throws {RequiredError}
|
|
1380
1447
|
*/
|
|
@@ -1533,7 +1600,7 @@ exports.LoginIdentityApiFactory = function (configuration, basePath, axios) {
|
|
|
1533
1600
|
return localVarFp.getBalanceHistory(accountId, options).then((request) => request(axios, basePath));
|
|
1534
1601
|
},
|
|
1535
1602
|
/**
|
|
1536
|
-
* Get a list of identity data for a given login identity
|
|
1603
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
1537
1604
|
* @param {*} [options] Override http request option.
|
|
1538
1605
|
* @throws {RequiredError}
|
|
1539
1606
|
*/
|
|
@@ -1684,7 +1751,7 @@ class LoginIdentityApi extends base_1.BaseAPI {
|
|
|
1684
1751
|
.then((request) => request(this.axios, this.basePath));
|
|
1685
1752
|
}
|
|
1686
1753
|
/**
|
|
1687
|
-
* Get a list of identity data for a given login identity
|
|
1754
|
+
* \\[BETA] Get a list of identity data for a given login identity
|
|
1688
1755
|
* @param {*} [options] Override http request option.
|
|
1689
1756
|
* @throws {RequiredError}
|
|
1690
1757
|
* @memberof LoginIdentityApi
|
|
@@ -11,7 +11,7 @@ function getIdentity() {
|
|
|
11
11
|
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
12
12
|
raw: 'Some location',
|
|
13
13
|
source: 'ONLINE_BANKING',
|
|
14
|
-
|
|
14
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
17
|
emails: [
|
|
@@ -19,7 +19,7 @@ function getIdentity() {
|
|
|
19
19
|
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
20
20
|
raw: 'john@company.com',
|
|
21
21
|
source: 'ONLINE_BANKING',
|
|
22
|
-
|
|
22
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
names: [
|
|
@@ -28,14 +28,14 @@ function getIdentity() {
|
|
|
28
28
|
full_name: 'John Doe',
|
|
29
29
|
raw: 'John Doe',
|
|
30
30
|
source: 'ONLINE_BANKING',
|
|
31
|
-
|
|
31
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
account_ids: ['01FG0M30612SWYQFRD6A2581Z2'],
|
|
35
35
|
full_name: 'Joe',
|
|
36
36
|
raw: 'Joe',
|
|
37
37
|
source: 'ONLINE_BANKING',
|
|
38
|
-
|
|
38
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
41
|
phone_numbers: [
|
|
@@ -43,7 +43,7 @@ function getIdentity() {
|
|
|
43
43
|
account_ids: ['01FG0M305NNFND0ZK5EC6ARXQA', '01FG0M305QAAER7Z6XVZAEV4R9', '01FG0M305V0Z3MADJR00VFYDGG'],
|
|
44
44
|
raw: '12345678',
|
|
45
45
|
source: 'ONLINE_BANKING',
|
|
46
|
-
|
|
46
|
+
source_ids: ['01FG0M3D2GEM6Z2E1NV62WTY95'],
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finverse/sdk-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "OpenAPI client for @finverse/sdk-typescript",
|
|
5
5
|
"author": "OpenAPI-Generator Contributors",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/node": "^12.11.5",
|
|
27
27
|
"axios-mock-adapter": "^1.20.0",
|
|
28
28
|
"chai": "^4.3.6",
|
|
29
|
-
"mocha": "^9.2.
|
|
29
|
+
"mocha": "^9.2.2",
|
|
30
30
|
"ts-node": "^10.7.0",
|
|
31
31
|
"typescript": "^3.6.4"
|
|
32
32
|
},
|