@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,577 @@
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 { CreatePaymentMethodResponseClass } from '../models';
25
+ // @ts-ignore
26
+ import { CreatePspPaymentMethodRequestDto } from '../models';
27
+ // @ts-ignore
28
+ import { GetPaymentMethodResponseClass } from '../models';
29
+ // @ts-ignore
30
+ import { ListPaymentMethodsResponseClass } from '../models';
31
+ /**
32
+ * PaymentMethodsApi - axios parameter creator
33
+ * @export
34
+ */
35
+ export const PaymentMethodsApiAxiosParamCreator = function (configuration?: Configuration) {
36
+ return {
37
+ /**
38
+ * This will create payment method in the database as well as in the PSP. The newly created payment method will be set as default payment method will be used by the customer to pay or receive a refund.
39
+ * @summary Create the payment-method
40
+ * @param {CreatePspPaymentMethodRequestDto} createPspPaymentMethodRequestDto
41
+ * @param {string} [authorization] Bearer Token
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ createPaymentMethod: async (createPspPaymentMethodRequestDto: CreatePspPaymentMethodRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
46
+ // verify required parameter 'createPspPaymentMethodRequestDto' is not null or undefined
47
+ assertParamExists('createPaymentMethod', 'createPspPaymentMethodRequestDto', createPspPaymentMethodRequestDto)
48
+ const localVarPath = `/paymentservice/v1/payment-methods`;
49
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
51
+ let baseOptions;
52
+ let baseAccessToken;
53
+ if (configuration) {
54
+ baseOptions = configuration.baseOptions;
55
+ baseAccessToken = configuration.accessToken;
56
+ }
57
+
58
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
59
+ const localVarHeaderParameter = {} as any;
60
+ const localVarQueryParameter = {} as any;
61
+
62
+ // authentication bearer required
63
+ // http bearer authentication required
64
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
65
+
66
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
67
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
68
+ }
69
+
70
+
71
+
72
+ localVarHeaderParameter['Content-Type'] = 'application/json';
73
+
74
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
75
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
76
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
77
+ localVarRequestOptions.data = serializeDataIfNeeded(createPspPaymentMethodRequestDto, localVarRequestOptions, configuration)
78
+
79
+ return {
80
+ url: toPathString(localVarUrlObj),
81
+ options: localVarRequestOptions,
82
+ };
83
+ },
84
+ /**
85
+ * Permanently deletes a payment method. Supply the unique payment method id that was returned when you created the payment method and this will delete it. It will also delete it on the corresponding payment service provider.
86
+ * @summary Delete a payment method
87
+ * @param {number} id Unique identifier for payment method
88
+ * @param {string} [authorization] Bearer Token
89
+ * @param {*} [options] Override http request option.
90
+ * @throws {RequiredError}
91
+ */
92
+ deletePaymentMethod: async (id: number, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
93
+ // verify required parameter 'id' is not null or undefined
94
+ assertParamExists('deletePaymentMethod', 'id', id)
95
+ const localVarPath = `/paymentservice/v1/payment-methods/{id}`;
96
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
97
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
98
+ let baseOptions;
99
+ let baseAccessToken;
100
+ if (configuration) {
101
+ baseOptions = configuration.baseOptions;
102
+ baseAccessToken = configuration.accessToken;
103
+ }
104
+
105
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
106
+ const localVarHeaderParameter = {} as any;
107
+ const localVarQueryParameter = {} as any;
108
+
109
+ // authentication bearer required
110
+ // http bearer authentication required
111
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
112
+
113
+ if (id !== undefined) {
114
+ localVarQueryParameter['id'] = id;
115
+ }
116
+
117
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
118
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
119
+ }
120
+
121
+
122
+
123
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
124
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
125
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
126
+
127
+ return {
128
+ url: toPathString(localVarUrlObj),
129
+ options: localVarRequestOptions,
130
+ };
131
+ },
132
+ /**
133
+ * Retrieves the details of a payment method that was previously created. Supply the unique payment method code that was returned when you created the payment method and Emil Api will return the corresponding payment method information.
134
+ * @summary Retrieve a payment method
135
+ * @param {string} code Unique identifier for the object.
136
+ * @param {string} [authorization] Bearer Token
137
+ * @param {string} [expand] Fields to expand response by
138
+ * @param {string} [expand2] Fields to expand response by
139
+ * @param {*} [options] Override http request option.
140
+ * @throws {RequiredError}
141
+ */
142
+ getPaymentMethod: async (code: string, authorization?: string, expand?: string, expand2?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
143
+ // verify required parameter 'code' is not null or undefined
144
+ assertParamExists('getPaymentMethod', 'code', code)
145
+ const localVarPath = `/paymentservice/v1/payment-methods/{code}`;
146
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
147
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
148
+ let baseOptions;
149
+ let baseAccessToken;
150
+ if (configuration) {
151
+ baseOptions = configuration.baseOptions;
152
+ baseAccessToken = configuration.accessToken;
153
+ }
154
+
155
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
156
+ const localVarHeaderParameter = {} as any;
157
+ const localVarQueryParameter = {} as any;
158
+
159
+ // authentication bearer required
160
+ // http bearer authentication required
161
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
162
+
163
+ if (code !== undefined) {
164
+ localVarQueryParameter['code'] = code;
165
+ }
166
+
167
+ if (expand !== undefined) {
168
+ localVarQueryParameter['expand'] = expand;
169
+ }
170
+
171
+ if (expand2 !== undefined) {
172
+ localVarQueryParameter['expand'] = expand2;
173
+ }
174
+
175
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
176
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
177
+ }
178
+
179
+
180
+
181
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
182
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
183
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
184
+
185
+ return {
186
+ url: toPathString(localVarUrlObj),
187
+ options: localVarRequestOptions,
188
+ };
189
+ },
190
+ /**
191
+ * Returns a list of payment methods you’ve previously created. The payment methods are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
192
+ * @summary List payment methods
193
+ * @param {string} [authorization] Bearer Token
194
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
195
+ * @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.
196
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
197
+ * @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.
198
+ * @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.
199
+ * @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.
200
+ * @param {*} [options] Override http request option.
201
+ * @throws {RequiredError}
202
+ */
203
+ listPaymentMethods: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
204
+ const localVarPath = `/paymentservice/v1/payment-methods`;
205
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
206
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
207
+ let baseOptions;
208
+ let baseAccessToken;
209
+ if (configuration) {
210
+ baseOptions = configuration.baseOptions;
211
+ baseAccessToken = configuration.accessToken;
212
+ }
213
+
214
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
215
+ const localVarHeaderParameter = {} as any;
216
+ const localVarQueryParameter = {} as any;
217
+
218
+ // authentication bearer required
219
+ // http bearer authentication required
220
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
221
+
222
+ if (pageSize !== undefined) {
223
+ localVarQueryParameter['pageSize'] = pageSize;
224
+ }
225
+
226
+ if (pageToken !== undefined) {
227
+ localVarQueryParameter['pageToken'] = pageToken;
228
+ }
229
+
230
+ if (filter !== undefined) {
231
+ localVarQueryParameter['filter'] = filter;
232
+ }
233
+
234
+ if (search !== undefined) {
235
+ localVarQueryParameter['search'] = search;
236
+ }
237
+
238
+ if (order !== undefined) {
239
+ localVarQueryParameter['order'] = order;
240
+ }
241
+
242
+ if (expand !== undefined) {
243
+ localVarQueryParameter['expand'] = expand;
244
+ }
245
+
246
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
247
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
248
+ }
249
+
250
+
251
+
252
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
253
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
254
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
255
+
256
+ return {
257
+ url: toPathString(localVarUrlObj),
258
+ options: localVarRequestOptions,
259
+ };
260
+ },
261
+ }
262
+ };
263
+
264
+ /**
265
+ * PaymentMethodsApi - functional programming interface
266
+ * @export
267
+ */
268
+ export const PaymentMethodsApiFp = function(configuration?: Configuration) {
269
+ const localVarAxiosParamCreator = PaymentMethodsApiAxiosParamCreator(configuration)
270
+ return {
271
+ /**
272
+ * This will create payment method in the database as well as in the PSP. The newly created payment method will be set as default payment method will be used by the customer to pay or receive a refund.
273
+ * @summary Create the payment-method
274
+ * @param {CreatePspPaymentMethodRequestDto} createPspPaymentMethodRequestDto
275
+ * @param {string} [authorization] Bearer Token
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ async createPaymentMethod(createPspPaymentMethodRequestDto: CreatePspPaymentMethodRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreatePaymentMethodResponseClass>> {
280
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createPaymentMethod(createPspPaymentMethodRequestDto, authorization, options);
281
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
282
+ },
283
+ /**
284
+ * Permanently deletes a payment method. Supply the unique payment method id that was returned when you created the payment method and this will delete it. It will also delete it on the corresponding payment service provider.
285
+ * @summary Delete a payment method
286
+ * @param {number} id Unique identifier for payment method
287
+ * @param {string} [authorization] Bearer Token
288
+ * @param {*} [options] Override http request option.
289
+ * @throws {RequiredError}
290
+ */
291
+ async deletePaymentMethod(id: number, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
292
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deletePaymentMethod(id, authorization, options);
293
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
294
+ },
295
+ /**
296
+ * Retrieves the details of a payment method that was previously created. Supply the unique payment method code that was returned when you created the payment method and Emil Api will return the corresponding payment method information.
297
+ * @summary Retrieve a payment method
298
+ * @param {string} code Unique identifier for the object.
299
+ * @param {string} [authorization] Bearer Token
300
+ * @param {string} [expand] Fields to expand response by
301
+ * @param {string} [expand2] Fields to expand response by
302
+ * @param {*} [options] Override http request option.
303
+ * @throws {RequiredError}
304
+ */
305
+ async getPaymentMethod(code: string, authorization?: string, expand?: string, expand2?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPaymentMethodResponseClass>> {
306
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPaymentMethod(code, authorization, expand, expand2, options);
307
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
308
+ },
309
+ /**
310
+ * Returns a list of payment methods you’ve previously created. The payment methods are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
311
+ * @summary List payment methods
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
+ async listPaymentMethods(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPaymentMethodsResponseClass>> {
323
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listPaymentMethods(authorization, pageSize, pageToken, filter, search, order, expand, options);
324
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
325
+ },
326
+ }
327
+ };
328
+
329
+ /**
330
+ * PaymentMethodsApi - factory interface
331
+ * @export
332
+ */
333
+ export const PaymentMethodsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
334
+ const localVarFp = PaymentMethodsApiFp(configuration)
335
+ return {
336
+ /**
337
+ * This will create payment method in the database as well as in the PSP. The newly created payment method will be set as default payment method will be used by the customer to pay or receive a refund.
338
+ * @summary Create the payment-method
339
+ * @param {CreatePspPaymentMethodRequestDto} createPspPaymentMethodRequestDto
340
+ * @param {string} [authorization] Bearer Token
341
+ * @param {*} [options] Override http request option.
342
+ * @throws {RequiredError}
343
+ */
344
+ createPaymentMethod(createPspPaymentMethodRequestDto: CreatePspPaymentMethodRequestDto, authorization?: string, options?: any): AxiosPromise<CreatePaymentMethodResponseClass> {
345
+ return localVarFp.createPaymentMethod(createPspPaymentMethodRequestDto, authorization, options).then((request) => request(axios, basePath));
346
+ },
347
+ /**
348
+ * Permanently deletes a payment method. Supply the unique payment method id that was returned when you created the payment method and this will delete it. It will also delete it on the corresponding payment service provider.
349
+ * @summary Delete a payment method
350
+ * @param {number} id Unique identifier for payment method
351
+ * @param {string} [authorization] Bearer Token
352
+ * @param {*} [options] Override http request option.
353
+ * @throws {RequiredError}
354
+ */
355
+ deletePaymentMethod(id: number, authorization?: string, options?: any): AxiosPromise<void> {
356
+ return localVarFp.deletePaymentMethod(id, authorization, options).then((request) => request(axios, basePath));
357
+ },
358
+ /**
359
+ * Retrieves the details of a payment method that was previously created. Supply the unique payment method code that was returned when you created the payment method and Emil Api will return the corresponding payment method information.
360
+ * @summary Retrieve a payment method
361
+ * @param {string} code Unique identifier for the object.
362
+ * @param {string} [authorization] Bearer Token
363
+ * @param {string} [expand] Fields to expand response by
364
+ * @param {string} [expand2] Fields to expand response by
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ */
368
+ getPaymentMethod(code: string, authorization?: string, expand?: string, expand2?: string, options?: any): AxiosPromise<GetPaymentMethodResponseClass> {
369
+ return localVarFp.getPaymentMethod(code, authorization, expand, expand2, options).then((request) => request(axios, basePath));
370
+ },
371
+ /**
372
+ * Returns a list of payment methods you’ve previously created. The payment methods are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
373
+ * @summary List payment methods
374
+ * @param {string} [authorization] Bearer Token
375
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
376
+ * @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.
377
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
378
+ * @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.
379
+ * @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.
380
+ * @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.
381
+ * @param {*} [options] Override http request option.
382
+ * @throws {RequiredError}
383
+ */
384
+ listPaymentMethods(authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListPaymentMethodsResponseClass> {
385
+ return localVarFp.listPaymentMethods(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
386
+ },
387
+ };
388
+ };
389
+
390
+ /**
391
+ * Request parameters for createPaymentMethod operation in PaymentMethodsApi.
392
+ * @export
393
+ * @interface PaymentMethodsApiCreatePaymentMethodRequest
394
+ */
395
+ export interface PaymentMethodsApiCreatePaymentMethodRequest {
396
+ /**
397
+ *
398
+ * @type {CreatePspPaymentMethodRequestDto}
399
+ * @memberof PaymentMethodsApiCreatePaymentMethod
400
+ */
401
+ readonly createPspPaymentMethodRequestDto: CreatePspPaymentMethodRequestDto
402
+
403
+ /**
404
+ * Bearer Token
405
+ * @type {string}
406
+ * @memberof PaymentMethodsApiCreatePaymentMethod
407
+ */
408
+ readonly authorization?: string
409
+ }
410
+
411
+ /**
412
+ * Request parameters for deletePaymentMethod operation in PaymentMethodsApi.
413
+ * @export
414
+ * @interface PaymentMethodsApiDeletePaymentMethodRequest
415
+ */
416
+ export interface PaymentMethodsApiDeletePaymentMethodRequest {
417
+ /**
418
+ * Unique identifier for payment method
419
+ * @type {number}
420
+ * @memberof PaymentMethodsApiDeletePaymentMethod
421
+ */
422
+ readonly id: number
423
+
424
+ /**
425
+ * Bearer Token
426
+ * @type {string}
427
+ * @memberof PaymentMethodsApiDeletePaymentMethod
428
+ */
429
+ readonly authorization?: string
430
+ }
431
+
432
+ /**
433
+ * Request parameters for getPaymentMethod operation in PaymentMethodsApi.
434
+ * @export
435
+ * @interface PaymentMethodsApiGetPaymentMethodRequest
436
+ */
437
+ export interface PaymentMethodsApiGetPaymentMethodRequest {
438
+ /**
439
+ * Unique identifier for the object.
440
+ * @type {string}
441
+ * @memberof PaymentMethodsApiGetPaymentMethod
442
+ */
443
+ readonly code: string
444
+
445
+ /**
446
+ * Bearer Token
447
+ * @type {string}
448
+ * @memberof PaymentMethodsApiGetPaymentMethod
449
+ */
450
+ readonly authorization?: string
451
+
452
+ /**
453
+ * Fields to expand response by
454
+ * @type {string}
455
+ * @memberof PaymentMethodsApiGetPaymentMethod
456
+ */
457
+ readonly expand?: string
458
+
459
+ /**
460
+ * Fields to expand response by
461
+ * @type {string}
462
+ * @memberof PaymentMethodsApiGetPaymentMethod
463
+ */
464
+ readonly expand2?: string
465
+ }
466
+
467
+ /**
468
+ * Request parameters for listPaymentMethods operation in PaymentMethodsApi.
469
+ * @export
470
+ * @interface PaymentMethodsApiListPaymentMethodsRequest
471
+ */
472
+ export interface PaymentMethodsApiListPaymentMethodsRequest {
473
+ /**
474
+ * Bearer Token
475
+ * @type {string}
476
+ * @memberof PaymentMethodsApiListPaymentMethods
477
+ */
478
+ readonly authorization?: string
479
+
480
+ /**
481
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
482
+ * @type {any}
483
+ * @memberof PaymentMethodsApiListPaymentMethods
484
+ */
485
+ readonly pageSize?: any
486
+
487
+ /**
488
+ * 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.
489
+ * @type {any}
490
+ * @memberof PaymentMethodsApiListPaymentMethods
491
+ */
492
+ readonly pageToken?: any
493
+
494
+ /**
495
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
496
+ * @type {any}
497
+ * @memberof PaymentMethodsApiListPaymentMethods
498
+ */
499
+ readonly filter?: any
500
+
501
+ /**
502
+ * 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.
503
+ * @type {any}
504
+ * @memberof PaymentMethodsApiListPaymentMethods
505
+ */
506
+ readonly search?: any
507
+
508
+ /**
509
+ * 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.
510
+ * @type {any}
511
+ * @memberof PaymentMethodsApiListPaymentMethods
512
+ */
513
+ readonly order?: any
514
+
515
+ /**
516
+ * 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.
517
+ * @type {any}
518
+ * @memberof PaymentMethodsApiListPaymentMethods
519
+ */
520
+ readonly expand?: any
521
+ }
522
+
523
+ /**
524
+ * PaymentMethodsApi - object-oriented interface
525
+ * @export
526
+ * @class PaymentMethodsApi
527
+ * @extends {BaseAPI}
528
+ */
529
+ export class PaymentMethodsApi extends BaseAPI {
530
+ /**
531
+ * This will create payment method in the database as well as in the PSP. The newly created payment method will be set as default payment method will be used by the customer to pay or receive a refund.
532
+ * @summary Create the payment-method
533
+ * @param {PaymentMethodsApiCreatePaymentMethodRequest} requestParameters Request parameters.
534
+ * @param {*} [options] Override http request option.
535
+ * @throws {RequiredError}
536
+ * @memberof PaymentMethodsApi
537
+ */
538
+ public createPaymentMethod(requestParameters: PaymentMethodsApiCreatePaymentMethodRequest, options?: AxiosRequestConfig) {
539
+ return PaymentMethodsApiFp(this.configuration).createPaymentMethod(requestParameters.createPspPaymentMethodRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
540
+ }
541
+
542
+ /**
543
+ * Permanently deletes a payment method. Supply the unique payment method id that was returned when you created the payment method and this will delete it. It will also delete it on the corresponding payment service provider.
544
+ * @summary Delete a payment method
545
+ * @param {PaymentMethodsApiDeletePaymentMethodRequest} requestParameters Request parameters.
546
+ * @param {*} [options] Override http request option.
547
+ * @throws {RequiredError}
548
+ * @memberof PaymentMethodsApi
549
+ */
550
+ public deletePaymentMethod(requestParameters: PaymentMethodsApiDeletePaymentMethodRequest, options?: AxiosRequestConfig) {
551
+ return PaymentMethodsApiFp(this.configuration).deletePaymentMethod(requestParameters.id, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
552
+ }
553
+
554
+ /**
555
+ * Retrieves the details of a payment method that was previously created. Supply the unique payment method code that was returned when you created the payment method and Emil Api will return the corresponding payment method information.
556
+ * @summary Retrieve a payment method
557
+ * @param {PaymentMethodsApiGetPaymentMethodRequest} requestParameters Request parameters.
558
+ * @param {*} [options] Override http request option.
559
+ * @throws {RequiredError}
560
+ * @memberof PaymentMethodsApi
561
+ */
562
+ public getPaymentMethod(requestParameters: PaymentMethodsApiGetPaymentMethodRequest, options?: AxiosRequestConfig) {
563
+ return PaymentMethodsApiFp(this.configuration).getPaymentMethod(requestParameters.code, requestParameters.authorization, requestParameters.expand, requestParameters.expand2, options).then((request) => request(this.axios, this.basePath));
564
+ }
565
+
566
+ /**
567
+ * Returns a list of payment methods you’ve previously created. The payment methods are returned in sorted order, with the oldest payment appearing first. For more information about pagination, read the Pagination documentation.
568
+ * @summary List payment methods
569
+ * @param {PaymentMethodsApiListPaymentMethodsRequest} requestParameters Request parameters.
570
+ * @param {*} [options] Override http request option.
571
+ * @throws {RequiredError}
572
+ * @memberof PaymentMethodsApi
573
+ */
574
+ public listPaymentMethods(requestParameters: PaymentMethodsApiListPaymentMethodsRequest = {}, options?: AxiosRequestConfig) {
575
+ return PaymentMethodsApiFp(this.configuration).listPaymentMethods(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
576
+ }
577
+ }