@revenexx/sdk 0.0.2 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/cjs/sdk.js +13496 -3442
  2. package/dist/cjs/sdk.js.map +1 -1
  3. package/dist/esm/sdk.js +13467 -3443
  4. package/dist/esm/sdk.js.map +1 -1
  5. package/dist/iife/sdk.js +13496 -3442
  6. package/package.json +1 -1
  7. package/src/client.ts +1 -1
  8. package/src/enums/address-type.ts +4 -0
  9. package/src/enums/cart-export-format.ts +4 -0
  10. package/src/enums/cart-io-apply-mode.ts +5 -0
  11. package/src/enums/cart-io-direction.ts +4 -0
  12. package/src/enums/cart-io-entity.ts +4 -0
  13. package/src/enums/cart-io-format.ts +4 -0
  14. package/src/enums/cart-item-type.ts +5 -0
  15. package/src/enums/channel-status.ts +4 -0
  16. package/src/enums/channel-type.ts +7 -0
  17. package/src/enums/contact-role.ts +6 -0
  18. package/src/enums/contact-status.ts +5 -0
  19. package/src/enums/location-type.ts +6 -0
  20. package/src/enums/market-status.ts +4 -0
  21. package/src/enums/order-comment-visibility.ts +4 -0
  22. package/src/enums/order-item-type.ts +5 -0
  23. package/src/enums/order-payment-status.ts +9 -0
  24. package/src/enums/organization-status.ts +4 -0
  25. package/src/enums/page-status.ts +5 -0
  26. package/src/enums/payment-fee-type.ts +5 -0
  27. package/src/enums/payment-method-kind.ts +4 -0
  28. package/src/enums/price-entry-type.ts +4 -0
  29. package/src/enums/price-list-status.ts +4 -0
  30. package/src/enums/shipping-method-matrix-basis.ts +6 -0
  31. package/src/enums/shipping-method-pricing-type.ts +5 -0
  32. package/src/index.ts +30 -0
  33. package/src/models.ts +5628 -410
  34. package/src/services/apps.ts +154 -154
  35. package/src/services/avatars.ts +57 -57
  36. package/src/services/carts.ts +739 -104
  37. package/src/services/channels.ts +147 -19
  38. package/src/services/customers.ts +801 -69
  39. package/src/services/greetings.ts +18 -18
  40. package/src/services/inventories.ts +1278 -0
  41. package/src/services/locale.ts +16 -16
  42. package/src/services/markets.ts +373 -75
  43. package/src/services/messaging.ts +273 -273
  44. package/src/services/orders.ts +1648 -0
  45. package/src/services/pages.ts +2317 -0
  46. package/src/services/payments.ts +1334 -0
  47. package/src/services/prices.ts +1036 -0
  48. package/src/services/products.ts +1836 -272
  49. package/src/services/search.ts +24 -24
  50. package/src/services/shipping.ts +956 -0
  51. package/src/services/sites.ts +116 -116
  52. package/src/services/storage.ts +72 -72
  53. package/src/services/tokens.ts +14 -14
  54. package/types/enums/address-type.d.ts +4 -0
  55. package/types/enums/cart-export-format.d.ts +4 -0
  56. package/types/enums/cart-io-apply-mode.d.ts +5 -0
  57. package/types/enums/cart-io-direction.d.ts +4 -0
  58. package/types/enums/cart-io-entity.d.ts +4 -0
  59. package/types/enums/cart-io-format.d.ts +4 -0
  60. package/types/enums/cart-item-type.d.ts +5 -0
  61. package/types/enums/channel-status.d.ts +4 -0
  62. package/types/enums/channel-type.d.ts +7 -0
  63. package/types/enums/contact-role.d.ts +6 -0
  64. package/types/enums/contact-status.d.ts +5 -0
  65. package/types/enums/location-type.d.ts +6 -0
  66. package/types/enums/market-status.d.ts +4 -0
  67. package/types/enums/order-comment-visibility.d.ts +4 -0
  68. package/types/enums/order-item-type.d.ts +5 -0
  69. package/types/enums/order-payment-status.d.ts +9 -0
  70. package/types/enums/organization-status.d.ts +4 -0
  71. package/types/enums/page-status.d.ts +5 -0
  72. package/types/enums/payment-fee-type.d.ts +5 -0
  73. package/types/enums/payment-method-kind.d.ts +4 -0
  74. package/types/enums/price-entry-type.d.ts +4 -0
  75. package/types/enums/price-list-status.d.ts +4 -0
  76. package/types/enums/shipping-method-matrix-basis.d.ts +6 -0
  77. package/types/enums/shipping-method-pricing-type.d.ts +5 -0
  78. package/types/index.d.ts +30 -0
  79. package/types/models.d.ts +5470 -404
  80. package/types/services/carts.d.ts +271 -12
  81. package/types/services/channels.d.ts +54 -2
  82. package/types/services/customers.d.ts +295 -12
  83. package/types/services/inventories.d.ts +440 -0
  84. package/types/services/markets.d.ts +123 -6
  85. package/types/services/orders.d.ts +590 -0
  86. package/types/services/pages.d.ts +792 -0
  87. package/types/services/payments.d.ts +480 -0
  88. package/types/services/prices.d.ts +384 -0
  89. package/types/services/products.d.ts +646 -32
  90. package/types/services/shipping.d.ts +351 -0
@@ -0,0 +1,1334 @@
1
+ import { Service } from '../service';
2
+ import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+ import { PaymentFeeType } from '../enums/payment-fee-type';
6
+ import { PaymentMethodKind } from '../enums/payment-method-kind';
7
+
8
+ export class Payments {
9
+ client: Client;
10
+
11
+ constructor(client: Client) {
12
+ this.client = client;
13
+ }
14
+
15
+ /**
16
+ *
17
+ * @throws {RevenexxException}
18
+ * @returns {Promise<{}>}
19
+ */
20
+ paymentsList(): Promise<{}> {
21
+
22
+ const apiPath = '/v1/payments';
23
+ const apiPayload: Payload = {};
24
+ const uri = new URL(this.client.config.endpoint + apiPath);
25
+
26
+ const apiHeaders: { [header: string]: string } = {
27
+ }
28
+
29
+ return this.client.call(
30
+ 'get',
31
+ uri,
32
+ apiHeaders,
33
+ apiPayload
34
+ );
35
+ }
36
+
37
+ /**
38
+ *
39
+ * @param {number} params.amount - Order amount — 0 is legal (free orders), negative is not.
40
+ * @param {string} params.methodCode - Code of a configured payment method.
41
+ * @param {string} params.cartId - The cart this payment pays for.
42
+ * @param {string} params.contactId - Paying customer contact.
43
+ * @param {string} params.country - Buyer ISO country code for the eligibility check.
44
+ * @param {string} params.currency - ISO 4217 code (default EUR).
45
+ * @param {string} params.idempotencyKey - Same key answers the same payment instead of a duplicate.
46
+ * @param {object} params.metadata - Free-form metadata.
47
+ * @param {string} params.orderRef - External order reference — also the webhook fallback key.
48
+ * @param {string} params.returnUrl - Where the PSP redirect flow returns the buyer to.
49
+ * @throws {RevenexxException}
50
+ * @returns {Promise<Models.Payment>}
51
+ */
52
+ paymentsCreate(params: { amount: number, methodCode: string, cartId?: string, contactId?: string, country?: string, currency?: string, idempotencyKey?: string, metadata?: object, orderRef?: string, returnUrl?: string }): Promise<Models.Payment>;
53
+ /**
54
+ *
55
+ * @param {number} amount - Order amount — 0 is legal (free orders), negative is not.
56
+ * @param {string} methodCode - Code of a configured payment method.
57
+ * @param {string} cartId - The cart this payment pays for.
58
+ * @param {string} contactId - Paying customer contact.
59
+ * @param {string} country - Buyer ISO country code for the eligibility check.
60
+ * @param {string} currency - ISO 4217 code (default EUR).
61
+ * @param {string} idempotencyKey - Same key answers the same payment instead of a duplicate.
62
+ * @param {object} metadata - Free-form metadata.
63
+ * @param {string} orderRef - External order reference — also the webhook fallback key.
64
+ * @param {string} returnUrl - Where the PSP redirect flow returns the buyer to.
65
+ * @throws {RevenexxException}
66
+ * @returns {Promise<Models.Payment>}
67
+ * @deprecated Use the object parameter style method for a better developer experience.
68
+ */
69
+ paymentsCreate(amount: number, methodCode: string, cartId?: string, contactId?: string, country?: string, currency?: string, idempotencyKey?: string, metadata?: object, orderRef?: string, returnUrl?: string): Promise<Models.Payment>;
70
+ paymentsCreate(
71
+ paramsOrFirst: { amount: number, methodCode: string, cartId?: string, contactId?: string, country?: string, currency?: string, idempotencyKey?: string, metadata?: object, orderRef?: string, returnUrl?: string } | number,
72
+ ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (object)?, (string)?, (string)?]
73
+ ): Promise<Models.Payment> {
74
+ let params: { amount: number, methodCode: string, cartId?: string, contactId?: string, country?: string, currency?: string, idempotencyKey?: string, metadata?: object, orderRef?: string, returnUrl?: string };
75
+
76
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
77
+ params = (paramsOrFirst || {}) as { amount: number, methodCode: string, cartId?: string, contactId?: string, country?: string, currency?: string, idempotencyKey?: string, metadata?: object, orderRef?: string, returnUrl?: string };
78
+ } else {
79
+ params = {
80
+ amount: paramsOrFirst as number,
81
+ methodCode: rest[0] as string,
82
+ cartId: rest[1] as string,
83
+ contactId: rest[2] as string,
84
+ country: rest[3] as string,
85
+ currency: rest[4] as string,
86
+ idempotencyKey: rest[5] as string,
87
+ metadata: rest[6] as object,
88
+ orderRef: rest[7] as string,
89
+ returnUrl: rest[8] as string
90
+ };
91
+ }
92
+
93
+ const amount = params.amount;
94
+ const methodCode = params.methodCode;
95
+ const cartId = params.cartId;
96
+ const contactId = params.contactId;
97
+ const country = params.country;
98
+ const currency = params.currency;
99
+ const idempotencyKey = params.idempotencyKey;
100
+ const metadata = params.metadata;
101
+ const orderRef = params.orderRef;
102
+ const returnUrl = params.returnUrl;
103
+
104
+ if (typeof amount === 'undefined') {
105
+ throw new RevenexxException('Missing required parameter: "amount"');
106
+ }
107
+ if (typeof methodCode === 'undefined') {
108
+ throw new RevenexxException('Missing required parameter: "methodCode"');
109
+ }
110
+
111
+ const apiPath = '/v1/payments';
112
+ const apiPayload: Payload = {};
113
+ if (typeof amount !== 'undefined') {
114
+ apiPayload['amount'] = amount;
115
+ }
116
+ if (typeof cartId !== 'undefined') {
117
+ apiPayload['cart_id'] = cartId;
118
+ }
119
+ if (typeof contactId !== 'undefined') {
120
+ apiPayload['contact_id'] = contactId;
121
+ }
122
+ if (typeof country !== 'undefined') {
123
+ apiPayload['country'] = country;
124
+ }
125
+ if (typeof currency !== 'undefined') {
126
+ apiPayload['currency'] = currency;
127
+ }
128
+ if (typeof idempotencyKey !== 'undefined') {
129
+ apiPayload['idempotency_key'] = idempotencyKey;
130
+ }
131
+ if (typeof metadata !== 'undefined') {
132
+ apiPayload['metadata'] = metadata;
133
+ }
134
+ if (typeof methodCode !== 'undefined') {
135
+ apiPayload['method_code'] = methodCode;
136
+ }
137
+ if (typeof orderRef !== 'undefined') {
138
+ apiPayload['order_ref'] = orderRef;
139
+ }
140
+ if (typeof returnUrl !== 'undefined') {
141
+ apiPayload['return_url'] = returnUrl;
142
+ }
143
+ const uri = new URL(this.client.config.endpoint + apiPath);
144
+
145
+ const apiHeaders: { [header: string]: string } = {
146
+ 'content-type': 'application/json',
147
+ }
148
+
149
+ return this.client.call(
150
+ 'post',
151
+ uri,
152
+ apiHeaders,
153
+ apiPayload
154
+ );
155
+ }
156
+
157
+ /**
158
+ *
159
+ * @throws {RevenexxException}
160
+ * @returns {Promise<{}>}
161
+ */
162
+ paymentsMethodsList(): Promise<{}> {
163
+
164
+ const apiPath = '/v1/payments/methods';
165
+ const apiPayload: Payload = {};
166
+ const uri = new URL(this.client.config.endpoint + apiPath);
167
+
168
+ const apiHeaders: { [header: string]: string } = {
169
+ }
170
+
171
+ return this.client.call(
172
+ 'get',
173
+ uri,
174
+ apiHeaders,
175
+ apiPayload
176
+ );
177
+ }
178
+
179
+ /**
180
+ *
181
+ * @param {string} params.code - Stable method code (unique per tenant, e.g. 'invoice', 'card').
182
+ * @param {string} params.name - Display name.
183
+ * @param {string[]} params.countries - Allowed ISO country codes — empty/omitted = unrestricted.
184
+ * @param {string} params.description -
185
+ * @param {boolean} params.enabled - Disabled methods are never eligible (default false).
186
+ * @param {number} params.feeAmount - Fixed amount or percent value, per fee_type (default 0).
187
+ * @param {string} params.feeCurrency - ISO 4217 code (default EUR).
188
+ * @param {PaymentFeeType} params.feeType - How 'fee_amount' applies (default 'none').
189
+ * @param {PaymentMethodKind} params.kind - Self-managed (merchant fulfils, default) or PSP-backed ('provider' required to transact).
190
+ * @param {object} params.labels - Localized display names ({ de, en, … }).
191
+ * @param {number} params.maxOrderValue - Maximum order amount — omitted = no upper bound.
192
+ * @param {object} params.metadata - Free-form metadata.
193
+ * @param {number} params.minOrderValue - Minimum order amount — omitted = no lower bound.
194
+ * @param {number} params.position - Sort position in the checkout (default 0).
195
+ * @param {string} params.provider - PSP code from the catalog — only for kind 'psp'.
196
+ * @param {string} params.providerMethod - The provider's payment method id (e.g. 'card', 'paypal').
197
+ * @throws {RevenexxException}
198
+ * @returns {Promise<Models.PaymentMethod>}
199
+ */
200
+ paymentsMethodsCreate(params: { code: string, name: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, position?: number, provider?: string, providerMethod?: string }): Promise<Models.PaymentMethod>;
201
+ /**
202
+ *
203
+ * @param {string} code - Stable method code (unique per tenant, e.g. 'invoice', 'card').
204
+ * @param {string} name - Display name.
205
+ * @param {string[]} countries - Allowed ISO country codes — empty/omitted = unrestricted.
206
+ * @param {string} description -
207
+ * @param {boolean} enabled - Disabled methods are never eligible (default false).
208
+ * @param {number} feeAmount - Fixed amount or percent value, per fee_type (default 0).
209
+ * @param {string} feeCurrency - ISO 4217 code (default EUR).
210
+ * @param {PaymentFeeType} feeType - How 'fee_amount' applies (default 'none').
211
+ * @param {PaymentMethodKind} kind - Self-managed (merchant fulfils, default) or PSP-backed ('provider' required to transact).
212
+ * @param {object} labels - Localized display names ({ de, en, … }).
213
+ * @param {number} maxOrderValue - Maximum order amount — omitted = no upper bound.
214
+ * @param {object} metadata - Free-form metadata.
215
+ * @param {number} minOrderValue - Minimum order amount — omitted = no lower bound.
216
+ * @param {number} position - Sort position in the checkout (default 0).
217
+ * @param {string} provider - PSP code from the catalog — only for kind 'psp'.
218
+ * @param {string} providerMethod - The provider's payment method id (e.g. 'card', 'paypal').
219
+ * @throws {RevenexxException}
220
+ * @returns {Promise<Models.PaymentMethod>}
221
+ * @deprecated Use the object parameter style method for a better developer experience.
222
+ */
223
+ paymentsMethodsCreate(code: string, name: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, position?: number, provider?: string, providerMethod?: string): Promise<Models.PaymentMethod>;
224
+ paymentsMethodsCreate(
225
+ paramsOrFirst: { code: string, name: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, position?: number, provider?: string, providerMethod?: string } | string,
226
+ ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?, (string)?, (PaymentFeeType)?, (PaymentMethodKind)?, (object)?, (number)?, (object)?, (number)?, (number)?, (string)?, (string)?]
227
+ ): Promise<Models.PaymentMethod> {
228
+ let params: { code: string, name: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, position?: number, provider?: string, providerMethod?: string };
229
+
230
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
231
+ params = (paramsOrFirst || {}) as { code: string, name: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, position?: number, provider?: string, providerMethod?: string };
232
+ } else {
233
+ params = {
234
+ code: paramsOrFirst as string,
235
+ name: rest[0] as string,
236
+ countries: rest[1] as string[],
237
+ description: rest[2] as string,
238
+ enabled: rest[3] as boolean,
239
+ feeAmount: rest[4] as number,
240
+ feeCurrency: rest[5] as string,
241
+ feeType: rest[6] as PaymentFeeType,
242
+ kind: rest[7] as PaymentMethodKind,
243
+ labels: rest[8] as object,
244
+ maxOrderValue: rest[9] as number,
245
+ metadata: rest[10] as object,
246
+ minOrderValue: rest[11] as number,
247
+ position: rest[12] as number,
248
+ provider: rest[13] as string,
249
+ providerMethod: rest[14] as string
250
+ };
251
+ }
252
+
253
+ const code = params.code;
254
+ const name = params.name;
255
+ const countries = params.countries;
256
+ const description = params.description;
257
+ const enabled = params.enabled;
258
+ const feeAmount = params.feeAmount;
259
+ const feeCurrency = params.feeCurrency;
260
+ const feeType = params.feeType;
261
+ const kind = params.kind;
262
+ const labels = params.labels;
263
+ const maxOrderValue = params.maxOrderValue;
264
+ const metadata = params.metadata;
265
+ const minOrderValue = params.minOrderValue;
266
+ const position = params.position;
267
+ const provider = params.provider;
268
+ const providerMethod = params.providerMethod;
269
+
270
+ if (typeof code === 'undefined') {
271
+ throw new RevenexxException('Missing required parameter: "code"');
272
+ }
273
+ if (typeof name === 'undefined') {
274
+ throw new RevenexxException('Missing required parameter: "name"');
275
+ }
276
+
277
+ const apiPath = '/v1/payments/methods';
278
+ const apiPayload: Payload = {};
279
+ if (typeof code !== 'undefined') {
280
+ apiPayload['code'] = code;
281
+ }
282
+ if (typeof countries !== 'undefined') {
283
+ apiPayload['countries'] = countries;
284
+ }
285
+ if (typeof description !== 'undefined') {
286
+ apiPayload['description'] = description;
287
+ }
288
+ if (typeof enabled !== 'undefined') {
289
+ apiPayload['enabled'] = enabled;
290
+ }
291
+ if (typeof feeAmount !== 'undefined') {
292
+ apiPayload['fee_amount'] = feeAmount;
293
+ }
294
+ if (typeof feeCurrency !== 'undefined') {
295
+ apiPayload['fee_currency'] = feeCurrency;
296
+ }
297
+ if (typeof feeType !== 'undefined') {
298
+ apiPayload['fee_type'] = feeType;
299
+ }
300
+ if (typeof kind !== 'undefined') {
301
+ apiPayload['kind'] = kind;
302
+ }
303
+ if (typeof labels !== 'undefined') {
304
+ apiPayload['labels'] = labels;
305
+ }
306
+ if (typeof maxOrderValue !== 'undefined') {
307
+ apiPayload['max_order_value'] = maxOrderValue;
308
+ }
309
+ if (typeof metadata !== 'undefined') {
310
+ apiPayload['metadata'] = metadata;
311
+ }
312
+ if (typeof minOrderValue !== 'undefined') {
313
+ apiPayload['min_order_value'] = minOrderValue;
314
+ }
315
+ if (typeof name !== 'undefined') {
316
+ apiPayload['name'] = name;
317
+ }
318
+ if (typeof position !== 'undefined') {
319
+ apiPayload['position'] = position;
320
+ }
321
+ if (typeof provider !== 'undefined') {
322
+ apiPayload['provider'] = provider;
323
+ }
324
+ if (typeof providerMethod !== 'undefined') {
325
+ apiPayload['provider_method'] = providerMethod;
326
+ }
327
+ const uri = new URL(this.client.config.endpoint + apiPath);
328
+
329
+ const apiHeaders: { [header: string]: string } = {
330
+ 'content-type': 'application/json',
331
+ }
332
+
333
+ return this.client.call(
334
+ 'post',
335
+ uri,
336
+ apiHeaders,
337
+ apiPayload
338
+ );
339
+ }
340
+
341
+ /**
342
+ *
343
+ * @throws {RevenexxException}
344
+ * @returns {Promise<{}>}
345
+ */
346
+ paymentsMethodsDefaults(): Promise<{}> {
347
+
348
+ const apiPath = '/v1/payments/methods/defaults';
349
+ const apiPayload: Payload = {};
350
+ const uri = new URL(this.client.config.endpoint + apiPath);
351
+
352
+ const apiHeaders: { [header: string]: string } = {
353
+ }
354
+
355
+ return this.client.call(
356
+ 'post',
357
+ uri,
358
+ apiHeaders,
359
+ apiPayload
360
+ );
361
+ }
362
+
363
+ /**
364
+ *
365
+ * @param {number} params.amount - Order amount the fees are computed against (default 0).
366
+ * @param {string} params.country - Buyer ISO country code — methods with country restrictions need it.
367
+ * @param {string} params.currency - ISO 4217 code (default EUR).
368
+ * @throws {RevenexxException}
369
+ * @returns {Promise<{}>}
370
+ */
371
+ paymentsMethodsEligible(params?: { amount?: number, country?: string, currency?: string }): Promise<{}>;
372
+ /**
373
+ *
374
+ * @param {number} amount - Order amount the fees are computed against (default 0).
375
+ * @param {string} country - Buyer ISO country code — methods with country restrictions need it.
376
+ * @param {string} currency - ISO 4217 code (default EUR).
377
+ * @throws {RevenexxException}
378
+ * @returns {Promise<{}>}
379
+ * @deprecated Use the object parameter style method for a better developer experience.
380
+ */
381
+ paymentsMethodsEligible(amount?: number, country?: string, currency?: string): Promise<{}>;
382
+ paymentsMethodsEligible(
383
+ paramsOrFirst?: { amount?: number, country?: string, currency?: string } | number,
384
+ ...rest: [(string)?, (string)?]
385
+ ): Promise<{}> {
386
+ let params: { amount?: number, country?: string, currency?: string };
387
+
388
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
389
+ params = (paramsOrFirst || {}) as { amount?: number, country?: string, currency?: string };
390
+ } else {
391
+ params = {
392
+ amount: paramsOrFirst as number,
393
+ country: rest[0] as string,
394
+ currency: rest[1] as string
395
+ };
396
+ }
397
+
398
+ const amount = params.amount;
399
+ const country = params.country;
400
+ const currency = params.currency;
401
+
402
+
403
+ const apiPath = '/v1/payments/methods/eligible';
404
+ const apiPayload: Payload = {};
405
+ if (typeof amount !== 'undefined') {
406
+ apiPayload['amount'] = amount;
407
+ }
408
+ if (typeof country !== 'undefined') {
409
+ apiPayload['country'] = country;
410
+ }
411
+ if (typeof currency !== 'undefined') {
412
+ apiPayload['currency'] = currency;
413
+ }
414
+ const uri = new URL(this.client.config.endpoint + apiPath);
415
+
416
+ const apiHeaders: { [header: string]: string } = {
417
+ 'content-type': 'application/json',
418
+ }
419
+
420
+ return this.client.call(
421
+ 'post',
422
+ uri,
423
+ apiHeaders,
424
+ apiPayload
425
+ );
426
+ }
427
+
428
+ /**
429
+ *
430
+ * @param {string} params.id -
431
+ * @throws {RevenexxException}
432
+ * @returns {Promise<{}>}
433
+ */
434
+ paymentsMethodsDelete(params: { id: string }): Promise<{}>;
435
+ /**
436
+ *
437
+ * @param {string} id -
438
+ * @throws {RevenexxException}
439
+ * @returns {Promise<{}>}
440
+ * @deprecated Use the object parameter style method for a better developer experience.
441
+ */
442
+ paymentsMethodsDelete(id: string): Promise<{}>;
443
+ paymentsMethodsDelete(
444
+ paramsOrFirst: { id: string } | string
445
+ ): Promise<{}> {
446
+ let params: { id: string };
447
+
448
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
449
+ params = (paramsOrFirst || {}) as { id: string };
450
+ } else {
451
+ params = {
452
+ id: paramsOrFirst as string
453
+ };
454
+ }
455
+
456
+ const id = params.id;
457
+
458
+ if (typeof id === 'undefined') {
459
+ throw new RevenexxException('Missing required parameter: "id"');
460
+ }
461
+
462
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
463
+ const apiPayload: Payload = {};
464
+ const uri = new URL(this.client.config.endpoint + apiPath);
465
+
466
+ const apiHeaders: { [header: string]: string } = {
467
+ }
468
+
469
+ return this.client.call(
470
+ 'delete',
471
+ uri,
472
+ apiHeaders,
473
+ apiPayload
474
+ );
475
+ }
476
+
477
+ /**
478
+ *
479
+ * @param {string} params.id -
480
+ * @throws {RevenexxException}
481
+ * @returns {Promise<Models.PaymentMethod>}
482
+ */
483
+ paymentsMethodsGet(params: { id: string }): Promise<Models.PaymentMethod>;
484
+ /**
485
+ *
486
+ * @param {string} id -
487
+ * @throws {RevenexxException}
488
+ * @returns {Promise<Models.PaymentMethod>}
489
+ * @deprecated Use the object parameter style method for a better developer experience.
490
+ */
491
+ paymentsMethodsGet(id: string): Promise<Models.PaymentMethod>;
492
+ paymentsMethodsGet(
493
+ paramsOrFirst: { id: string } | string
494
+ ): Promise<Models.PaymentMethod> {
495
+ let params: { id: string };
496
+
497
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
498
+ params = (paramsOrFirst || {}) as { id: string };
499
+ } else {
500
+ params = {
501
+ id: paramsOrFirst as string
502
+ };
503
+ }
504
+
505
+ const id = params.id;
506
+
507
+ if (typeof id === 'undefined') {
508
+ throw new RevenexxException('Missing required parameter: "id"');
509
+ }
510
+
511
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
512
+ const apiPayload: Payload = {};
513
+ const uri = new URL(this.client.config.endpoint + apiPath);
514
+
515
+ const apiHeaders: { [header: string]: string } = {
516
+ }
517
+
518
+ return this.client.call(
519
+ 'get',
520
+ uri,
521
+ apiHeaders,
522
+ apiPayload
523
+ );
524
+ }
525
+
526
+ /**
527
+ *
528
+ * @param {string} params.id -
529
+ * @param {string} params.code - Stable method code (unique per tenant, e.g. 'invoice', 'card').
530
+ * @param {string[]} params.countries - Allowed ISO country codes — empty/omitted = unrestricted.
531
+ * @param {string} params.description -
532
+ * @param {boolean} params.enabled - Disabled methods are never eligible (default false).
533
+ * @param {number} params.feeAmount - Fixed amount or percent value, per fee_type (default 0).
534
+ * @param {string} params.feeCurrency - ISO 4217 code (default EUR).
535
+ * @param {PaymentFeeType} params.feeType - How 'fee_amount' applies (default 'none').
536
+ * @param {PaymentMethodKind} params.kind - Self-managed (merchant fulfils, default) or PSP-backed ('provider' required to transact).
537
+ * @param {object} params.labels - Localized display names ({ de, en, … }).
538
+ * @param {number} params.maxOrderValue - Maximum order amount — omitted = no upper bound.
539
+ * @param {object} params.metadata - Free-form metadata.
540
+ * @param {number} params.minOrderValue - Minimum order amount — omitted = no lower bound.
541
+ * @param {string} params.name - Display name.
542
+ * @param {number} params.position - Sort position in the checkout (default 0).
543
+ * @param {string} params.provider - PSP code from the catalog — only for kind 'psp'.
544
+ * @param {string} params.providerMethod - The provider's payment method id (e.g. 'card', 'paypal').
545
+ * @throws {RevenexxException}
546
+ * @returns {Promise<Models.PaymentMethod>}
547
+ */
548
+ paymentsMethodsUpdate(params: { id: string, code?: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, name?: string, position?: number, provider?: string, providerMethod?: string }): Promise<Models.PaymentMethod>;
549
+ /**
550
+ *
551
+ * @param {string} id -
552
+ * @param {string} code - Stable method code (unique per tenant, e.g. 'invoice', 'card').
553
+ * @param {string[]} countries - Allowed ISO country codes — empty/omitted = unrestricted.
554
+ * @param {string} description -
555
+ * @param {boolean} enabled - Disabled methods are never eligible (default false).
556
+ * @param {number} feeAmount - Fixed amount or percent value, per fee_type (default 0).
557
+ * @param {string} feeCurrency - ISO 4217 code (default EUR).
558
+ * @param {PaymentFeeType} feeType - How 'fee_amount' applies (default 'none').
559
+ * @param {PaymentMethodKind} kind - Self-managed (merchant fulfils, default) or PSP-backed ('provider' required to transact).
560
+ * @param {object} labels - Localized display names ({ de, en, … }).
561
+ * @param {number} maxOrderValue - Maximum order amount — omitted = no upper bound.
562
+ * @param {object} metadata - Free-form metadata.
563
+ * @param {number} minOrderValue - Minimum order amount — omitted = no lower bound.
564
+ * @param {string} name - Display name.
565
+ * @param {number} position - Sort position in the checkout (default 0).
566
+ * @param {string} provider - PSP code from the catalog — only for kind 'psp'.
567
+ * @param {string} providerMethod - The provider's payment method id (e.g. 'card', 'paypal').
568
+ * @throws {RevenexxException}
569
+ * @returns {Promise<Models.PaymentMethod>}
570
+ * @deprecated Use the object parameter style method for a better developer experience.
571
+ */
572
+ paymentsMethodsUpdate(id: string, code?: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, name?: string, position?: number, provider?: string, providerMethod?: string): Promise<Models.PaymentMethod>;
573
+ paymentsMethodsUpdate(
574
+ paramsOrFirst: { id: string, code?: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, name?: string, position?: number, provider?: string, providerMethod?: string } | string,
575
+ ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?, (string)?, (PaymentFeeType)?, (PaymentMethodKind)?, (object)?, (number)?, (object)?, (number)?, (string)?, (number)?, (string)?, (string)?]
576
+ ): Promise<Models.PaymentMethod> {
577
+ let params: { id: string, code?: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, name?: string, position?: number, provider?: string, providerMethod?: string };
578
+
579
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
580
+ params = (paramsOrFirst || {}) as { id: string, code?: string, countries?: string[], description?: string, enabled?: boolean, feeAmount?: number, feeCurrency?: string, feeType?: PaymentFeeType, kind?: PaymentMethodKind, labels?: object, maxOrderValue?: number, metadata?: object, minOrderValue?: number, name?: string, position?: number, provider?: string, providerMethod?: string };
581
+ } else {
582
+ params = {
583
+ id: paramsOrFirst as string,
584
+ code: rest[0] as string,
585
+ countries: rest[1] as string[],
586
+ description: rest[2] as string,
587
+ enabled: rest[3] as boolean,
588
+ feeAmount: rest[4] as number,
589
+ feeCurrency: rest[5] as string,
590
+ feeType: rest[6] as PaymentFeeType,
591
+ kind: rest[7] as PaymentMethodKind,
592
+ labels: rest[8] as object,
593
+ maxOrderValue: rest[9] as number,
594
+ metadata: rest[10] as object,
595
+ minOrderValue: rest[11] as number,
596
+ name: rest[12] as string,
597
+ position: rest[13] as number,
598
+ provider: rest[14] as string,
599
+ providerMethod: rest[15] as string
600
+ };
601
+ }
602
+
603
+ const id = params.id;
604
+ const code = params.code;
605
+ const countries = params.countries;
606
+ const description = params.description;
607
+ const enabled = params.enabled;
608
+ const feeAmount = params.feeAmount;
609
+ const feeCurrency = params.feeCurrency;
610
+ const feeType = params.feeType;
611
+ const kind = params.kind;
612
+ const labels = params.labels;
613
+ const maxOrderValue = params.maxOrderValue;
614
+ const metadata = params.metadata;
615
+ const minOrderValue = params.minOrderValue;
616
+ const name = params.name;
617
+ const position = params.position;
618
+ const provider = params.provider;
619
+ const providerMethod = params.providerMethod;
620
+
621
+ if (typeof id === 'undefined') {
622
+ throw new RevenexxException('Missing required parameter: "id"');
623
+ }
624
+
625
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
626
+ const apiPayload: Payload = {};
627
+ if (typeof code !== 'undefined') {
628
+ apiPayload['code'] = code;
629
+ }
630
+ if (typeof countries !== 'undefined') {
631
+ apiPayload['countries'] = countries;
632
+ }
633
+ if (typeof description !== 'undefined') {
634
+ apiPayload['description'] = description;
635
+ }
636
+ if (typeof enabled !== 'undefined') {
637
+ apiPayload['enabled'] = enabled;
638
+ }
639
+ if (typeof feeAmount !== 'undefined') {
640
+ apiPayload['fee_amount'] = feeAmount;
641
+ }
642
+ if (typeof feeCurrency !== 'undefined') {
643
+ apiPayload['fee_currency'] = feeCurrency;
644
+ }
645
+ if (typeof feeType !== 'undefined') {
646
+ apiPayload['fee_type'] = feeType;
647
+ }
648
+ if (typeof kind !== 'undefined') {
649
+ apiPayload['kind'] = kind;
650
+ }
651
+ if (typeof labels !== 'undefined') {
652
+ apiPayload['labels'] = labels;
653
+ }
654
+ if (typeof maxOrderValue !== 'undefined') {
655
+ apiPayload['max_order_value'] = maxOrderValue;
656
+ }
657
+ if (typeof metadata !== 'undefined') {
658
+ apiPayload['metadata'] = metadata;
659
+ }
660
+ if (typeof minOrderValue !== 'undefined') {
661
+ apiPayload['min_order_value'] = minOrderValue;
662
+ }
663
+ if (typeof name !== 'undefined') {
664
+ apiPayload['name'] = name;
665
+ }
666
+ if (typeof position !== 'undefined') {
667
+ apiPayload['position'] = position;
668
+ }
669
+ if (typeof provider !== 'undefined') {
670
+ apiPayload['provider'] = provider;
671
+ }
672
+ if (typeof providerMethod !== 'undefined') {
673
+ apiPayload['provider_method'] = providerMethod;
674
+ }
675
+ const uri = new URL(this.client.config.endpoint + apiPath);
676
+
677
+ const apiHeaders: { [header: string]: string } = {
678
+ 'content-type': 'application/json',
679
+ }
680
+
681
+ return this.client.call(
682
+ 'put',
683
+ uri,
684
+ apiHeaders,
685
+ apiPayload
686
+ );
687
+ }
688
+
689
+ /**
690
+ *
691
+ * @throws {RevenexxException}
692
+ * @returns {Promise<{}>}
693
+ */
694
+ paymentsProvidersList(): Promise<{}> {
695
+
696
+ const apiPath = '/v1/payments/providers';
697
+ const apiPayload: Payload = {};
698
+ const uri = new URL(this.client.config.endpoint + apiPath);
699
+
700
+ const apiHeaders: { [header: string]: string } = {
701
+ }
702
+
703
+ return this.client.call(
704
+ 'get',
705
+ uri,
706
+ apiHeaders,
707
+ apiPayload
708
+ );
709
+ }
710
+
711
+ /**
712
+ *
713
+ * @param {string} params.provider - Provider code — must exist in the catalog (GET /payments/providers/catalog).
714
+ * @param {object} params.credentials - PSP credentials — the catalog's credential_fields say which keys the auth scheme expects.
715
+ * @param {boolean} params.enabled - Only enabled providers transact (default false).
716
+ * @param {string} params.name - Display name — defaults to the catalog label.
717
+ * @param {object} params.options - Free-form provider options.
718
+ * @param {boolean} params.testMode - Sandbox/test credentials (default true).
719
+ * @param {string} params.webhookSecret - Shared secret for PSP callback verification.
720
+ * @throws {RevenexxException}
721
+ * @returns {Promise<Models.PaymentProvider>}
722
+ */
723
+ paymentsProvidersCreate(params: { provider: string, credentials?: object, enabled?: boolean, name?: string, options?: object, testMode?: boolean, webhookSecret?: string }): Promise<Models.PaymentProvider>;
724
+ /**
725
+ *
726
+ * @param {string} provider - Provider code — must exist in the catalog (GET /payments/providers/catalog).
727
+ * @param {object} credentials - PSP credentials — the catalog's credential_fields say which keys the auth scheme expects.
728
+ * @param {boolean} enabled - Only enabled providers transact (default false).
729
+ * @param {string} name - Display name — defaults to the catalog label.
730
+ * @param {object} options - Free-form provider options.
731
+ * @param {boolean} testMode - Sandbox/test credentials (default true).
732
+ * @param {string} webhookSecret - Shared secret for PSP callback verification.
733
+ * @throws {RevenexxException}
734
+ * @returns {Promise<Models.PaymentProvider>}
735
+ * @deprecated Use the object parameter style method for a better developer experience.
736
+ */
737
+ paymentsProvidersCreate(provider: string, credentials?: object, enabled?: boolean, name?: string, options?: object, testMode?: boolean, webhookSecret?: string): Promise<Models.PaymentProvider>;
738
+ paymentsProvidersCreate(
739
+ paramsOrFirst: { provider: string, credentials?: object, enabled?: boolean, name?: string, options?: object, testMode?: boolean, webhookSecret?: string } | string,
740
+ ...rest: [(object)?, (boolean)?, (string)?, (object)?, (boolean)?, (string)?]
741
+ ): Promise<Models.PaymentProvider> {
742
+ let params: { provider: string, credentials?: object, enabled?: boolean, name?: string, options?: object, testMode?: boolean, webhookSecret?: string };
743
+
744
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
745
+ params = (paramsOrFirst || {}) as { provider: string, credentials?: object, enabled?: boolean, name?: string, options?: object, testMode?: boolean, webhookSecret?: string };
746
+ } else {
747
+ params = {
748
+ provider: paramsOrFirst as string,
749
+ credentials: rest[0] as object,
750
+ enabled: rest[1] as boolean,
751
+ name: rest[2] as string,
752
+ options: rest[3] as object,
753
+ testMode: rest[4] as boolean,
754
+ webhookSecret: rest[5] as string
755
+ };
756
+ }
757
+
758
+ const provider = params.provider;
759
+ const credentials = params.credentials;
760
+ const enabled = params.enabled;
761
+ const name = params.name;
762
+ const options = params.options;
763
+ const testMode = params.testMode;
764
+ const webhookSecret = params.webhookSecret;
765
+
766
+ if (typeof provider === 'undefined') {
767
+ throw new RevenexxException('Missing required parameter: "provider"');
768
+ }
769
+
770
+ const apiPath = '/v1/payments/providers';
771
+ const apiPayload: Payload = {};
772
+ if (typeof credentials !== 'undefined') {
773
+ apiPayload['credentials'] = credentials;
774
+ }
775
+ if (typeof enabled !== 'undefined') {
776
+ apiPayload['enabled'] = enabled;
777
+ }
778
+ if (typeof name !== 'undefined') {
779
+ apiPayload['name'] = name;
780
+ }
781
+ if (typeof options !== 'undefined') {
782
+ apiPayload['options'] = options;
783
+ }
784
+ if (typeof provider !== 'undefined') {
785
+ apiPayload['provider'] = provider;
786
+ }
787
+ if (typeof testMode !== 'undefined') {
788
+ apiPayload['test_mode'] = testMode;
789
+ }
790
+ if (typeof webhookSecret !== 'undefined') {
791
+ apiPayload['webhook_secret'] = webhookSecret;
792
+ }
793
+ const uri = new URL(this.client.config.endpoint + apiPath);
794
+
795
+ const apiHeaders: { [header: string]: string } = {
796
+ 'content-type': 'application/json',
797
+ }
798
+
799
+ return this.client.call(
800
+ 'post',
801
+ uri,
802
+ apiHeaders,
803
+ apiPayload
804
+ );
805
+ }
806
+
807
+ /**
808
+ *
809
+ * @throws {RevenexxException}
810
+ * @returns {Promise<{}>}
811
+ */
812
+ paymentsProvidersCatalog(): Promise<{}> {
813
+
814
+ const apiPath = '/v1/payments/providers/catalog';
815
+ const apiPayload: Payload = {};
816
+ const uri = new URL(this.client.config.endpoint + apiPath);
817
+
818
+ const apiHeaders: { [header: string]: string } = {
819
+ }
820
+
821
+ return this.client.call(
822
+ 'get',
823
+ uri,
824
+ apiHeaders,
825
+ apiPayload
826
+ );
827
+ }
828
+
829
+ /**
830
+ *
831
+ * @param {string} params.id -
832
+ * @throws {RevenexxException}
833
+ * @returns {Promise<{}>}
834
+ */
835
+ paymentsProvidersDelete(params: { id: string }): Promise<{}>;
836
+ /**
837
+ *
838
+ * @param {string} id -
839
+ * @throws {RevenexxException}
840
+ * @returns {Promise<{}>}
841
+ * @deprecated Use the object parameter style method for a better developer experience.
842
+ */
843
+ paymentsProvidersDelete(id: string): Promise<{}>;
844
+ paymentsProvidersDelete(
845
+ paramsOrFirst: { id: string } | string
846
+ ): Promise<{}> {
847
+ let params: { id: string };
848
+
849
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
850
+ params = (paramsOrFirst || {}) as { id: string };
851
+ } else {
852
+ params = {
853
+ id: paramsOrFirst as string
854
+ };
855
+ }
856
+
857
+ const id = params.id;
858
+
859
+ if (typeof id === 'undefined') {
860
+ throw new RevenexxException('Missing required parameter: "id"');
861
+ }
862
+
863
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
864
+ const apiPayload: Payload = {};
865
+ const uri = new URL(this.client.config.endpoint + apiPath);
866
+
867
+ const apiHeaders: { [header: string]: string } = {
868
+ }
869
+
870
+ return this.client.call(
871
+ 'delete',
872
+ uri,
873
+ apiHeaders,
874
+ apiPayload
875
+ );
876
+ }
877
+
878
+ /**
879
+ *
880
+ * @param {string} params.id -
881
+ * @throws {RevenexxException}
882
+ * @returns {Promise<Models.PaymentProvider>}
883
+ */
884
+ paymentsProvidersGet(params: { id: string }): Promise<Models.PaymentProvider>;
885
+ /**
886
+ *
887
+ * @param {string} id -
888
+ * @throws {RevenexxException}
889
+ * @returns {Promise<Models.PaymentProvider>}
890
+ * @deprecated Use the object parameter style method for a better developer experience.
891
+ */
892
+ paymentsProvidersGet(id: string): Promise<Models.PaymentProvider>;
893
+ paymentsProvidersGet(
894
+ paramsOrFirst: { id: string } | string
895
+ ): Promise<Models.PaymentProvider> {
896
+ let params: { id: string };
897
+
898
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
899
+ params = (paramsOrFirst || {}) as { id: string };
900
+ } else {
901
+ params = {
902
+ id: paramsOrFirst as string
903
+ };
904
+ }
905
+
906
+ const id = params.id;
907
+
908
+ if (typeof id === 'undefined') {
909
+ throw new RevenexxException('Missing required parameter: "id"');
910
+ }
911
+
912
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
913
+ const apiPayload: Payload = {};
914
+ const uri = new URL(this.client.config.endpoint + apiPath);
915
+
916
+ const apiHeaders: { [header: string]: string } = {
917
+ }
918
+
919
+ return this.client.call(
920
+ 'get',
921
+ uri,
922
+ apiHeaders,
923
+ apiPayload
924
+ );
925
+ }
926
+
927
+ /**
928
+ *
929
+ * @param {string} params.id -
930
+ * @param {object} params.credentials - PSP credentials — the catalog's credential_fields say which keys the auth scheme expects.
931
+ * @param {boolean} params.enabled - Only enabled providers transact (default false).
932
+ * @param {string} params.name - Display name — defaults to the catalog label.
933
+ * @param {object} params.options - Free-form provider options.
934
+ * @param {string} params.provider - Provider code — must exist in the catalog (GET /payments/providers/catalog).
935
+ * @param {boolean} params.testMode - Sandbox/test credentials (default true).
936
+ * @param {string} params.webhookSecret - Shared secret for PSP callback verification.
937
+ * @throws {RevenexxException}
938
+ * @returns {Promise<Models.PaymentProvider>}
939
+ */
940
+ paymentsProvidersUpdate(params: { id: string, credentials?: object, enabled?: boolean, name?: string, options?: object, provider?: string, testMode?: boolean, webhookSecret?: string }): Promise<Models.PaymentProvider>;
941
+ /**
942
+ *
943
+ * @param {string} id -
944
+ * @param {object} credentials - PSP credentials — the catalog's credential_fields say which keys the auth scheme expects.
945
+ * @param {boolean} enabled - Only enabled providers transact (default false).
946
+ * @param {string} name - Display name — defaults to the catalog label.
947
+ * @param {object} options - Free-form provider options.
948
+ * @param {string} provider - Provider code — must exist in the catalog (GET /payments/providers/catalog).
949
+ * @param {boolean} testMode - Sandbox/test credentials (default true).
950
+ * @param {string} webhookSecret - Shared secret for PSP callback verification.
951
+ * @throws {RevenexxException}
952
+ * @returns {Promise<Models.PaymentProvider>}
953
+ * @deprecated Use the object parameter style method for a better developer experience.
954
+ */
955
+ paymentsProvidersUpdate(id: string, credentials?: object, enabled?: boolean, name?: string, options?: object, provider?: string, testMode?: boolean, webhookSecret?: string): Promise<Models.PaymentProvider>;
956
+ paymentsProvidersUpdate(
957
+ paramsOrFirst: { id: string, credentials?: object, enabled?: boolean, name?: string, options?: object, provider?: string, testMode?: boolean, webhookSecret?: string } | string,
958
+ ...rest: [(object)?, (boolean)?, (string)?, (object)?, (string)?, (boolean)?, (string)?]
959
+ ): Promise<Models.PaymentProvider> {
960
+ let params: { id: string, credentials?: object, enabled?: boolean, name?: string, options?: object, provider?: string, testMode?: boolean, webhookSecret?: string };
961
+
962
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
963
+ params = (paramsOrFirst || {}) as { id: string, credentials?: object, enabled?: boolean, name?: string, options?: object, provider?: string, testMode?: boolean, webhookSecret?: string };
964
+ } else {
965
+ params = {
966
+ id: paramsOrFirst as string,
967
+ credentials: rest[0] as object,
968
+ enabled: rest[1] as boolean,
969
+ name: rest[2] as string,
970
+ options: rest[3] as object,
971
+ provider: rest[4] as string,
972
+ testMode: rest[5] as boolean,
973
+ webhookSecret: rest[6] as string
974
+ };
975
+ }
976
+
977
+ const id = params.id;
978
+ const credentials = params.credentials;
979
+ const enabled = params.enabled;
980
+ const name = params.name;
981
+ const options = params.options;
982
+ const provider = params.provider;
983
+ const testMode = params.testMode;
984
+ const webhookSecret = params.webhookSecret;
985
+
986
+ if (typeof id === 'undefined') {
987
+ throw new RevenexxException('Missing required parameter: "id"');
988
+ }
989
+
990
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
991
+ const apiPayload: Payload = {};
992
+ if (typeof credentials !== 'undefined') {
993
+ apiPayload['credentials'] = credentials;
994
+ }
995
+ if (typeof enabled !== 'undefined') {
996
+ apiPayload['enabled'] = enabled;
997
+ }
998
+ if (typeof name !== 'undefined') {
999
+ apiPayload['name'] = name;
1000
+ }
1001
+ if (typeof options !== 'undefined') {
1002
+ apiPayload['options'] = options;
1003
+ }
1004
+ if (typeof provider !== 'undefined') {
1005
+ apiPayload['provider'] = provider;
1006
+ }
1007
+ if (typeof testMode !== 'undefined') {
1008
+ apiPayload['test_mode'] = testMode;
1009
+ }
1010
+ if (typeof webhookSecret !== 'undefined') {
1011
+ apiPayload['webhook_secret'] = webhookSecret;
1012
+ }
1013
+ const uri = new URL(this.client.config.endpoint + apiPath);
1014
+
1015
+ const apiHeaders: { [header: string]: string } = {
1016
+ 'content-type': 'application/json',
1017
+ }
1018
+
1019
+ return this.client.call(
1020
+ 'put',
1021
+ uri,
1022
+ apiHeaders,
1023
+ apiPayload
1024
+ );
1025
+ }
1026
+
1027
+ /**
1028
+ * Consumes the dispatch envelope from webhooks.revenexx.com: normalizes the provider callback (stripe payment intents + a generic shape), resolves the payment by psp_payment_id or order_ref and moves the ledger. Facts only move forward — provider retries and redeliveries are idempotent no-ops; unverified envelopes are refused.
1029
+ *
1030
+ * @param {string} params.provider -
1031
+ * @param {object} params.data - Request body
1032
+ * @throws {RevenexxException}
1033
+ * @returns {Promise<{}>}
1034
+ */
1035
+ paymentsWebhooksIngest(params: { provider: string, data: object }): Promise<{}>;
1036
+ /**
1037
+ * Consumes the dispatch envelope from webhooks.revenexx.com: normalizes the provider callback (stripe payment intents + a generic shape), resolves the payment by psp_payment_id or order_ref and moves the ledger. Facts only move forward — provider retries and redeliveries are idempotent no-ops; unverified envelopes are refused.
1038
+ *
1039
+ * @param {string} provider -
1040
+ * @param {object} data - Request body
1041
+ * @throws {RevenexxException}
1042
+ * @returns {Promise<{}>}
1043
+ * @deprecated Use the object parameter style method for a better developer experience.
1044
+ */
1045
+ paymentsWebhooksIngest(provider: string, data: object): Promise<{}>;
1046
+ paymentsWebhooksIngest(
1047
+ paramsOrFirst: { provider: string, data: object } | string,
1048
+ ...rest: [(object)?]
1049
+ ): Promise<{}> {
1050
+ let params: { provider: string, data: object };
1051
+
1052
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1053
+ params = (paramsOrFirst || {}) as { provider: string, data: object };
1054
+ } else {
1055
+ params = {
1056
+ provider: paramsOrFirst as string,
1057
+ data: rest[0] as object
1058
+ };
1059
+ }
1060
+
1061
+ const provider = params.provider;
1062
+ const data = params.data;
1063
+
1064
+ if (typeof provider === 'undefined') {
1065
+ throw new RevenexxException('Missing required parameter: "provider"');
1066
+ }
1067
+ if (typeof data === 'undefined') {
1068
+ throw new RevenexxException('Missing required parameter: "data"');
1069
+ }
1070
+
1071
+ const apiPath = '/v1/payments/webhooks/{provider}'.replace('{provider}', provider);
1072
+ const apiPayload: Payload = {};
1073
+ if (typeof data !== 'undefined') {
1074
+ Object.assign(apiPayload, data);
1075
+ }
1076
+ const uri = new URL(this.client.config.endpoint + apiPath);
1077
+
1078
+ const apiHeaders: { [header: string]: string } = {
1079
+ 'content-type': 'application/json',
1080
+ }
1081
+
1082
+ return this.client.call(
1083
+ 'post',
1084
+ uri,
1085
+ apiHeaders,
1086
+ apiPayload
1087
+ );
1088
+ }
1089
+
1090
+ /**
1091
+ *
1092
+ * @param {string} params.id -
1093
+ * @throws {RevenexxException}
1094
+ * @returns {Promise<Models.Payment>}
1095
+ */
1096
+ paymentsGet(params: { id: string }): Promise<Models.Payment>;
1097
+ /**
1098
+ *
1099
+ * @param {string} id -
1100
+ * @throws {RevenexxException}
1101
+ * @returns {Promise<Models.Payment>}
1102
+ * @deprecated Use the object parameter style method for a better developer experience.
1103
+ */
1104
+ paymentsGet(id: string): Promise<Models.Payment>;
1105
+ paymentsGet(
1106
+ paramsOrFirst: { id: string } | string
1107
+ ): Promise<Models.Payment> {
1108
+ let params: { id: string };
1109
+
1110
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1111
+ params = (paramsOrFirst || {}) as { id: string };
1112
+ } else {
1113
+ params = {
1114
+ id: paramsOrFirst as string
1115
+ };
1116
+ }
1117
+
1118
+ const id = params.id;
1119
+
1120
+ if (typeof id === 'undefined') {
1121
+ throw new RevenexxException('Missing required parameter: "id"');
1122
+ }
1123
+
1124
+ const apiPath = '/v1/payments/{id}'.replace('{id}', id);
1125
+ const apiPayload: Payload = {};
1126
+ const uri = new URL(this.client.config.endpoint + apiPath);
1127
+
1128
+ const apiHeaders: { [header: string]: string } = {
1129
+ }
1130
+
1131
+ return this.client.call(
1132
+ 'get',
1133
+ uri,
1134
+ apiHeaders,
1135
+ apiPayload
1136
+ );
1137
+ }
1138
+
1139
+ /**
1140
+ *
1141
+ * @param {string} params.id -
1142
+ * @throws {RevenexxException}
1143
+ * @returns {Promise<Models.Payment>}
1144
+ */
1145
+ paymentsCancel(params: { id: string }): Promise<Models.Payment>;
1146
+ /**
1147
+ *
1148
+ * @param {string} id -
1149
+ * @throws {RevenexxException}
1150
+ * @returns {Promise<Models.Payment>}
1151
+ * @deprecated Use the object parameter style method for a better developer experience.
1152
+ */
1153
+ paymentsCancel(id: string): Promise<Models.Payment>;
1154
+ paymentsCancel(
1155
+ paramsOrFirst: { id: string } | string
1156
+ ): Promise<Models.Payment> {
1157
+ let params: { id: string };
1158
+
1159
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1160
+ params = (paramsOrFirst || {}) as { id: string };
1161
+ } else {
1162
+ params = {
1163
+ id: paramsOrFirst as string
1164
+ };
1165
+ }
1166
+
1167
+ const id = params.id;
1168
+
1169
+ if (typeof id === 'undefined') {
1170
+ throw new RevenexxException('Missing required parameter: "id"');
1171
+ }
1172
+
1173
+ const apiPath = '/v1/payments/{id}/cancel'.replace('{id}', id);
1174
+ const apiPayload: Payload = {};
1175
+ const uri = new URL(this.client.config.endpoint + apiPath);
1176
+
1177
+ const apiHeaders: { [header: string]: string } = {
1178
+ }
1179
+
1180
+ return this.client.call(
1181
+ 'post',
1182
+ uri,
1183
+ apiHeaders,
1184
+ apiPayload
1185
+ );
1186
+ }
1187
+
1188
+ /**
1189
+ *
1190
+ * @param {string} params.id -
1191
+ * @throws {RevenexxException}
1192
+ * @returns {Promise<Models.Payment>}
1193
+ */
1194
+ paymentsCapture(params: { id: string }): Promise<Models.Payment>;
1195
+ /**
1196
+ *
1197
+ * @param {string} id -
1198
+ * @throws {RevenexxException}
1199
+ * @returns {Promise<Models.Payment>}
1200
+ * @deprecated Use the object parameter style method for a better developer experience.
1201
+ */
1202
+ paymentsCapture(id: string): Promise<Models.Payment>;
1203
+ paymentsCapture(
1204
+ paramsOrFirst: { id: string } | string
1205
+ ): Promise<Models.Payment> {
1206
+ let params: { id: string };
1207
+
1208
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1209
+ params = (paramsOrFirst || {}) as { id: string };
1210
+ } else {
1211
+ params = {
1212
+ id: paramsOrFirst as string
1213
+ };
1214
+ }
1215
+
1216
+ const id = params.id;
1217
+
1218
+ if (typeof id === 'undefined') {
1219
+ throw new RevenexxException('Missing required parameter: "id"');
1220
+ }
1221
+
1222
+ const apiPath = '/v1/payments/{id}/capture'.replace('{id}', id);
1223
+ const apiPayload: Payload = {};
1224
+ const uri = new URL(this.client.config.endpoint + apiPath);
1225
+
1226
+ const apiHeaders: { [header: string]: string } = {
1227
+ }
1228
+
1229
+ return this.client.call(
1230
+ 'post',
1231
+ uri,
1232
+ apiHeaders,
1233
+ apiPayload
1234
+ );
1235
+ }
1236
+
1237
+ /**
1238
+ *
1239
+ * @param {string} params.id -
1240
+ * @throws {RevenexxException}
1241
+ * @returns {Promise<Models.Payment>}
1242
+ */
1243
+ paymentsConfirm(params: { id: string }): Promise<Models.Payment>;
1244
+ /**
1245
+ *
1246
+ * @param {string} id -
1247
+ * @throws {RevenexxException}
1248
+ * @returns {Promise<Models.Payment>}
1249
+ * @deprecated Use the object parameter style method for a better developer experience.
1250
+ */
1251
+ paymentsConfirm(id: string): Promise<Models.Payment>;
1252
+ paymentsConfirm(
1253
+ paramsOrFirst: { id: string } | string
1254
+ ): Promise<Models.Payment> {
1255
+ let params: { id: string };
1256
+
1257
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1258
+ params = (paramsOrFirst || {}) as { id: string };
1259
+ } else {
1260
+ params = {
1261
+ id: paramsOrFirst as string
1262
+ };
1263
+ }
1264
+
1265
+ const id = params.id;
1266
+
1267
+ if (typeof id === 'undefined') {
1268
+ throw new RevenexxException('Missing required parameter: "id"');
1269
+ }
1270
+
1271
+ const apiPath = '/v1/payments/{id}/confirm'.replace('{id}', id);
1272
+ const apiPayload: Payload = {};
1273
+ const uri = new URL(this.client.config.endpoint + apiPath);
1274
+
1275
+ const apiHeaders: { [header: string]: string } = {
1276
+ }
1277
+
1278
+ return this.client.call(
1279
+ 'post',
1280
+ uri,
1281
+ apiHeaders,
1282
+ apiPayload
1283
+ );
1284
+ }
1285
+
1286
+ /**
1287
+ *
1288
+ * @param {string} params.id -
1289
+ * @throws {RevenexxException}
1290
+ * @returns {Promise<Models.Payment>}
1291
+ */
1292
+ paymentsRefund(params: { id: string }): Promise<Models.Payment>;
1293
+ /**
1294
+ *
1295
+ * @param {string} id -
1296
+ * @throws {RevenexxException}
1297
+ * @returns {Promise<Models.Payment>}
1298
+ * @deprecated Use the object parameter style method for a better developer experience.
1299
+ */
1300
+ paymentsRefund(id: string): Promise<Models.Payment>;
1301
+ paymentsRefund(
1302
+ paramsOrFirst: { id: string } | string
1303
+ ): Promise<Models.Payment> {
1304
+ let params: { id: string };
1305
+
1306
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1307
+ params = (paramsOrFirst || {}) as { id: string };
1308
+ } else {
1309
+ params = {
1310
+ id: paramsOrFirst as string
1311
+ };
1312
+ }
1313
+
1314
+ const id = params.id;
1315
+
1316
+ if (typeof id === 'undefined') {
1317
+ throw new RevenexxException('Missing required parameter: "id"');
1318
+ }
1319
+
1320
+ const apiPath = '/v1/payments/{id}/refund'.replace('{id}', id);
1321
+ const apiPayload: Payload = {};
1322
+ const uri = new URL(this.client.config.endpoint + apiPath);
1323
+
1324
+ const apiHeaders: { [header: string]: string } = {
1325
+ }
1326
+
1327
+ return this.client.call(
1328
+ 'post',
1329
+ uri,
1330
+ apiHeaders,
1331
+ apiPayload
1332
+ );
1333
+ }
1334
+ }