@emilgroup/payment-sdk 1.4.1-beta.4 → 1.4.1-beta.40
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/.openapi-generator/FILES +15 -7
- package/README.md +2 -2
- package/api/bank-accounts-api.ts +501 -89
- package/api/bank-transaction-api.ts +303 -97
- package/api/{default-api.ts → health-check-api.ts} +23 -19
- package/api/payment-methods-api.ts +62 -243
- package/api/payment-reminders-api.ts +58 -100
- package/api/payment-setup-api.ts +18 -10
- package/api/payments-api.ts +73 -136
- package/api/refunds-api.ts +436 -0
- package/api/tenant-bank-account-api.ts +100 -102
- package/api/webhooks-api.ts +18 -14
- package/api.ts +6 -4
- package/base.ts +23 -11
- package/common.ts +4 -4
- package/configuration.ts +2 -2
- package/dist/api/bank-accounts-api.d.ts +293 -70
- package/dist/api/bank-accounts-api.js +433 -63
- package/dist/api/bank-transaction-api.d.ts +193 -83
- package/dist/api/bank-transaction-api.js +253 -66
- package/dist/api/health-check-api.d.ts +70 -0
- package/dist/api/{default-api.js → health-check-api.js} +32 -28
- package/dist/api/payment-methods-api.d.ts +52 -152
- package/dist/api/payment-methods-api.js +49 -179
- package/dist/api/payment-reminders-api.d.ts +53 -80
- package/dist/api/payment-reminders-api.js +45 -63
- package/dist/api/payment-setup-api.d.ts +18 -10
- package/dist/api/payment-setup-api.js +18 -10
- package/dist/api/payments-api.d.ts +63 -99
- package/dist/api/payments-api.js +56 -86
- package/dist/api/refunds-api.d.ts +251 -0
- package/dist/api/refunds-api.js +439 -0
- package/dist/api/tenant-bank-account-api.d.ts +94 -89
- package/dist/api/tenant-bank-account-api.js +72 -64
- package/dist/api/webhooks-api.d.ts +18 -14
- package/dist/api/webhooks-api.js +16 -12
- package/dist/api.d.ts +4 -3
- package/dist/api.js +4 -3
- package/dist/base.d.ts +7 -4
- package/dist/base.js +32 -23
- package/dist/common.d.ts +4 -4
- package/dist/common.js +2 -2
- package/dist/configuration.d.ts +2 -2
- package/dist/configuration.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/models/{bank-transaction-response-class.d.ts → bank-transaction-class-without-expand-properties.d.ts} +32 -34
- package/dist/models/{bank-transaction-response-class.js → bank-transaction-class-without-expand-properties.js} +2 -2
- package/dist/models/create-bank-account-request-dto.d.ts +42 -0
- package/dist/models/{get-request-dto.js → create-bank-account-request-dto.js} +2 -2
- package/dist/models/create-payment-reminder-request-dto.d.ts +2 -2
- package/dist/models/create-payment-reminder-request-dto.js +2 -2
- package/dist/models/create-payment-request-dto.d.ts +4 -4
- package/dist/models/create-payment-request-dto.js +2 -2
- package/dist/models/create-refund-request-dto.d.ts +24 -0
- package/dist/models/{get-bank-transactions-response-class.js → create-refund-request-dto.js} +2 -2
- package/dist/models/create-tenant-bank-account-request-dto.d.ts +2 -2
- package/dist/models/create-tenant-bank-account-request-dto.js +2 -2
- package/dist/models/create-tenant-bank-account-response-class.d.ts +25 -0
- package/dist/models/{list-bank-transactions-response-class.js → create-tenant-bank-account-response-class.js} +2 -2
- package/dist/models/deactivate-payment-reminder-request-dto.d.ts +2 -2
- package/dist/models/deactivate-payment-reminder-request-dto.js +2 -2
- package/dist/models/get-tenant-bank-account-response-class.d.ts +6 -6
- package/dist/models/get-tenant-bank-account-response-class.js +2 -2
- package/dist/models/index.d.ts +13 -6
- package/dist/models/index.js +13 -6
- package/dist/models/inline-response200.d.ts +2 -2
- package/dist/models/inline-response200.js +2 -2
- package/dist/models/inline-response503.d.ts +2 -2
- package/dist/models/inline-response503.js +2 -2
- package/dist/models/link-bank-transaction-request-dto-rest.d.ts +24 -0
- package/dist/models/link-bank-transaction-request-dto-rest.js +15 -0
- package/dist/models/list-tenant-bank-account-response-class.d.ts +31 -0
- package/dist/models/list-tenant-bank-account-response-class.js +15 -0
- package/dist/models/set-primary-bank-account-request-dto-rest.d.ts +24 -0
- package/dist/models/set-primary-bank-account-request-dto-rest.js +15 -0
- package/dist/models/tenant-bank-account-class-without-expand-properties.d.ts +78 -0
- package/dist/models/tenant-bank-account-class-without-expand-properties.js +15 -0
- package/dist/models/tenant-bank-account-class.d.ts +85 -0
- package/dist/models/tenant-bank-account-class.js +15 -0
- package/dist/models/unlink-bank-transaction-request-dto-rest.d.ts +24 -0
- package/dist/models/unlink-bank-transaction-request-dto-rest.js +15 -0
- package/dist/models/update-bank-account-request-dto-rest.d.ts +30 -0
- package/dist/models/update-bank-account-request-dto-rest.js +15 -0
- package/dist/models/update-bank-account-request-dto.d.ts +36 -0
- package/dist/models/update-bank-account-request-dto.js +15 -0
- package/dist/models/update-tenant-bank-account-response-class.d.ts +25 -0
- package/dist/models/update-tenant-bank-account-response-class.js +15 -0
- package/dist/models/update-tenant-bank-account-rest-request-dto.d.ts +2 -2
- package/dist/models/update-tenant-bank-account-rest-request-dto.js +2 -2
- package/dist/models/validate-pspconfig-request-dto.d.ts +2 -2
- package/dist/models/validate-pspconfig-request-dto.js +2 -2
- package/index.ts +2 -2
- package/models/{bank-transaction-response-class.ts → bank-transaction-class-without-expand-properties.ts} +32 -34
- package/models/create-bank-account-request-dto.ts +48 -0
- package/models/create-payment-reminder-request-dto.ts +2 -2
- package/models/create-payment-request-dto.ts +4 -4
- package/models/create-refund-request-dto.ts +30 -0
- package/models/create-tenant-bank-account-request-dto.ts +2 -2
- package/models/create-tenant-bank-account-response-class.ts +31 -0
- package/models/deactivate-payment-reminder-request-dto.ts +2 -2
- package/models/get-tenant-bank-account-response-class.ts +6 -6
- package/models/index.ts +13 -6
- package/models/inline-response200.ts +2 -2
- package/models/inline-response503.ts +2 -2
- package/models/link-bank-transaction-request-dto-rest.ts +30 -0
- package/models/list-tenant-bank-account-response-class.ts +37 -0
- package/models/set-primary-bank-account-request-dto-rest.ts +30 -0
- package/models/{tenant-bank-account-response-class.ts → tenant-bank-account-class-without-expand-properties.ts} +24 -12
- package/models/tenant-bank-account-class.ts +91 -0
- package/models/unlink-bank-transaction-request-dto-rest.ts +30 -0
- package/models/update-bank-account-request-dto-rest.ts +36 -0
- package/models/update-bank-account-request-dto.ts +42 -0
- package/models/update-tenant-bank-account-response-class.ts +31 -0
- package/models/update-tenant-bank-account-rest-request-dto.ts +2 -2
- package/models/validate-pspconfig-request-dto.ts +2 -2
- package/package.json +1 -1
- package/dist/api/default-api.d.ts +0 -66
- package/dist/models/get-bank-transactions-response-class.d.ts +0 -25
- package/dist/models/get-request-dto.d.ts +0 -30
- package/dist/models/list-bank-transactions-response-class.d.ts +0 -31
- package/dist/models/tenant-bank-account-response-class.d.ts +0 -66
- package/dist/models/tenant-bank-account-response-class.js +0 -15
- package/dist/models/transaction-class.d.ts +0 -54
- package/dist/models/transaction-class.js +0 -15
- package/models/get-bank-transactions-response-class.ts +0 -31
- package/models/get-request-dto.ts +0 -36
- package/models/list-bank-transactions-response-class.ts +0 -37
- package/models/transaction-class.ts +0 -60
package/base.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
4
|
* Emil Payment Service
|
|
5
|
-
* This service directly communicates with the various Payment Service Providers (PSPs)
|
|
5
|
+
* This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact:
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|
|
@@ -34,7 +34,7 @@ export const COLLECTION_FORMATS = {
|
|
|
34
34
|
|
|
35
35
|
export interface LoginClass {
|
|
36
36
|
accessToken: string;
|
|
37
|
-
permissions:
|
|
37
|
+
permissions: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export enum Environment {
|
|
@@ -77,6 +77,7 @@ const TOKEN_DATA = 'APP_TOKEN';
|
|
|
77
77
|
export class BaseAPI {
|
|
78
78
|
protected configuration: Configuration | undefined;
|
|
79
79
|
private tokenData?: TokenData;
|
|
80
|
+
private permissions?: string;
|
|
80
81
|
|
|
81
82
|
constructor(configuration?: Configuration,
|
|
82
83
|
protected basePath: string = BASE_PATH,
|
|
@@ -102,7 +103,15 @@ export class BaseAPI {
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
selectEnvironment(env: Environment) {
|
|
105
|
-
this.
|
|
106
|
+
this.selectBasePath(env);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
selectBasePath(path: string) {
|
|
110
|
+
this.configuration.basePath = path;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getPermissions(): Array<string> {
|
|
114
|
+
return this.permissions.split(',');
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
async authorize(username: string, password: string): Promise<void> {
|
|
@@ -119,23 +128,24 @@ export class BaseAPI {
|
|
|
119
128
|
|
|
120
129
|
const response = await globalAxios.request<LoginClass>(options);
|
|
121
130
|
|
|
122
|
-
const { data: { accessToken } } = response;
|
|
131
|
+
const { data: { accessToken, permissions } } = response;
|
|
123
132
|
|
|
124
133
|
this.configuration.username = username;
|
|
125
134
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
126
135
|
this.tokenData.username = username;
|
|
127
136
|
this.tokenData.accessToken = accessToken;
|
|
137
|
+
this.permissions = permissions;
|
|
128
138
|
|
|
129
139
|
this.storeTokenData({
|
|
130
140
|
...this.tokenData
|
|
131
141
|
});
|
|
132
142
|
}
|
|
133
143
|
|
|
134
|
-
async refreshTokenInternal(): Promise<
|
|
144
|
+
async refreshTokenInternal(): Promise<LoginClass> {
|
|
135
145
|
const { username } = this.configuration;
|
|
136
146
|
|
|
137
147
|
if (!username) {
|
|
138
|
-
|
|
148
|
+
throw new Error('Failed to refresh token.');
|
|
139
149
|
}
|
|
140
150
|
|
|
141
151
|
const options: AxiosRequestConfig = {
|
|
@@ -148,9 +158,9 @@ export class BaseAPI {
|
|
|
148
158
|
withCredentials: true,
|
|
149
159
|
};
|
|
150
160
|
|
|
151
|
-
const
|
|
161
|
+
const response = await globalAxios.request<LoginClass>(options);
|
|
152
162
|
|
|
153
|
-
return
|
|
163
|
+
return response.data;
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
private storeTokenData(tokenData?: TokenData) {
|
|
@@ -184,8 +194,9 @@ export class BaseAPI {
|
|
|
184
194
|
&& !originalConfig._retry) {
|
|
185
195
|
originalConfig._retry = true;
|
|
186
196
|
try {
|
|
187
|
-
|
|
197
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
188
198
|
const accessToken = `Bearer ${tokenString}`;
|
|
199
|
+
this.permissions = permissions;
|
|
189
200
|
|
|
190
201
|
delete originalConfig.headers['Authorization']
|
|
191
202
|
|
|
@@ -210,8 +221,9 @@ export class BaseAPI {
|
|
|
210
221
|
) {
|
|
211
222
|
_retry_count++;
|
|
212
223
|
try {
|
|
213
|
-
|
|
224
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
214
225
|
const accessToken = `Bearer ${tokenString}`;
|
|
226
|
+
this.permissions = permissions;
|
|
215
227
|
|
|
216
228
|
_retry = true;
|
|
217
229
|
originalConfig.headers['Authorization'] = accessToken;
|
package/common.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
4
|
* Emil Payment Service
|
|
5
|
-
* This service directly communicates with the various Payment Service Providers (PSPs)
|
|
5
|
+
* This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact:
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|
|
@@ -140,10 +140,10 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
|
|
|
140
140
|
/* eslint-disable */
|
|
141
141
|
/**
|
|
142
142
|
* Emil Payment Service
|
|
143
|
-
* This service directly communicates with the various Payment Service Providers (PSPs)
|
|
143
|
+
* This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
|
|
144
144
|
*
|
|
145
145
|
* The version of the OpenAPI document: 1.0
|
|
146
|
-
* Contact:
|
|
146
|
+
* Contact: kontakt@emil.de
|
|
147
147
|
*
|
|
148
148
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
149
149
|
* https://openapi-generator.tech
|
package/configuration.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
4
|
* Emil Payment Service
|
|
5
|
-
* This service directly communicates with the various Payment Service Providers (PSPs)
|
|
5
|
+
* This service directly communicates with the various Payment Service Providers (PSPs) in order to charge or refund customers. This service will automatically connect to the PSP linked in your admin configuration; meaning if you configured Stripe, it will automatically create a payment on Stripe when you create it in Emil.
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: 1.0
|
|
8
|
-
* Contact:
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
11
|
* https://openapi-generator.tech
|