@emilgroup/payment-sdk 1.0.0

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.
Files changed (160) hide show
  1. package/.openapi-generator/FILES +58 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +51 -0
  5. package/api/bank-accounts-api.ts +337 -0
  6. package/api/default-api.ts +120 -0
  7. package/api/payment-methods-api.ts +577 -0
  8. package/api/payment-reminders-api.ts +556 -0
  9. package/api/payment-service-providers-api.ts +161 -0
  10. package/api/payment-setup-api.ts +264 -0
  11. package/api/payments-api.ts +489 -0
  12. package/api/webhooks-api.ts +150 -0
  13. package/api.ts +41 -0
  14. package/base.ts +251 -0
  15. package/common.ts +198 -0
  16. package/configuration.ts +101 -0
  17. package/dist/api/bank-accounts-api.d.ts +197 -0
  18. package/dist/api/bank-accounts-api.js +347 -0
  19. package/dist/api/default-api.d.ts +66 -0
  20. package/dist/api/default-api.js +196 -0
  21. package/dist/api/payment-methods-api.d.ts +327 -0
  22. package/dist/api/payment-methods-api.js +547 -0
  23. package/dist/api/payment-reminders-api.d.ts +317 -0
  24. package/dist/api/payment-reminders-api.js +538 -0
  25. package/dist/api/payment-service-providers-api.d.ts +93 -0
  26. package/dist/api/payment-service-providers-api.js +220 -0
  27. package/dist/api/payment-setup-api.d.ts +146 -0
  28. package/dist/api/payment-setup-api.js +309 -0
  29. package/dist/api/payments-api.d.ts +281 -0
  30. package/dist/api/payments-api.js +461 -0
  31. package/dist/api/webhooks-api.d.ts +91 -0
  32. package/dist/api/webhooks-api.js +209 -0
  33. package/dist/api.d.ts +19 -0
  34. package/dist/api.js +37 -0
  35. package/dist/base.d.ts +74 -0
  36. package/dist/base.js +298 -0
  37. package/dist/common.d.ts +91 -0
  38. package/dist/common.js +276 -0
  39. package/dist/configuration.d.ts +83 -0
  40. package/dist/configuration.js +44 -0
  41. package/dist/index.d.ts +15 -0
  42. package/dist/index.js +36 -0
  43. package/dist/models/bank-account-class.d.ts +54 -0
  44. package/dist/models/bank-account-class.js +15 -0
  45. package/dist/models/billing-profile-dto.d.ts +38 -0
  46. package/dist/models/billing-profile-dto.js +15 -0
  47. package/dist/models/billing-profile-limited-response-dto.d.ts +54 -0
  48. package/dist/models/billing-profile-limited-response-dto.js +15 -0
  49. package/dist/models/complete-braintree-payment-setup-request-dto.d.ts +48 -0
  50. package/dist/models/complete-braintree-payment-setup-request-dto.js +15 -0
  51. package/dist/models/complete-payment-setup-request-dto.d.ts +32 -0
  52. package/dist/models/complete-payment-setup-request-dto.js +15 -0
  53. package/dist/models/complete-payment-setup-response-class.d.ts +25 -0
  54. package/dist/models/complete-payment-setup-response-class.js +15 -0
  55. package/dist/models/complete-stripe-payment-setup-request-dto.d.ts +60 -0
  56. package/dist/models/complete-stripe-payment-setup-request-dto.js +15 -0
  57. package/dist/models/create-bank-account-request-dto.d.ts +30 -0
  58. package/dist/models/create-bank-account-request-dto.js +15 -0
  59. package/dist/models/create-payment-method-response-class.d.ts +25 -0
  60. package/dist/models/create-payment-method-response-class.js +15 -0
  61. package/dist/models/create-payment-reminder-request-dto.d.ts +65 -0
  62. package/dist/models/create-payment-reminder-request-dto.js +26 -0
  63. package/dist/models/create-payment-request-dto.d.ts +72 -0
  64. package/dist/models/create-payment-request-dto.js +15 -0
  65. package/dist/models/create-payment-response-class.d.ts +25 -0
  66. package/dist/models/create-payment-response-class.js +15 -0
  67. package/dist/models/create-psp-payment-method-request-dto.d.ts +61 -0
  68. package/dist/models/create-psp-payment-method-request-dto.js +32 -0
  69. package/dist/models/deactivate-payment-reminder-request-dto.d.ts +30 -0
  70. package/dist/models/deactivate-payment-reminder-request-dto.js +21 -0
  71. package/dist/models/get-payment-method-response-class.d.ts +25 -0
  72. package/dist/models/get-payment-method-response-class.js +15 -0
  73. package/dist/models/get-payment-response-class.d.ts +25 -0
  74. package/dist/models/get-payment-response-class.js +15 -0
  75. package/dist/models/get-request-dto.d.ts +30 -0
  76. package/dist/models/get-request-dto.js +15 -0
  77. package/dist/models/index.d.ts +37 -0
  78. package/dist/models/index.js +53 -0
  79. package/dist/models/initiate-braintree-payment-setup-request-dto.d.ts +30 -0
  80. package/dist/models/initiate-braintree-payment-setup-request-dto.js +15 -0
  81. package/dist/models/initiate-braintree-payment-setup-response-class.d.ts +24 -0
  82. package/dist/models/initiate-braintree-payment-setup-response-class.js +15 -0
  83. package/dist/models/initiate-payment-setup-request-dto.d.ts +44 -0
  84. package/dist/models/initiate-payment-setup-request-dto.js +15 -0
  85. package/dist/models/initiate-payment-setup-response-class.d.ts +32 -0
  86. package/dist/models/initiate-payment-setup-response-class.js +15 -0
  87. package/dist/models/initiate-stripe-payment-setup-request-dto.d.ts +30 -0
  88. package/dist/models/initiate-stripe-payment-setup-request-dto.js +15 -0
  89. package/dist/models/initiate-stripe-payment-setup-response-class.d.ts +30 -0
  90. package/dist/models/initiate-stripe-payment-setup-response-class.js +15 -0
  91. package/dist/models/inline-response200.d.ts +54 -0
  92. package/dist/models/inline-response200.js +15 -0
  93. package/dist/models/inline-response503.d.ts +54 -0
  94. package/dist/models/inline-response503.js +15 -0
  95. package/dist/models/list-bank-accounts-response-class.d.ts +31 -0
  96. package/dist/models/list-bank-accounts-response-class.js +15 -0
  97. package/dist/models/list-payment-methods-response-class.d.ts +31 -0
  98. package/dist/models/list-payment-methods-response-class.js +15 -0
  99. package/dist/models/list-payment-reminders-response-class.d.ts +31 -0
  100. package/dist/models/list-payment-reminders-response-class.js +15 -0
  101. package/dist/models/list-payments-response-class.d.ts +31 -0
  102. package/dist/models/list-payments-response-class.js +15 -0
  103. package/dist/models/payment-class.d.ts +103 -0
  104. package/dist/models/payment-class.js +15 -0
  105. package/dist/models/payment-method-class.d.ts +60 -0
  106. package/dist/models/payment-method-class.js +15 -0
  107. package/dist/models/payment-reminder-class.d.ts +112 -0
  108. package/dist/models/payment-reminder-class.js +36 -0
  109. package/dist/models/sepa-direct-dto.d.ts +24 -0
  110. package/dist/models/sepa-direct-dto.js +15 -0
  111. package/dist/models/symphony-profile-limited-response-dto.d.ts +42 -0
  112. package/dist/models/symphony-profile-limited-response-dto.js +15 -0
  113. package/dist/models/transaction-class.d.ts +54 -0
  114. package/dist/models/transaction-class.js +15 -0
  115. package/dist/models/validate-pspconfig-request-dto.d.ts +43 -0
  116. package/dist/models/validate-pspconfig-request-dto.js +22 -0
  117. package/dist/models/validate-pspconfig-response-class.d.ts +24 -0
  118. package/dist/models/validate-pspconfig-response-class.js +15 -0
  119. package/git_push.sh +57 -0
  120. package/index.ts +19 -0
  121. package/models/bank-account-class.ts +60 -0
  122. package/models/billing-profile-dto.ts +44 -0
  123. package/models/billing-profile-limited-response-dto.ts +60 -0
  124. package/models/complete-braintree-payment-setup-request-dto.ts +54 -0
  125. package/models/complete-payment-setup-request-dto.ts +38 -0
  126. package/models/complete-payment-setup-response-class.ts +31 -0
  127. package/models/complete-stripe-payment-setup-request-dto.ts +66 -0
  128. package/models/create-bank-account-request-dto.ts +36 -0
  129. package/models/create-payment-method-response-class.ts +31 -0
  130. package/models/create-payment-reminder-request-dto.ts +74 -0
  131. package/models/create-payment-request-dto.ts +78 -0
  132. package/models/create-payment-response-class.ts +31 -0
  133. package/models/create-psp-payment-method-request-dto.ts +70 -0
  134. package/models/deactivate-payment-reminder-request-dto.ts +39 -0
  135. package/models/get-payment-method-response-class.ts +31 -0
  136. package/models/get-payment-response-class.ts +31 -0
  137. package/models/get-request-dto.ts +36 -0
  138. package/models/index.ts +37 -0
  139. package/models/initiate-braintree-payment-setup-request-dto.ts +36 -0
  140. package/models/initiate-braintree-payment-setup-response-class.ts +30 -0
  141. package/models/initiate-payment-setup-request-dto.ts +50 -0
  142. package/models/initiate-payment-setup-response-class.ts +38 -0
  143. package/models/initiate-stripe-payment-setup-request-dto.ts +36 -0
  144. package/models/initiate-stripe-payment-setup-response-class.ts +36 -0
  145. package/models/inline-response200.ts +48 -0
  146. package/models/inline-response503.ts +48 -0
  147. package/models/list-bank-accounts-response-class.ts +37 -0
  148. package/models/list-payment-methods-response-class.ts +37 -0
  149. package/models/list-payment-reminders-response-class.ts +37 -0
  150. package/models/list-payments-response-class.ts +37 -0
  151. package/models/payment-class.ts +109 -0
  152. package/models/payment-method-class.ts +66 -0
  153. package/models/payment-reminder-class.ts +122 -0
  154. package/models/sepa-direct-dto.ts +30 -0
  155. package/models/symphony-profile-limited-response-dto.ts +48 -0
  156. package/models/transaction-class.ts +60 -0
  157. package/models/validate-pspconfig-request-dto.ts +52 -0
  158. package/models/validate-pspconfig-response-class.ts +30 -0
  159. package/package.json +27 -0
  160. package/tsconfig.json +22 -0
@@ -0,0 +1,489 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Emil Payment Service
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
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ // @ts-ignore
24
+ import { CreatePaymentRequestDto } from '../models';
25
+ // @ts-ignore
26
+ import { CreatePaymentResponseClass } from '../models';
27
+ // @ts-ignore
28
+ import { GetPaymentResponseClass } from '../models';
29
+ // @ts-ignore
30
+ import { ListPaymentsResponseClass } from '../models';
31
+ /**
32
+ * PaymentsApi - axios parameter creator
33
+ * @export
34
+ */
35
+ export const PaymentsApiAxiosParamCreator = function (configuration?: Configuration) {
36
+ return {
37
+ /**
38
+ * Creates a payment for a specified account. This function is idempotent.
39
+ * @summary Create a payment
40
+ * @param {string} idempotencyKey Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
41
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
42
+ * @param {string} [authorization] Bearer Token
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ createPayment: async (idempotencyKey: string, createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
47
+ // verify required parameter 'idempotencyKey' is not null or undefined
48
+ assertParamExists('createPayment', 'idempotencyKey', idempotencyKey)
49
+ // verify required parameter 'createPaymentRequestDto' is not null or undefined
50
+ assertParamExists('createPayment', 'createPaymentRequestDto', createPaymentRequestDto)
51
+ const localVarPath = `/paymentservice/v1/payments`;
52
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
53
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
54
+ let baseOptions;
55
+ let baseAccessToken;
56
+ if (configuration) {
57
+ baseOptions = configuration.baseOptions;
58
+ baseAccessToken = configuration.accessToken;
59
+ }
60
+
61
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
62
+ const localVarHeaderParameter = {} as any;
63
+ const localVarQueryParameter = {} as any;
64
+
65
+ // authentication bearer required
66
+ // http bearer authentication required
67
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
68
+
69
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
70
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
71
+ }
72
+
73
+ if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
74
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
75
+ }
76
+
77
+
78
+
79
+ localVarHeaderParameter['Content-Type'] = 'application/json';
80
+
81
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
82
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
83
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
84
+ localVarRequestOptions.data = serializeDataIfNeeded(createPaymentRequestDto, localVarRequestOptions, configuration)
85
+
86
+ return {
87
+ url: toPathString(localVarUrlObj),
88
+ options: localVarRequestOptions,
89
+ };
90
+ },
91
+ /**
92
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
93
+ * @summary Retrieve a payment
94
+ * @param {string} code Unique identifier for the object.
95
+ * @param {string} [authorization] Bearer Token
96
+ * @param {string} [expand] Fields to expand response by
97
+ * @param {string} [expand2] Fields to expand response by
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ */
101
+ getPayment: async (code: string, authorization?: string, expand?: string, expand2?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
102
+ // verify required parameter 'code' is not null or undefined
103
+ assertParamExists('getPayment', 'code', code)
104
+ const localVarPath = `/paymentservice/v1/payments/{code}`;
105
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
106
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
107
+ let baseOptions;
108
+ let baseAccessToken;
109
+ if (configuration) {
110
+ baseOptions = configuration.baseOptions;
111
+ baseAccessToken = configuration.accessToken;
112
+ }
113
+
114
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
115
+ const localVarHeaderParameter = {} as any;
116
+ const localVarQueryParameter = {} as any;
117
+
118
+ // authentication bearer required
119
+ // http bearer authentication required
120
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
121
+
122
+ if (code !== undefined) {
123
+ localVarQueryParameter['code'] = code;
124
+ }
125
+
126
+ if (expand !== undefined) {
127
+ localVarQueryParameter['expand'] = expand;
128
+ }
129
+
130
+ if (expand2 !== undefined) {
131
+ localVarQueryParameter['expand'] = expand2;
132
+ }
133
+
134
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
135
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
136
+ }
137
+
138
+
139
+
140
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
141
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
142
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
143
+
144
+ return {
145
+ url: toPathString(localVarUrlObj),
146
+ options: localVarRequestOptions,
147
+ };
148
+ },
149
+ /**
150
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
151
+ * @summary List payments
152
+ * @param {string} [authorization] Bearer Token
153
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
154
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
155
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
156
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
157
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
158
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
159
+ * @param {*} [options] Override http request option.
160
+ * @throws {RequiredError}
161
+ */
162
+ listPayments: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
163
+ const localVarPath = `/paymentservice/v1/payments`;
164
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
166
+ let baseOptions;
167
+ let baseAccessToken;
168
+ if (configuration) {
169
+ baseOptions = configuration.baseOptions;
170
+ baseAccessToken = configuration.accessToken;
171
+ }
172
+
173
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
174
+ const localVarHeaderParameter = {} as any;
175
+ const localVarQueryParameter = {} as any;
176
+
177
+ // authentication bearer required
178
+ // http bearer authentication required
179
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
180
+
181
+ if (pageSize !== undefined) {
182
+ localVarQueryParameter['pageSize'] = pageSize;
183
+ }
184
+
185
+ if (pageToken !== undefined) {
186
+ localVarQueryParameter['pageToken'] = pageToken;
187
+ }
188
+
189
+ if (filter !== undefined) {
190
+ localVarQueryParameter['filter'] = filter;
191
+ }
192
+
193
+ if (search !== undefined) {
194
+ localVarQueryParameter['search'] = search;
195
+ }
196
+
197
+ if (order !== undefined) {
198
+ localVarQueryParameter['order'] = order;
199
+ }
200
+
201
+ if (expand !== undefined) {
202
+ localVarQueryParameter['expand'] = expand;
203
+ }
204
+
205
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
206
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
207
+ }
208
+
209
+
210
+
211
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
212
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
213
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
214
+
215
+ return {
216
+ url: toPathString(localVarUrlObj),
217
+ options: localVarRequestOptions,
218
+ };
219
+ },
220
+ }
221
+ };
222
+
223
+ /**
224
+ * PaymentsApi - functional programming interface
225
+ * @export
226
+ */
227
+ export const PaymentsApiFp = function(configuration?: Configuration) {
228
+ const localVarAxiosParamCreator = PaymentsApiAxiosParamCreator(configuration)
229
+ return {
230
+ /**
231
+ * Creates a payment for a specified account. This function is idempotent.
232
+ * @summary Create a payment
233
+ * @param {string} idempotencyKey Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
234
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
235
+ * @param {string} [authorization] Bearer Token
236
+ * @param {*} [options] Override http request option.
237
+ * @throws {RequiredError}
238
+ */
239
+ async createPayment(idempotencyKey: string, createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePaymentResponseClass>> {
240
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createPayment(idempotencyKey, createPaymentRequestDto, authorization, options);
241
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
242
+ },
243
+ /**
244
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
245
+ * @summary Retrieve a payment
246
+ * @param {string} code Unique identifier for the object.
247
+ * @param {string} [authorization] Bearer Token
248
+ * @param {string} [expand] Fields to expand response by
249
+ * @param {string} [expand2] Fields to expand response by
250
+ * @param {*} [options] Override http request option.
251
+ * @throws {RequiredError}
252
+ */
253
+ async getPayment(code: string, authorization?: string, expand?: string, expand2?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPaymentResponseClass>> {
254
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPayment(code, authorization, expand, expand2, options);
255
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
256
+ },
257
+ /**
258
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
259
+ * @summary List payments
260
+ * @param {string} [authorization] Bearer Token
261
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
262
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
263
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
264
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
265
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
266
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
267
+ * @param {*} [options] Override http request option.
268
+ * @throws {RequiredError}
269
+ */
270
+ async listPayments(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPaymentsResponseClass>> {
271
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listPayments(authorization, pageSize, pageToken, filter, search, order, expand, options);
272
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
273
+ },
274
+ }
275
+ };
276
+
277
+ /**
278
+ * PaymentsApi - factory interface
279
+ * @export
280
+ */
281
+ export const PaymentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
282
+ const localVarFp = PaymentsApiFp(configuration)
283
+ return {
284
+ /**
285
+ * Creates a payment for a specified account. This function is idempotent.
286
+ * @summary Create a payment
287
+ * @param {string} idempotencyKey Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
288
+ * @param {CreatePaymentRequestDto} createPaymentRequestDto
289
+ * @param {string} [authorization] Bearer Token
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ */
293
+ createPayment(idempotencyKey: string, createPaymentRequestDto: CreatePaymentRequestDto, authorization?: string, options?: any): AxiosPromise<CreatePaymentResponseClass> {
294
+ return localVarFp.createPayment(idempotencyKey, createPaymentRequestDto, authorization, options).then((request) => request(axios, basePath));
295
+ },
296
+ /**
297
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
298
+ * @summary Retrieve a payment
299
+ * @param {string} code Unique identifier for the object.
300
+ * @param {string} [authorization] Bearer Token
301
+ * @param {string} [expand] Fields to expand response by
302
+ * @param {string} [expand2] Fields to expand response by
303
+ * @param {*} [options] Override http request option.
304
+ * @throws {RequiredError}
305
+ */
306
+ getPayment(code: string, authorization?: string, expand?: string, expand2?: string, options?: any): AxiosPromise<GetPaymentResponseClass> {
307
+ return localVarFp.getPayment(code, authorization, expand, expand2, options).then((request) => request(axios, basePath));
308
+ },
309
+ /**
310
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
311
+ * @summary List payments
312
+ * @param {string} [authorization] Bearer Token
313
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
314
+ * @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
315
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
316
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
317
+ * @param {any} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
318
+ * @param {any} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
319
+ * @param {*} [options] Override http request option.
320
+ * @throws {RequiredError}
321
+ */
322
+ listPayments(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListPaymentsResponseClass> {
323
+ return localVarFp.listPayments(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
324
+ },
325
+ };
326
+ };
327
+
328
+ /**
329
+ * Request parameters for createPayment operation in PaymentsApi.
330
+ * @export
331
+ * @interface PaymentsApiCreatePaymentRequest
332
+ */
333
+ export interface PaymentsApiCreatePaymentRequest {
334
+ /**
335
+ * Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
336
+ * @type {string}
337
+ * @memberof PaymentsApiCreatePayment
338
+ */
339
+ readonly idempotencyKey: string
340
+
341
+ /**
342
+ *
343
+ * @type {CreatePaymentRequestDto}
344
+ * @memberof PaymentsApiCreatePayment
345
+ */
346
+ readonly createPaymentRequestDto: CreatePaymentRequestDto
347
+
348
+ /**
349
+ * Bearer Token
350
+ * @type {string}
351
+ * @memberof PaymentsApiCreatePayment
352
+ */
353
+ readonly authorization?: string
354
+ }
355
+
356
+ /**
357
+ * Request parameters for getPayment operation in PaymentsApi.
358
+ * @export
359
+ * @interface PaymentsApiGetPaymentRequest
360
+ */
361
+ export interface PaymentsApiGetPaymentRequest {
362
+ /**
363
+ * Unique identifier for the object.
364
+ * @type {string}
365
+ * @memberof PaymentsApiGetPayment
366
+ */
367
+ readonly code: string
368
+
369
+ /**
370
+ * Bearer Token
371
+ * @type {string}
372
+ * @memberof PaymentsApiGetPayment
373
+ */
374
+ readonly authorization?: string
375
+
376
+ /**
377
+ * Fields to expand response by
378
+ * @type {string}
379
+ * @memberof PaymentsApiGetPayment
380
+ */
381
+ readonly expand?: string
382
+
383
+ /**
384
+ * Fields to expand response by
385
+ * @type {string}
386
+ * @memberof PaymentsApiGetPayment
387
+ */
388
+ readonly expand2?: string
389
+ }
390
+
391
+ /**
392
+ * Request parameters for listPayments operation in PaymentsApi.
393
+ * @export
394
+ * @interface PaymentsApiListPaymentsRequest
395
+ */
396
+ export interface PaymentsApiListPaymentsRequest {
397
+ /**
398
+ * Bearer Token
399
+ * @type {string}
400
+ * @memberof PaymentsApiListPayments
401
+ */
402
+ readonly authorization?: string
403
+
404
+ /**
405
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
406
+ * @type {any}
407
+ * @memberof PaymentsApiListPayments
408
+ */
409
+ readonly pageSize?: any
410
+
411
+ /**
412
+ * A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
413
+ * @type {any}
414
+ * @memberof PaymentsApiListPayments
415
+ */
416
+ readonly pageToken?: any
417
+
418
+ /**
419
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
420
+ * @type {any}
421
+ * @memberof PaymentsApiListPayments
422
+ */
423
+ readonly filter?: any
424
+
425
+ /**
426
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
427
+ * @type {any}
428
+ * @memberof PaymentsApiListPayments
429
+ */
430
+ readonly search?: any
431
+
432
+ /**
433
+ * The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC.
434
+ * @type {any}
435
+ * @memberof PaymentsApiListPayments
436
+ */
437
+ readonly order?: any
438
+
439
+ /**
440
+ * Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size.
441
+ * @type {any}
442
+ * @memberof PaymentsApiListPayments
443
+ */
444
+ readonly expand?: any
445
+ }
446
+
447
+ /**
448
+ * PaymentsApi - object-oriented interface
449
+ * @export
450
+ * @class PaymentsApi
451
+ * @extends {BaseAPI}
452
+ */
453
+ export class PaymentsApi extends BaseAPI {
454
+ /**
455
+ * Creates a payment for a specified account. This function is idempotent.
456
+ * @summary Create a payment
457
+ * @param {PaymentsApiCreatePaymentRequest} requestParameters Request parameters.
458
+ * @param {*} [options] Override http request option.
459
+ * @throws {RequiredError}
460
+ * @memberof PaymentsApi
461
+ */
462
+ public createPayment(requestParameters: PaymentsApiCreatePaymentRequest, options?: AxiosRequestConfig) {
463
+ return PaymentsApiFp(this.configuration).createPayment(requestParameters.idempotencyKey, requestParameters.createPaymentRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
464
+ }
465
+
466
+ /**
467
+ * Retrieves the details of a payment that was previously created. Supply the unique payment code that was returned when you created the payment and Emil Api will return the corresponding payment information.
468
+ * @summary Retrieve a payment
469
+ * @param {PaymentsApiGetPaymentRequest} requestParameters Request parameters.
470
+ * @param {*} [options] Override http request option.
471
+ * @throws {RequiredError}
472
+ * @memberof PaymentsApi
473
+ */
474
+ public getPayment(requestParameters: PaymentsApiGetPaymentRequest, options?: AxiosRequestConfig) {
475
+ return PaymentsApiFp(this.configuration).getPayment(requestParameters.code, requestParameters.authorization, requestParameters.expand, requestParameters.expand2, options).then((request) => request(this.axios, this.basePath));
476
+ }
477
+
478
+ /**
479
+ * Returns a list of payments you’ve previously created. The payments are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
480
+ * @summary List payments
481
+ * @param {PaymentsApiListPaymentsRequest} requestParameters Request parameters.
482
+ * @param {*} [options] Override http request option.
483
+ * @throws {RequiredError}
484
+ * @memberof PaymentsApi
485
+ */
486
+ public listPayments(requestParameters: PaymentsApiListPaymentsRequest = {}, options?: AxiosRequestConfig) {
487
+ return PaymentsApiFp(this.configuration).listPayments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
488
+ }
489
+ }
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Emil Payment Service
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
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ /**
24
+ * WebhooksApi - axios parameter creator
25
+ * @export
26
+ */
27
+ export const WebhooksApiAxiosParamCreator = function (configuration?: Configuration) {
28
+ return {
29
+ /**
30
+ *
31
+ * @param {string} pspType
32
+ * @param {string} tenantSlug
33
+ * @param {*} [options] Override http request option.
34
+ * @throws {RequiredError}
35
+ */
36
+ postWebhook: async (pspType: string, tenantSlug: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
37
+ // verify required parameter 'pspType' is not null or undefined
38
+ assertParamExists('postWebhook', 'pspType', pspType)
39
+ // verify required parameter 'tenantSlug' is not null or undefined
40
+ assertParamExists('postWebhook', 'tenantSlug', tenantSlug)
41
+ const localVarPath = `/paymentservice/v1/webhooks/{pspType}/{tenantSlug}`
42
+ .replace(`{${"pspType"}}`, encodeURIComponent(String(pspType)))
43
+ .replace(`{${"tenantSlug"}}`, encodeURIComponent(String(tenantSlug)));
44
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
45
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
46
+ let baseOptions;
47
+ let baseAccessToken;
48
+ if (configuration) {
49
+ baseOptions = configuration.baseOptions;
50
+ baseAccessToken = configuration.accessToken;
51
+ }
52
+
53
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
54
+ const localVarHeaderParameter = {} as any;
55
+ const localVarQueryParameter = {} as any;
56
+
57
+
58
+
59
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
60
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
61
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
62
+
63
+ return {
64
+ url: toPathString(localVarUrlObj),
65
+ options: localVarRequestOptions,
66
+ };
67
+ },
68
+ }
69
+ };
70
+
71
+ /**
72
+ * WebhooksApi - functional programming interface
73
+ * @export
74
+ */
75
+ export const WebhooksApiFp = function(configuration?: Configuration) {
76
+ const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration)
77
+ return {
78
+ /**
79
+ *
80
+ * @param {string} pspType
81
+ * @param {string} tenantSlug
82
+ * @param {*} [options] Override http request option.
83
+ * @throws {RequiredError}
84
+ */
85
+ async postWebhook(pspType: string, tenantSlug: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
86
+ const localVarAxiosArgs = await localVarAxiosParamCreator.postWebhook(pspType, tenantSlug, options);
87
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
88
+ },
89
+ }
90
+ };
91
+
92
+ /**
93
+ * WebhooksApi - factory interface
94
+ * @export
95
+ */
96
+ export const WebhooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
97
+ const localVarFp = WebhooksApiFp(configuration)
98
+ return {
99
+ /**
100
+ *
101
+ * @param {string} pspType
102
+ * @param {string} tenantSlug
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ postWebhook(pspType: string, tenantSlug: string, options?: any): AxiosPromise<void> {
107
+ return localVarFp.postWebhook(pspType, tenantSlug, options).then((request) => request(axios, basePath));
108
+ },
109
+ };
110
+ };
111
+
112
+ /**
113
+ * Request parameters for postWebhook operation in WebhooksApi.
114
+ * @export
115
+ * @interface WebhooksApiPostWebhookRequest
116
+ */
117
+ export interface WebhooksApiPostWebhookRequest {
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof WebhooksApiPostWebhook
122
+ */
123
+ readonly pspType: string
124
+
125
+ /**
126
+ *
127
+ * @type {string}
128
+ * @memberof WebhooksApiPostWebhook
129
+ */
130
+ readonly tenantSlug: string
131
+ }
132
+
133
+ /**
134
+ * WebhooksApi - object-oriented interface
135
+ * @export
136
+ * @class WebhooksApi
137
+ * @extends {BaseAPI}
138
+ */
139
+ export class WebhooksApi extends BaseAPI {
140
+ /**
141
+ *
142
+ * @param {WebhooksApiPostWebhookRequest} requestParameters Request parameters.
143
+ * @param {*} [options] Override http request option.
144
+ * @throws {RequiredError}
145
+ * @memberof WebhooksApi
146
+ */
147
+ public postWebhook(requestParameters: WebhooksApiPostWebhookRequest, options?: AxiosRequestConfig) {
148
+ return WebhooksApiFp(this.configuration).postWebhook(requestParameters.pspType, requestParameters.tenantSlug, options).then((request) => request(this.axios, this.basePath));
149
+ }
150
+ }