@revenexx/sdk 0.0.2 → 0.0.4

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.
@@ -0,0 +1,807 @@
1
+ import { Service } from '../service';
2
+ import { RevenexxException, Client, type Payload, UploadProgress } from '../client';
3
+ import type { Models } from '../models';
4
+
5
+
6
+ export class Payments {
7
+ client: Client;
8
+
9
+ constructor(client: Client) {
10
+ this.client = client;
11
+ }
12
+
13
+ /**
14
+ *
15
+ * @throws {RevenexxException}
16
+ * @returns {Promise<{}>}
17
+ */
18
+ paymentsList(): Promise<{}> {
19
+
20
+ const apiPath = '/v1/payments';
21
+ const payload: Payload = {};
22
+ const uri = new URL(this.client.config.endpoint + apiPath);
23
+
24
+ const apiHeaders: { [header: string]: string } = {
25
+ }
26
+
27
+ return this.client.call(
28
+ 'get',
29
+ uri,
30
+ apiHeaders,
31
+ payload
32
+ );
33
+ }
34
+
35
+ /**
36
+ *
37
+ * @throws {RevenexxException}
38
+ * @returns {Promise<Models.Payment>}
39
+ */
40
+ paymentsCreate(): Promise<Models.Payment> {
41
+
42
+ const apiPath = '/v1/payments';
43
+ const payload: Payload = {};
44
+ const uri = new URL(this.client.config.endpoint + apiPath);
45
+
46
+ const apiHeaders: { [header: string]: string } = {
47
+ 'content-type': 'application/json',
48
+ }
49
+
50
+ return this.client.call(
51
+ 'post',
52
+ uri,
53
+ apiHeaders,
54
+ payload
55
+ );
56
+ }
57
+
58
+ /**
59
+ *
60
+ * @throws {RevenexxException}
61
+ * @returns {Promise<{}>}
62
+ */
63
+ paymentsMethodsList(): Promise<{}> {
64
+
65
+ const apiPath = '/v1/payments/methods';
66
+ const payload: Payload = {};
67
+ const uri = new URL(this.client.config.endpoint + apiPath);
68
+
69
+ const apiHeaders: { [header: string]: string } = {
70
+ }
71
+
72
+ return this.client.call(
73
+ 'get',
74
+ uri,
75
+ apiHeaders,
76
+ payload
77
+ );
78
+ }
79
+
80
+ /**
81
+ *
82
+ * @throws {RevenexxException}
83
+ * @returns {Promise<Models.PaymentMethod>}
84
+ */
85
+ paymentsMethodsCreate(): Promise<Models.PaymentMethod> {
86
+
87
+ const apiPath = '/v1/payments/methods';
88
+ const payload: Payload = {};
89
+ const uri = new URL(this.client.config.endpoint + apiPath);
90
+
91
+ const apiHeaders: { [header: string]: string } = {
92
+ 'content-type': 'application/json',
93
+ }
94
+
95
+ return this.client.call(
96
+ 'post',
97
+ uri,
98
+ apiHeaders,
99
+ payload
100
+ );
101
+ }
102
+
103
+ /**
104
+ *
105
+ * @throws {RevenexxException}
106
+ * @returns {Promise<{}>}
107
+ */
108
+ paymentsMethodsDefaults(): Promise<{}> {
109
+
110
+ const apiPath = '/v1/payments/methods/defaults';
111
+ const payload: Payload = {};
112
+ const uri = new URL(this.client.config.endpoint + apiPath);
113
+
114
+ const apiHeaders: { [header: string]: string } = {
115
+ }
116
+
117
+ return this.client.call(
118
+ 'post',
119
+ uri,
120
+ apiHeaders,
121
+ payload
122
+ );
123
+ }
124
+
125
+ /**
126
+ *
127
+ * @throws {RevenexxException}
128
+ * @returns {Promise<{}>}
129
+ */
130
+ paymentsMethodsEligible(): Promise<{}> {
131
+
132
+ const apiPath = '/v1/payments/methods/eligible';
133
+ const payload: Payload = {};
134
+ const uri = new URL(this.client.config.endpoint + apiPath);
135
+
136
+ const apiHeaders: { [header: string]: string } = {
137
+ 'content-type': 'application/json',
138
+ }
139
+
140
+ return this.client.call(
141
+ 'post',
142
+ uri,
143
+ apiHeaders,
144
+ payload
145
+ );
146
+ }
147
+
148
+ /**
149
+ *
150
+ * @param {string} params.id -
151
+ * @throws {RevenexxException}
152
+ * @returns {Promise<{}>}
153
+ */
154
+ paymentsMethodsDelete(params: { id: string }): Promise<{}>;
155
+ /**
156
+ *
157
+ * @param {string} id -
158
+ * @throws {RevenexxException}
159
+ * @returns {Promise<{}>}
160
+ * @deprecated Use the object parameter style method for a better developer experience.
161
+ */
162
+ paymentsMethodsDelete(id: string): Promise<{}>;
163
+ paymentsMethodsDelete(
164
+ paramsOrFirst: { id: string } | string
165
+ ): Promise<{}> {
166
+ let params: { id: string };
167
+
168
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
169
+ params = (paramsOrFirst || {}) as { id: string };
170
+ } else {
171
+ params = {
172
+ id: paramsOrFirst as string
173
+ };
174
+ }
175
+
176
+ const id = params.id;
177
+
178
+ if (typeof id === 'undefined') {
179
+ throw new RevenexxException('Missing required parameter: "id"');
180
+ }
181
+
182
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
183
+ const payload: Payload = {};
184
+ const uri = new URL(this.client.config.endpoint + apiPath);
185
+
186
+ const apiHeaders: { [header: string]: string } = {
187
+ }
188
+
189
+ return this.client.call(
190
+ 'delete',
191
+ uri,
192
+ apiHeaders,
193
+ payload
194
+ );
195
+ }
196
+
197
+ /**
198
+ *
199
+ * @param {string} params.id -
200
+ * @throws {RevenexxException}
201
+ * @returns {Promise<Models.PaymentMethod>}
202
+ */
203
+ paymentsMethodsGet(params: { id: string }): Promise<Models.PaymentMethod>;
204
+ /**
205
+ *
206
+ * @param {string} id -
207
+ * @throws {RevenexxException}
208
+ * @returns {Promise<Models.PaymentMethod>}
209
+ * @deprecated Use the object parameter style method for a better developer experience.
210
+ */
211
+ paymentsMethodsGet(id: string): Promise<Models.PaymentMethod>;
212
+ paymentsMethodsGet(
213
+ paramsOrFirst: { id: string } | string
214
+ ): Promise<Models.PaymentMethod> {
215
+ let params: { id: string };
216
+
217
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
218
+ params = (paramsOrFirst || {}) as { id: string };
219
+ } else {
220
+ params = {
221
+ id: paramsOrFirst as string
222
+ };
223
+ }
224
+
225
+ const id = params.id;
226
+
227
+ if (typeof id === 'undefined') {
228
+ throw new RevenexxException('Missing required parameter: "id"');
229
+ }
230
+
231
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
232
+ const payload: Payload = {};
233
+ const uri = new URL(this.client.config.endpoint + apiPath);
234
+
235
+ const apiHeaders: { [header: string]: string } = {
236
+ }
237
+
238
+ return this.client.call(
239
+ 'get',
240
+ uri,
241
+ apiHeaders,
242
+ payload
243
+ );
244
+ }
245
+
246
+ /**
247
+ *
248
+ * @param {string} params.id -
249
+ * @throws {RevenexxException}
250
+ * @returns {Promise<Models.PaymentMethod>}
251
+ */
252
+ paymentsMethodsUpdate(params: { id: string }): Promise<Models.PaymentMethod>;
253
+ /**
254
+ *
255
+ * @param {string} id -
256
+ * @throws {RevenexxException}
257
+ * @returns {Promise<Models.PaymentMethod>}
258
+ * @deprecated Use the object parameter style method for a better developer experience.
259
+ */
260
+ paymentsMethodsUpdate(id: string): Promise<Models.PaymentMethod>;
261
+ paymentsMethodsUpdate(
262
+ paramsOrFirst: { id: string } | string
263
+ ): Promise<Models.PaymentMethod> {
264
+ let params: { id: string };
265
+
266
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
267
+ params = (paramsOrFirst || {}) as { id: string };
268
+ } else {
269
+ params = {
270
+ id: paramsOrFirst as string
271
+ };
272
+ }
273
+
274
+ const id = params.id;
275
+
276
+ if (typeof id === 'undefined') {
277
+ throw new RevenexxException('Missing required parameter: "id"');
278
+ }
279
+
280
+ const apiPath = '/v1/payments/methods/{id}'.replace('{id}', id);
281
+ const payload: Payload = {};
282
+ const uri = new URL(this.client.config.endpoint + apiPath);
283
+
284
+ const apiHeaders: { [header: string]: string } = {
285
+ 'content-type': 'application/json',
286
+ }
287
+
288
+ return this.client.call(
289
+ 'put',
290
+ uri,
291
+ apiHeaders,
292
+ payload
293
+ );
294
+ }
295
+
296
+ /**
297
+ *
298
+ * @throws {RevenexxException}
299
+ * @returns {Promise<{}>}
300
+ */
301
+ paymentsProvidersList(): Promise<{}> {
302
+
303
+ const apiPath = '/v1/payments/providers';
304
+ const payload: Payload = {};
305
+ const uri = new URL(this.client.config.endpoint + apiPath);
306
+
307
+ const apiHeaders: { [header: string]: string } = {
308
+ }
309
+
310
+ return this.client.call(
311
+ 'get',
312
+ uri,
313
+ apiHeaders,
314
+ payload
315
+ );
316
+ }
317
+
318
+ /**
319
+ *
320
+ * @throws {RevenexxException}
321
+ * @returns {Promise<Models.PaymentProvider>}
322
+ */
323
+ paymentsProvidersCreate(): Promise<Models.PaymentProvider> {
324
+
325
+ const apiPath = '/v1/payments/providers';
326
+ const payload: Payload = {};
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
+ payload
338
+ );
339
+ }
340
+
341
+ /**
342
+ *
343
+ * @throws {RevenexxException}
344
+ * @returns {Promise<{}>}
345
+ */
346
+ paymentsProvidersCatalog(): Promise<{}> {
347
+
348
+ const apiPath = '/v1/payments/providers/catalog';
349
+ const payload: 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
+ 'get',
357
+ uri,
358
+ apiHeaders,
359
+ payload
360
+ );
361
+ }
362
+
363
+ /**
364
+ *
365
+ * @param {string} params.id -
366
+ * @throws {RevenexxException}
367
+ * @returns {Promise<{}>}
368
+ */
369
+ paymentsProvidersDelete(params: { id: string }): Promise<{}>;
370
+ /**
371
+ *
372
+ * @param {string} id -
373
+ * @throws {RevenexxException}
374
+ * @returns {Promise<{}>}
375
+ * @deprecated Use the object parameter style method for a better developer experience.
376
+ */
377
+ paymentsProvidersDelete(id: string): Promise<{}>;
378
+ paymentsProvidersDelete(
379
+ paramsOrFirst: { id: string } | string
380
+ ): Promise<{}> {
381
+ let params: { id: string };
382
+
383
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
384
+ params = (paramsOrFirst || {}) as { id: string };
385
+ } else {
386
+ params = {
387
+ id: paramsOrFirst as string
388
+ };
389
+ }
390
+
391
+ const id = params.id;
392
+
393
+ if (typeof id === 'undefined') {
394
+ throw new RevenexxException('Missing required parameter: "id"');
395
+ }
396
+
397
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
398
+ const payload: Payload = {};
399
+ const uri = new URL(this.client.config.endpoint + apiPath);
400
+
401
+ const apiHeaders: { [header: string]: string } = {
402
+ }
403
+
404
+ return this.client.call(
405
+ 'delete',
406
+ uri,
407
+ apiHeaders,
408
+ payload
409
+ );
410
+ }
411
+
412
+ /**
413
+ *
414
+ * @param {string} params.id -
415
+ * @throws {RevenexxException}
416
+ * @returns {Promise<Models.PaymentProvider>}
417
+ */
418
+ paymentsProvidersGet(params: { id: string }): Promise<Models.PaymentProvider>;
419
+ /**
420
+ *
421
+ * @param {string} id -
422
+ * @throws {RevenexxException}
423
+ * @returns {Promise<Models.PaymentProvider>}
424
+ * @deprecated Use the object parameter style method for a better developer experience.
425
+ */
426
+ paymentsProvidersGet(id: string): Promise<Models.PaymentProvider>;
427
+ paymentsProvidersGet(
428
+ paramsOrFirst: { id: string } | string
429
+ ): Promise<Models.PaymentProvider> {
430
+ let params: { id: string };
431
+
432
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
433
+ params = (paramsOrFirst || {}) as { id: string };
434
+ } else {
435
+ params = {
436
+ id: paramsOrFirst as string
437
+ };
438
+ }
439
+
440
+ const id = params.id;
441
+
442
+ if (typeof id === 'undefined') {
443
+ throw new RevenexxException('Missing required parameter: "id"');
444
+ }
445
+
446
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
447
+ const payload: Payload = {};
448
+ const uri = new URL(this.client.config.endpoint + apiPath);
449
+
450
+ const apiHeaders: { [header: string]: string } = {
451
+ }
452
+
453
+ return this.client.call(
454
+ 'get',
455
+ uri,
456
+ apiHeaders,
457
+ payload
458
+ );
459
+ }
460
+
461
+ /**
462
+ *
463
+ * @param {string} params.id -
464
+ * @throws {RevenexxException}
465
+ * @returns {Promise<Models.PaymentProvider>}
466
+ */
467
+ paymentsProvidersUpdate(params: { id: string }): Promise<Models.PaymentProvider>;
468
+ /**
469
+ *
470
+ * @param {string} id -
471
+ * @throws {RevenexxException}
472
+ * @returns {Promise<Models.PaymentProvider>}
473
+ * @deprecated Use the object parameter style method for a better developer experience.
474
+ */
475
+ paymentsProvidersUpdate(id: string): Promise<Models.PaymentProvider>;
476
+ paymentsProvidersUpdate(
477
+ paramsOrFirst: { id: string } | string
478
+ ): Promise<Models.PaymentProvider> {
479
+ let params: { id: string };
480
+
481
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
482
+ params = (paramsOrFirst || {}) as { id: string };
483
+ } else {
484
+ params = {
485
+ id: paramsOrFirst as string
486
+ };
487
+ }
488
+
489
+ const id = params.id;
490
+
491
+ if (typeof id === 'undefined') {
492
+ throw new RevenexxException('Missing required parameter: "id"');
493
+ }
494
+
495
+ const apiPath = '/v1/payments/providers/{id}'.replace('{id}', id);
496
+ const payload: Payload = {};
497
+ const uri = new URL(this.client.config.endpoint + apiPath);
498
+
499
+ const apiHeaders: { [header: string]: string } = {
500
+ 'content-type': 'application/json',
501
+ }
502
+
503
+ return this.client.call(
504
+ 'put',
505
+ uri,
506
+ apiHeaders,
507
+ payload
508
+ );
509
+ }
510
+
511
+ /**
512
+ * 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.
513
+ *
514
+ * @param {string} params.provider -
515
+ * @throws {RevenexxException}
516
+ * @returns {Promise<{}>}
517
+ */
518
+ paymentsWebhooksIngest(params: { provider: string }): Promise<{}>;
519
+ /**
520
+ * 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.
521
+ *
522
+ * @param {string} provider -
523
+ * @throws {RevenexxException}
524
+ * @returns {Promise<{}>}
525
+ * @deprecated Use the object parameter style method for a better developer experience.
526
+ */
527
+ paymentsWebhooksIngest(provider: string): Promise<{}>;
528
+ paymentsWebhooksIngest(
529
+ paramsOrFirst: { provider: string } | string
530
+ ): Promise<{}> {
531
+ let params: { provider: string };
532
+
533
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
534
+ params = (paramsOrFirst || {}) as { provider: string };
535
+ } else {
536
+ params = {
537
+ provider: paramsOrFirst as string
538
+ };
539
+ }
540
+
541
+ const provider = params.provider;
542
+
543
+ if (typeof provider === 'undefined') {
544
+ throw new RevenexxException('Missing required parameter: "provider"');
545
+ }
546
+
547
+ const apiPath = '/v1/payments/webhooks/{provider}'.replace('{provider}', provider);
548
+ const payload: Payload = {};
549
+ const uri = new URL(this.client.config.endpoint + apiPath);
550
+
551
+ const apiHeaders: { [header: string]: string } = {
552
+ 'content-type': 'application/json',
553
+ }
554
+
555
+ return this.client.call(
556
+ 'post',
557
+ uri,
558
+ apiHeaders,
559
+ payload
560
+ );
561
+ }
562
+
563
+ /**
564
+ *
565
+ * @param {string} params.id -
566
+ * @throws {RevenexxException}
567
+ * @returns {Promise<Models.Payment>}
568
+ */
569
+ paymentsGet(params: { id: string }): Promise<Models.Payment>;
570
+ /**
571
+ *
572
+ * @param {string} id -
573
+ * @throws {RevenexxException}
574
+ * @returns {Promise<Models.Payment>}
575
+ * @deprecated Use the object parameter style method for a better developer experience.
576
+ */
577
+ paymentsGet(id: string): Promise<Models.Payment>;
578
+ paymentsGet(
579
+ paramsOrFirst: { id: string } | string
580
+ ): Promise<Models.Payment> {
581
+ let params: { id: string };
582
+
583
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
584
+ params = (paramsOrFirst || {}) as { id: string };
585
+ } else {
586
+ params = {
587
+ id: paramsOrFirst as string
588
+ };
589
+ }
590
+
591
+ const id = params.id;
592
+
593
+ if (typeof id === 'undefined') {
594
+ throw new RevenexxException('Missing required parameter: "id"');
595
+ }
596
+
597
+ const apiPath = '/v1/payments/{id}'.replace('{id}', id);
598
+ const payload: Payload = {};
599
+ const uri = new URL(this.client.config.endpoint + apiPath);
600
+
601
+ const apiHeaders: { [header: string]: string } = {
602
+ }
603
+
604
+ return this.client.call(
605
+ 'get',
606
+ uri,
607
+ apiHeaders,
608
+ payload
609
+ );
610
+ }
611
+
612
+ /**
613
+ *
614
+ * @param {string} params.id -
615
+ * @throws {RevenexxException}
616
+ * @returns {Promise<Models.Payment>}
617
+ */
618
+ paymentsCancel(params: { id: string }): Promise<Models.Payment>;
619
+ /**
620
+ *
621
+ * @param {string} id -
622
+ * @throws {RevenexxException}
623
+ * @returns {Promise<Models.Payment>}
624
+ * @deprecated Use the object parameter style method for a better developer experience.
625
+ */
626
+ paymentsCancel(id: string): Promise<Models.Payment>;
627
+ paymentsCancel(
628
+ paramsOrFirst: { id: string } | string
629
+ ): Promise<Models.Payment> {
630
+ let params: { id: string };
631
+
632
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
633
+ params = (paramsOrFirst || {}) as { id: string };
634
+ } else {
635
+ params = {
636
+ id: paramsOrFirst as string
637
+ };
638
+ }
639
+
640
+ const id = params.id;
641
+
642
+ if (typeof id === 'undefined') {
643
+ throw new RevenexxException('Missing required parameter: "id"');
644
+ }
645
+
646
+ const apiPath = '/v1/payments/{id}/cancel'.replace('{id}', id);
647
+ const payload: Payload = {};
648
+ const uri = new URL(this.client.config.endpoint + apiPath);
649
+
650
+ const apiHeaders: { [header: string]: string } = {
651
+ }
652
+
653
+ return this.client.call(
654
+ 'post',
655
+ uri,
656
+ apiHeaders,
657
+ payload
658
+ );
659
+ }
660
+
661
+ /**
662
+ *
663
+ * @param {string} params.id -
664
+ * @throws {RevenexxException}
665
+ * @returns {Promise<Models.Payment>}
666
+ */
667
+ paymentsCapture(params: { id: string }): Promise<Models.Payment>;
668
+ /**
669
+ *
670
+ * @param {string} id -
671
+ * @throws {RevenexxException}
672
+ * @returns {Promise<Models.Payment>}
673
+ * @deprecated Use the object parameter style method for a better developer experience.
674
+ */
675
+ paymentsCapture(id: string): Promise<Models.Payment>;
676
+ paymentsCapture(
677
+ paramsOrFirst: { id: string } | string
678
+ ): Promise<Models.Payment> {
679
+ let params: { id: string };
680
+
681
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
682
+ params = (paramsOrFirst || {}) as { id: string };
683
+ } else {
684
+ params = {
685
+ id: paramsOrFirst as string
686
+ };
687
+ }
688
+
689
+ const id = params.id;
690
+
691
+ if (typeof id === 'undefined') {
692
+ throw new RevenexxException('Missing required parameter: "id"');
693
+ }
694
+
695
+ const apiPath = '/v1/payments/{id}/capture'.replace('{id}', id);
696
+ const payload: Payload = {};
697
+ const uri = new URL(this.client.config.endpoint + apiPath);
698
+
699
+ const apiHeaders: { [header: string]: string } = {
700
+ }
701
+
702
+ return this.client.call(
703
+ 'post',
704
+ uri,
705
+ apiHeaders,
706
+ payload
707
+ );
708
+ }
709
+
710
+ /**
711
+ *
712
+ * @param {string} params.id -
713
+ * @throws {RevenexxException}
714
+ * @returns {Promise<Models.Payment>}
715
+ */
716
+ paymentsConfirm(params: { id: string }): Promise<Models.Payment>;
717
+ /**
718
+ *
719
+ * @param {string} id -
720
+ * @throws {RevenexxException}
721
+ * @returns {Promise<Models.Payment>}
722
+ * @deprecated Use the object parameter style method for a better developer experience.
723
+ */
724
+ paymentsConfirm(id: string): Promise<Models.Payment>;
725
+ paymentsConfirm(
726
+ paramsOrFirst: { id: string } | string
727
+ ): Promise<Models.Payment> {
728
+ let params: { id: string };
729
+
730
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
731
+ params = (paramsOrFirst || {}) as { id: string };
732
+ } else {
733
+ params = {
734
+ id: paramsOrFirst as string
735
+ };
736
+ }
737
+
738
+ const id = params.id;
739
+
740
+ if (typeof id === 'undefined') {
741
+ throw new RevenexxException('Missing required parameter: "id"');
742
+ }
743
+
744
+ const apiPath = '/v1/payments/{id}/confirm'.replace('{id}', id);
745
+ const payload: Payload = {};
746
+ const uri = new URL(this.client.config.endpoint + apiPath);
747
+
748
+ const apiHeaders: { [header: string]: string } = {
749
+ }
750
+
751
+ return this.client.call(
752
+ 'post',
753
+ uri,
754
+ apiHeaders,
755
+ payload
756
+ );
757
+ }
758
+
759
+ /**
760
+ *
761
+ * @param {string} params.id -
762
+ * @throws {RevenexxException}
763
+ * @returns {Promise<Models.Payment>}
764
+ */
765
+ paymentsRefund(params: { id: string }): Promise<Models.Payment>;
766
+ /**
767
+ *
768
+ * @param {string} id -
769
+ * @throws {RevenexxException}
770
+ * @returns {Promise<Models.Payment>}
771
+ * @deprecated Use the object parameter style method for a better developer experience.
772
+ */
773
+ paymentsRefund(id: string): Promise<Models.Payment>;
774
+ paymentsRefund(
775
+ paramsOrFirst: { id: string } | string
776
+ ): Promise<Models.Payment> {
777
+ let params: { id: string };
778
+
779
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
780
+ params = (paramsOrFirst || {}) as { id: string };
781
+ } else {
782
+ params = {
783
+ id: paramsOrFirst as string
784
+ };
785
+ }
786
+
787
+ const id = params.id;
788
+
789
+ if (typeof id === 'undefined') {
790
+ throw new RevenexxException('Missing required parameter: "id"');
791
+ }
792
+
793
+ const apiPath = '/v1/payments/{id}/refund'.replace('{id}', id);
794
+ const payload: Payload = {};
795
+ const uri = new URL(this.client.config.endpoint + apiPath);
796
+
797
+ const apiHeaders: { [header: string]: string } = {
798
+ }
799
+
800
+ return this.client.call(
801
+ 'post',
802
+ uri,
803
+ apiHeaders,
804
+ payload
805
+ );
806
+ }
807
+ }