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