@djangocfg/ext-payments 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 (67) hide show
  1. package/README.md +206 -0
  2. package/dist/chunk-5KY6HVXF.js +2593 -0
  3. package/dist/hooks.cjs +2666 -0
  4. package/dist/hooks.d.cts +186 -0
  5. package/dist/hooks.d.ts +186 -0
  6. package/dist/hooks.js +1 -0
  7. package/dist/index.cjs +2590 -0
  8. package/dist/index.d.cts +1287 -0
  9. package/dist/index.d.ts +1287 -0
  10. package/dist/index.js +1 -0
  11. package/package.json +79 -0
  12. package/src/api/generated/ext_payments/_utils/fetchers/ext_payments__payments.ts +408 -0
  13. package/src/api/generated/ext_payments/_utils/fetchers/index.ts +28 -0
  14. package/src/api/generated/ext_payments/_utils/hooks/ext_payments__payments.ts +147 -0
  15. package/src/api/generated/ext_payments/_utils/hooks/index.ts +28 -0
  16. package/src/api/generated/ext_payments/_utils/schemas/Balance.schema.ts +23 -0
  17. package/src/api/generated/ext_payments/_utils/schemas/Currency.schema.ts +28 -0
  18. package/src/api/generated/ext_payments/_utils/schemas/PaginatedPaymentListList.schema.ts +24 -0
  19. package/src/api/generated/ext_payments/_utils/schemas/PaymentDetail.schema.ts +44 -0
  20. package/src/api/generated/ext_payments/_utils/schemas/PaymentList.schema.ts +28 -0
  21. package/src/api/generated/ext_payments/_utils/schemas/Transaction.schema.ts +28 -0
  22. package/src/api/generated/ext_payments/_utils/schemas/index.ts +24 -0
  23. package/src/api/generated/ext_payments/api-instance.ts +131 -0
  24. package/src/api/generated/ext_payments/client.ts +301 -0
  25. package/src/api/generated/ext_payments/enums.ts +64 -0
  26. package/src/api/generated/ext_payments/errors.ts +116 -0
  27. package/src/api/generated/ext_payments/ext_payments__payments/client.ts +118 -0
  28. package/src/api/generated/ext_payments/ext_payments__payments/index.ts +2 -0
  29. package/src/api/generated/ext_payments/ext_payments__payments/models.ts +135 -0
  30. package/src/api/generated/ext_payments/http.ts +103 -0
  31. package/src/api/generated/ext_payments/index.ts +273 -0
  32. package/src/api/generated/ext_payments/logger.ts +259 -0
  33. package/src/api/generated/ext_payments/retry.ts +175 -0
  34. package/src/api/generated/ext_payments/schema.json +850 -0
  35. package/src/api/generated/ext_payments/storage.ts +161 -0
  36. package/src/api/generated/ext_payments/validation-events.ts +133 -0
  37. package/src/api/index.ts +9 -0
  38. package/src/config.ts +20 -0
  39. package/src/contexts/BalancesContext.tsx +62 -0
  40. package/src/contexts/CurrenciesContext.tsx +63 -0
  41. package/src/contexts/OverviewContext.tsx +173 -0
  42. package/src/contexts/PaymentsContext.tsx +121 -0
  43. package/src/contexts/PaymentsExtensionProvider.tsx +55 -0
  44. package/src/contexts/README.md +201 -0
  45. package/src/contexts/RootPaymentsContext.tsx +65 -0
  46. package/src/contexts/index.ts +45 -0
  47. package/src/contexts/types.ts +40 -0
  48. package/src/hooks/index.ts +20 -0
  49. package/src/index.ts +36 -0
  50. package/src/layouts/PaymentsLayout/PaymentsLayout.tsx +92 -0
  51. package/src/layouts/PaymentsLayout/components/CreatePaymentDialog.tsx +291 -0
  52. package/src/layouts/PaymentsLayout/components/PaymentDetailsDialog.tsx +290 -0
  53. package/src/layouts/PaymentsLayout/components/index.ts +2 -0
  54. package/src/layouts/PaymentsLayout/events.ts +47 -0
  55. package/src/layouts/PaymentsLayout/index.ts +16 -0
  56. package/src/layouts/PaymentsLayout/types.ts +6 -0
  57. package/src/layouts/PaymentsLayout/views/overview/components/BalanceCard.tsx +128 -0
  58. package/src/layouts/PaymentsLayout/views/overview/components/RecentPayments.tsx +142 -0
  59. package/src/layouts/PaymentsLayout/views/overview/components/index.ts +2 -0
  60. package/src/layouts/PaymentsLayout/views/overview/index.tsx +20 -0
  61. package/src/layouts/PaymentsLayout/views/payments/components/PaymentsList.tsx +277 -0
  62. package/src/layouts/PaymentsLayout/views/payments/components/index.ts +1 -0
  63. package/src/layouts/PaymentsLayout/views/payments/index.tsx +17 -0
  64. package/src/layouts/PaymentsLayout/views/transactions/components/TransactionsList.tsx +273 -0
  65. package/src/layouts/PaymentsLayout/views/transactions/components/index.ts +1 -0
  66. package/src/layouts/PaymentsLayout/views/transactions/index.tsx +17 -0
  67. package/src/utils/logger.ts +9 -0
@@ -0,0 +1,850 @@
1
+ {
2
+ "openapi": "3.0.3",
3
+ "info": {
4
+ "title": "Django CFG API",
5
+ "version": "1.0.0",
6
+ "description": "Complete API documentation for Django CFG Demo Project",
7
+ "x-django-metadata": {
8
+ "group": "ext_payments",
9
+ "apps": [
10
+ "ext_payments"
11
+ ],
12
+ "generator": "django-client",
13
+ "generator_version": "1.0.0"
14
+ }
15
+ },
16
+ "paths": {
17
+ "/cfg/payments/balance/": {
18
+ "get": {
19
+ "operationId": "cfg_payments_balance_retrieve",
20
+ "description": "Get current user balance and transaction statistics",
21
+ "summary": "Get user balance",
22
+ "tags": [
23
+ "payments"
24
+ ],
25
+ "security": [
26
+ {
27
+ "jwtAuthWithLastLogin": []
28
+ }
29
+ ],
30
+ "responses": {
31
+ "200": {
32
+ "content": {
33
+ "application/json": {
34
+ "schema": {
35
+ "$ref": "#/components/schemas/Balance"
36
+ }
37
+ }
38
+ },
39
+ "description": ""
40
+ }
41
+ },
42
+ "x-async-capable": false
43
+ }
44
+ },
45
+ "/cfg/payments/currencies/": {
46
+ "get": {
47
+ "operationId": "cfg_payments_currencies_list",
48
+ "description": "Returns list of available currencies with token+network info",
49
+ "summary": "Get available currencies",
50
+ "tags": [
51
+ "payments"
52
+ ],
53
+ "security": [
54
+ {
55
+ "jwtAuthWithLastLogin": []
56
+ }
57
+ ],
58
+ "responses": {
59
+ "200": {
60
+ "content": {
61
+ "application/json": {
62
+ "schema": {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "#/components/schemas/Currency"
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "description": ""
71
+ }
72
+ },
73
+ "x-async-capable": false
74
+ }
75
+ },
76
+ "/cfg/payments/payments/": {
77
+ "get": {
78
+ "operationId": "cfg_payments_payments_list",
79
+ "description": "ViewSet for payment operations.\n\nEndpoints:\n- GET /payments/ - List user's payments\n- GET /payments/{id}/ - Get payment details\n- POST /payments/create/ - Create new payment\n- GET /payments/{id}/status/ - Check payment status\n- POST /payments/{id}/confirm/ - Confirm payment",
80
+ "parameters": [
81
+ {
82
+ "name": "page",
83
+ "required": false,
84
+ "in": "query",
85
+ "description": "A page number within the paginated result set.",
86
+ "schema": {
87
+ "type": "integer"
88
+ }
89
+ },
90
+ {
91
+ "name": "page_size",
92
+ "required": false,
93
+ "in": "query",
94
+ "description": "Number of results to return per page.",
95
+ "schema": {
96
+ "type": "integer"
97
+ }
98
+ }
99
+ ],
100
+ "tags": [
101
+ "payments"
102
+ ],
103
+ "security": [
104
+ {
105
+ "jwtAuthWithLastLogin": []
106
+ }
107
+ ],
108
+ "responses": {
109
+ "200": {
110
+ "content": {
111
+ "application/json": {
112
+ "schema": {
113
+ "$ref": "#/components/schemas/PaginatedPaymentListList"
114
+ }
115
+ }
116
+ },
117
+ "description": ""
118
+ }
119
+ },
120
+ "x-async-capable": false
121
+ }
122
+ },
123
+ "/cfg/payments/payments/{id}/": {
124
+ "get": {
125
+ "operationId": "cfg_payments_payments_retrieve",
126
+ "description": "ViewSet for payment operations.\n\nEndpoints:\n- GET /payments/ - List user's payments\n- GET /payments/{id}/ - Get payment details\n- POST /payments/create/ - Create new payment\n- GET /payments/{id}/status/ - Check payment status\n- POST /payments/{id}/confirm/ - Confirm payment",
127
+ "parameters": [
128
+ {
129
+ "in": "path",
130
+ "name": "id",
131
+ "schema": {
132
+ "type": "string"
133
+ },
134
+ "required": true
135
+ }
136
+ ],
137
+ "tags": [
138
+ "payments"
139
+ ],
140
+ "security": [
141
+ {
142
+ "jwtAuthWithLastLogin": []
143
+ }
144
+ ],
145
+ "responses": {
146
+ "200": {
147
+ "content": {
148
+ "application/json": {
149
+ "schema": {
150
+ "$ref": "#/components/schemas/PaymentDetail"
151
+ }
152
+ }
153
+ },
154
+ "description": ""
155
+ }
156
+ },
157
+ "x-async-capable": false
158
+ }
159
+ },
160
+ "/cfg/payments/payments/{id}/confirm/": {
161
+ "post": {
162
+ "operationId": "cfg_payments_payments_confirm_create",
163
+ "description": "POST /api/v1/payments/{id}/confirm/\n\nConfirm payment (user clicked \"I have paid\").\nChecks status with provider and creates transaction if completed.",
164
+ "parameters": [
165
+ {
166
+ "in": "path",
167
+ "name": "id",
168
+ "schema": {
169
+ "type": "string"
170
+ },
171
+ "required": true
172
+ }
173
+ ],
174
+ "tags": [
175
+ "payments"
176
+ ],
177
+ "security": [
178
+ {
179
+ "jwtAuthWithLastLogin": []
180
+ }
181
+ ],
182
+ "responses": {
183
+ "200": {
184
+ "content": {
185
+ "application/json": {
186
+ "schema": {
187
+ "$ref": "#/components/schemas/PaymentList"
188
+ }
189
+ }
190
+ },
191
+ "description": ""
192
+ }
193
+ },
194
+ "x-async-capable": false
195
+ }
196
+ },
197
+ "/cfg/payments/payments/{id}/status/": {
198
+ "get": {
199
+ "operationId": "cfg_payments_payments_status_retrieve",
200
+ "description": "GET /api/v1/payments/{id}/status/?refresh=true\n\nCheck payment status (with optional refresh from provider).\n\nQuery params:\n- refresh: boolean (default: false) - Force refresh from provider",
201
+ "parameters": [
202
+ {
203
+ "in": "path",
204
+ "name": "id",
205
+ "schema": {
206
+ "type": "string"
207
+ },
208
+ "required": true
209
+ }
210
+ ],
211
+ "tags": [
212
+ "payments"
213
+ ],
214
+ "security": [
215
+ {
216
+ "jwtAuthWithLastLogin": []
217
+ }
218
+ ],
219
+ "responses": {
220
+ "200": {
221
+ "content": {
222
+ "application/json": {
223
+ "schema": {
224
+ "$ref": "#/components/schemas/PaymentList"
225
+ }
226
+ }
227
+ },
228
+ "description": ""
229
+ }
230
+ },
231
+ "x-async-capable": false
232
+ }
233
+ },
234
+ "/cfg/payments/payments/create/": {
235
+ "post": {
236
+ "operationId": "cfg_payments_payments_create_create",
237
+ "description": "POST /api/v1/payments/create/\n\nCreate new payment.\n\nRequest body:\n{\n \"amount_usd\": \"100.00\",\n \"currency_code\": \"USDTTRC20\",\n \"description\": \"Optional description\"\n}",
238
+ "tags": [
239
+ "payments"
240
+ ],
241
+ "security": [
242
+ {
243
+ "jwtAuthWithLastLogin": []
244
+ }
245
+ ],
246
+ "responses": {
247
+ "200": {
248
+ "content": {
249
+ "application/json": {
250
+ "schema": {
251
+ "$ref": "#/components/schemas/PaymentList"
252
+ }
253
+ }
254
+ },
255
+ "description": ""
256
+ }
257
+ },
258
+ "x-async-capable": false
259
+ }
260
+ },
261
+ "/cfg/payments/transactions/": {
262
+ "get": {
263
+ "operationId": "cfg_payments_transactions_list",
264
+ "description": "Get user transactions with pagination and filtering",
265
+ "summary": "Get user transactions",
266
+ "parameters": [
267
+ {
268
+ "in": "query",
269
+ "name": "limit",
270
+ "schema": {
271
+ "type": "integer"
272
+ },
273
+ "description": "Number of transactions to return (max 100)"
274
+ },
275
+ {
276
+ "in": "query",
277
+ "name": "offset",
278
+ "schema": {
279
+ "type": "integer"
280
+ },
281
+ "description": "Offset for pagination"
282
+ },
283
+ {
284
+ "in": "query",
285
+ "name": "type",
286
+ "schema": {
287
+ "type": "string"
288
+ },
289
+ "description": "Filter by transaction type (deposit/withdrawal)"
290
+ }
291
+ ],
292
+ "tags": [
293
+ "payments"
294
+ ],
295
+ "security": [
296
+ {
297
+ "jwtAuthWithLastLogin": []
298
+ }
299
+ ],
300
+ "responses": {
301
+ "200": {
302
+ "content": {
303
+ "application/json": {
304
+ "schema": {
305
+ "type": "array",
306
+ "items": {
307
+ "$ref": "#/components/schemas/Transaction"
308
+ }
309
+ }
310
+ }
311
+ },
312
+ "description": ""
313
+ }
314
+ },
315
+ "x-async-capable": false
316
+ }
317
+ }
318
+ },
319
+ "components": {
320
+ "schemas": {
321
+ "Balance": {
322
+ "type": "object",
323
+ "description": "User balance serializer.",
324
+ "properties": {
325
+ "balance_usd": {
326
+ "type": "string",
327
+ "format": "decimal",
328
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
329
+ "readOnly": true,
330
+ "description": "Current balance in USD"
331
+ },
332
+ "balance_display": {
333
+ "type": "string",
334
+ "readOnly": true
335
+ },
336
+ "total_deposited": {
337
+ "type": "string",
338
+ "format": "decimal",
339
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
340
+ "readOnly": true,
341
+ "description": "Total amount deposited (lifetime)"
342
+ },
343
+ "total_withdrawn": {
344
+ "type": "string",
345
+ "format": "decimal",
346
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
347
+ "readOnly": true,
348
+ "description": "Total amount withdrawn (lifetime)"
349
+ },
350
+ "last_transaction_at": {
351
+ "type": "string",
352
+ "format": "date-time",
353
+ "readOnly": true,
354
+ "nullable": true,
355
+ "description": "When the last transaction occurred"
356
+ }
357
+ },
358
+ "required": [
359
+ "balance_display",
360
+ "balance_usd",
361
+ "last_transaction_at",
362
+ "total_deposited",
363
+ "total_withdrawn"
364
+ ]
365
+ },
366
+ "Currency": {
367
+ "type": "object",
368
+ "description": "Currency list serializer.",
369
+ "properties": {
370
+ "code": {
371
+ "type": "string",
372
+ "readOnly": true,
373
+ "description": "Currency code from provider (e.g., USDTTRC20, BTC, ETH)"
374
+ },
375
+ "name": {
376
+ "type": "string",
377
+ "readOnly": true,
378
+ "description": "Full currency name (e.g., USDT (TRC20), Bitcoin)"
379
+ },
380
+ "token": {
381
+ "type": "string",
382
+ "readOnly": true,
383
+ "description": "Token symbol (e.g., USDT, BTC, ETH)"
384
+ },
385
+ "network": {
386
+ "type": "string",
387
+ "readOnly": true,
388
+ "nullable": true,
389
+ "description": "Network name (e.g., TRC20, ERC20, Bitcoin)"
390
+ },
391
+ "display_name": {
392
+ "type": "string",
393
+ "readOnly": true
394
+ },
395
+ "symbol": {
396
+ "type": "string",
397
+ "readOnly": true,
398
+ "description": "Currency symbol (e.g., ₮, ₿, Ξ)"
399
+ },
400
+ "decimal_places": {
401
+ "type": "integer",
402
+ "readOnly": true,
403
+ "description": "Number of decimal places for this currency"
404
+ },
405
+ "is_active": {
406
+ "type": "boolean",
407
+ "readOnly": true,
408
+ "description": "Whether this currency is available for payments"
409
+ },
410
+ "min_amount_usd": {
411
+ "type": "string",
412
+ "format": "decimal",
413
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
414
+ "readOnly": true,
415
+ "description": "Minimum payment amount in USD"
416
+ },
417
+ "sort_order": {
418
+ "type": "integer",
419
+ "readOnly": true,
420
+ "description": "Sort order for currency list (lower = higher priority)"
421
+ }
422
+ },
423
+ "required": [
424
+ "code",
425
+ "decimal_places",
426
+ "display_name",
427
+ "is_active",
428
+ "min_amount_usd",
429
+ "name",
430
+ "network",
431
+ "sort_order",
432
+ "symbol",
433
+ "token"
434
+ ]
435
+ },
436
+ "PaginatedPaymentListList": {
437
+ "type": "object",
438
+ "required": [
439
+ "count",
440
+ "page",
441
+ "pages",
442
+ "page_size",
443
+ "has_next",
444
+ "has_previous",
445
+ "results"
446
+ ],
447
+ "properties": {
448
+ "count": {
449
+ "type": "integer",
450
+ "description": "Total number of items across all pages",
451
+ "example": 150
452
+ },
453
+ "page": {
454
+ "type": "integer",
455
+ "description": "Current page number (1-based)",
456
+ "example": 2
457
+ },
458
+ "pages": {
459
+ "type": "integer",
460
+ "description": "Total number of pages",
461
+ "example": 15
462
+ },
463
+ "page_size": {
464
+ "type": "integer",
465
+ "description": "Number of items per page",
466
+ "example": 10
467
+ },
468
+ "has_next": {
469
+ "type": "boolean",
470
+ "description": "Whether there is a next page",
471
+ "example": true
472
+ },
473
+ "has_previous": {
474
+ "type": "boolean",
475
+ "description": "Whether there is a previous page",
476
+ "example": true
477
+ },
478
+ "next_page": {
479
+ "type": "integer",
480
+ "nullable": true,
481
+ "description": "Next page number (null if no next page)",
482
+ "example": 3
483
+ },
484
+ "previous_page": {
485
+ "type": "integer",
486
+ "nullable": true,
487
+ "description": "Previous page number (null if no previous page)",
488
+ "example": 1
489
+ },
490
+ "results": {
491
+ "type": "array",
492
+ "items": {
493
+ "$ref": "#/components/schemas/PaymentList"
494
+ },
495
+ "description": "Array of items for current page"
496
+ }
497
+ }
498
+ },
499
+ "PaymentDetail": {
500
+ "type": "object",
501
+ "description": "Detailed payment information.",
502
+ "properties": {
503
+ "id": {
504
+ "type": "string",
505
+ "format": "uuid",
506
+ "readOnly": true,
507
+ "description": "Unique identifier for this record"
508
+ },
509
+ "internal_payment_id": {
510
+ "type": "string",
511
+ "readOnly": true,
512
+ "description": "Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID)"
513
+ },
514
+ "amount_usd": {
515
+ "type": "string",
516
+ "format": "decimal",
517
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
518
+ "readOnly": true,
519
+ "description": "Payment amount in USD"
520
+ },
521
+ "currency_code": {
522
+ "type": "string",
523
+ "readOnly": true
524
+ },
525
+ "currency_name": {
526
+ "type": "string",
527
+ "readOnly": true
528
+ },
529
+ "currency_token": {
530
+ "type": "string",
531
+ "readOnly": true
532
+ },
533
+ "currency_network": {
534
+ "type": "string",
535
+ "readOnly": true
536
+ },
537
+ "pay_amount": {
538
+ "type": "string",
539
+ "format": "decimal",
540
+ "pattern": "^-?\\d{0,12}(?:\\.\\d{0,8})?$",
541
+ "readOnly": true,
542
+ "nullable": true,
543
+ "description": "Amount to pay in cryptocurrency"
544
+ },
545
+ "actual_amount": {
546
+ "type": "string",
547
+ "format": "decimal",
548
+ "pattern": "^-?\\d{0,12}(?:\\.\\d{0,8})?$",
549
+ "readOnly": true,
550
+ "nullable": true,
551
+ "description": "Actual amount received in cryptocurrency"
552
+ },
553
+ "actual_amount_usd": {
554
+ "type": "string",
555
+ "format": "decimal",
556
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
557
+ "readOnly": true,
558
+ "nullable": true,
559
+ "description": "Actual amount received in USD"
560
+ },
561
+ "status": {
562
+ "enum": [
563
+ "pending",
564
+ "confirming",
565
+ "confirmed",
566
+ "completed",
567
+ "partially_paid",
568
+ "failed",
569
+ "expired",
570
+ "cancelled"
571
+ ],
572
+ "type": "string",
573
+ "x-spec-enum-id": "19926dfeb2f474a4",
574
+ "readOnly": true,
575
+ "description": "Current payment status\n\n* `pending` - Pending\n* `confirming` - Confirming\n* `confirmed` - Confirmed\n* `completed` - Completed\n* `partially_paid` - Partially Paid\n* `failed` - Failed\n* `expired` - Expired\n* `cancelled` - Cancelled"
576
+ },
577
+ "status_display": {
578
+ "type": "string",
579
+ "readOnly": true
580
+ },
581
+ "pay_address": {
582
+ "type": "string",
583
+ "readOnly": true,
584
+ "nullable": true,
585
+ "description": "Cryptocurrency payment address"
586
+ },
587
+ "qr_code_url": {
588
+ "type": "string",
589
+ "nullable": true,
590
+ "description": "Get QR code URL.",
591
+ "readOnly": true
592
+ },
593
+ "payment_url": {
594
+ "type": "string",
595
+ "format": "uri",
596
+ "readOnly": true,
597
+ "nullable": true,
598
+ "description": "Payment page URL (if provided by provider)"
599
+ },
600
+ "transaction_hash": {
601
+ "type": "string",
602
+ "readOnly": true,
603
+ "nullable": true,
604
+ "description": "Blockchain transaction hash"
605
+ },
606
+ "explorer_link": {
607
+ "type": "string",
608
+ "nullable": true,
609
+ "description": "Get blockchain explorer link.",
610
+ "readOnly": true
611
+ },
612
+ "confirmations_count": {
613
+ "type": "integer",
614
+ "readOnly": true,
615
+ "description": "Number of blockchain confirmations"
616
+ },
617
+ "expires_at": {
618
+ "type": "string",
619
+ "format": "date-time",
620
+ "readOnly": true,
621
+ "nullable": true,
622
+ "description": "When this payment expires (typically 30 minutes)"
623
+ },
624
+ "completed_at": {
625
+ "type": "string",
626
+ "format": "date-time",
627
+ "readOnly": true,
628
+ "nullable": true,
629
+ "description": "When this payment was completed"
630
+ },
631
+ "created_at": {
632
+ "type": "string",
633
+ "format": "date-time",
634
+ "readOnly": true,
635
+ "description": "When this record was created"
636
+ },
637
+ "is_completed": {
638
+ "type": "boolean",
639
+ "readOnly": true
640
+ },
641
+ "is_failed": {
642
+ "type": "boolean",
643
+ "readOnly": true
644
+ },
645
+ "is_expired": {
646
+ "type": "boolean",
647
+ "readOnly": true
648
+ },
649
+ "description": {
650
+ "type": "string",
651
+ "readOnly": true,
652
+ "description": "Payment description"
653
+ }
654
+ },
655
+ "required": [
656
+ "actual_amount",
657
+ "actual_amount_usd",
658
+ "amount_usd",
659
+ "completed_at",
660
+ "confirmations_count",
661
+ "created_at",
662
+ "currency_code",
663
+ "currency_name",
664
+ "currency_network",
665
+ "currency_token",
666
+ "description",
667
+ "expires_at",
668
+ "explorer_link",
669
+ "id",
670
+ "internal_payment_id",
671
+ "is_completed",
672
+ "is_expired",
673
+ "is_failed",
674
+ "pay_address",
675
+ "pay_amount",
676
+ "payment_url",
677
+ "qr_code_url",
678
+ "status",
679
+ "status_display",
680
+ "transaction_hash"
681
+ ]
682
+ },
683
+ "PaymentList": {
684
+ "type": "object",
685
+ "description": "Payment list item (lighter than detail).",
686
+ "properties": {
687
+ "id": {
688
+ "type": "string",
689
+ "format": "uuid",
690
+ "readOnly": true,
691
+ "description": "Unique identifier for this record"
692
+ },
693
+ "internal_payment_id": {
694
+ "type": "string",
695
+ "readOnly": true,
696
+ "description": "Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID)"
697
+ },
698
+ "amount_usd": {
699
+ "type": "string",
700
+ "format": "decimal",
701
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
702
+ "readOnly": true,
703
+ "description": "Payment amount in USD"
704
+ },
705
+ "currency_code": {
706
+ "type": "string",
707
+ "readOnly": true
708
+ },
709
+ "currency_token": {
710
+ "type": "string",
711
+ "readOnly": true
712
+ },
713
+ "status": {
714
+ "enum": [
715
+ "pending",
716
+ "confirming",
717
+ "confirmed",
718
+ "completed",
719
+ "partially_paid",
720
+ "failed",
721
+ "expired",
722
+ "cancelled"
723
+ ],
724
+ "type": "string",
725
+ "x-spec-enum-id": "19926dfeb2f474a4",
726
+ "readOnly": true,
727
+ "description": "Current payment status\n\n* `pending` - Pending\n* `confirming` - Confirming\n* `confirmed` - Confirmed\n* `completed` - Completed\n* `partially_paid` - Partially Paid\n* `failed` - Failed\n* `expired` - Expired\n* `cancelled` - Cancelled"
728
+ },
729
+ "status_display": {
730
+ "type": "string",
731
+ "readOnly": true
732
+ },
733
+ "created_at": {
734
+ "type": "string",
735
+ "format": "date-time",
736
+ "readOnly": true,
737
+ "description": "When this record was created"
738
+ },
739
+ "completed_at": {
740
+ "type": "string",
741
+ "format": "date-time",
742
+ "readOnly": true,
743
+ "nullable": true,
744
+ "description": "When this payment was completed"
745
+ }
746
+ },
747
+ "required": [
748
+ "amount_usd",
749
+ "completed_at",
750
+ "created_at",
751
+ "currency_code",
752
+ "currency_token",
753
+ "id",
754
+ "internal_payment_id",
755
+ "status",
756
+ "status_display"
757
+ ]
758
+ },
759
+ "Transaction": {
760
+ "type": "object",
761
+ "description": "Transaction serializer.",
762
+ "properties": {
763
+ "id": {
764
+ "type": "string",
765
+ "format": "uuid",
766
+ "readOnly": true,
767
+ "description": "Unique identifier for this record"
768
+ },
769
+ "transaction_type": {
770
+ "enum": [
771
+ "deposit",
772
+ "withdrawal",
773
+ "payment",
774
+ "refund",
775
+ "fee",
776
+ "bonus",
777
+ "adjustment"
778
+ ],
779
+ "type": "string",
780
+ "x-spec-enum-id": "1089b7b698dd0a5e",
781
+ "readOnly": true,
782
+ "description": "Type of transaction\n\n* `deposit` - Deposit\n* `withdrawal` - Withdrawal\n* `payment` - Payment\n* `refund` - Refund\n* `fee` - Fee\n* `bonus` - Bonus\n* `adjustment` - Adjustment"
783
+ },
784
+ "type_display": {
785
+ "type": "string",
786
+ "readOnly": true
787
+ },
788
+ "amount_usd": {
789
+ "type": "string",
790
+ "format": "decimal",
791
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
792
+ "readOnly": true,
793
+ "description": "Transaction amount in USD (positive=credit, negative=debit)"
794
+ },
795
+ "amount_display": {
796
+ "type": "string",
797
+ "readOnly": true
798
+ },
799
+ "balance_after": {
800
+ "type": "string",
801
+ "format": "decimal",
802
+ "pattern": "^-?\\d{0,8}(?:\\.\\d{0,2})?$",
803
+ "readOnly": true,
804
+ "description": "User balance after this transaction"
805
+ },
806
+ "payment_id": {
807
+ "type": "string",
808
+ "readOnly": true,
809
+ "nullable": true,
810
+ "description": "Related payment ID (if applicable)"
811
+ },
812
+ "description": {
813
+ "type": "string",
814
+ "readOnly": true,
815
+ "description": "Transaction description"
816
+ },
817
+ "created_at": {
818
+ "type": "string",
819
+ "format": "date-time",
820
+ "readOnly": true,
821
+ "description": "When this record was created"
822
+ }
823
+ },
824
+ "required": [
825
+ "amount_display",
826
+ "amount_usd",
827
+ "balance_after",
828
+ "created_at",
829
+ "description",
830
+ "id",
831
+ "payment_id",
832
+ "transaction_type",
833
+ "type_display"
834
+ ]
835
+ }
836
+ },
837
+ "securitySchemes": {
838
+ "jwtAuthWithLastLogin": {
839
+ "type": "http",
840
+ "scheme": "bearer",
841
+ "bearerFormat": "JWT"
842
+ }
843
+ }
844
+ },
845
+ "servers": [
846
+ {
847
+ "url": "http://localhost:8000"
848
+ }
849
+ ]
850
+ }