svc-infra 0.1.581__py3-none-any.whl → 0.1.583__py3-none-any.whl
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.
Potentially problematic release.
This version of svc-infra might be problematic. Click here for more details.
- svc_infra/api/fastapi/apf_payments/router.py +76 -24
- {svc_infra-0.1.581.dist-info → svc_infra-0.1.583.dist-info}/METADATA +1 -1
- {svc_infra-0.1.581.dist-info → svc_infra-0.1.583.dist-info}/RECORD +5 -5
- {svc_infra-0.1.581.dist-info → svc_infra-0.1.583.dist-info}/WHEEL +0 -0
- {svc_infra-0.1.581.dist-info → svc_infra-0.1.583.dist-info}/entry_points.txt +0 -0
|
@@ -80,23 +80,27 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
80
80
|
svc = service_router(prefix=prefix, tags=["payments"])
|
|
81
81
|
prot = protected_router(prefix=prefix, tags=["payments"])
|
|
82
82
|
|
|
83
|
+
# ===== Customers =====
|
|
83
84
|
@user.post(
|
|
84
85
|
"/customers",
|
|
85
86
|
response_model=CustomerOut,
|
|
86
87
|
name="payments_upsert_customer",
|
|
87
88
|
dependencies=[Depends(require_idempotency_key)],
|
|
89
|
+
tags=["Customers"],
|
|
88
90
|
)
|
|
89
91
|
async def upsert_customer(data: CustomerUpsertIn, svc: PaymentsService = Depends(get_service)):
|
|
90
92
|
out = await svc.ensure_customer(data)
|
|
91
93
|
await svc.session.flush()
|
|
92
94
|
return out
|
|
93
95
|
|
|
96
|
+
# ===== Payment Intents (create) =====
|
|
94
97
|
@user.post(
|
|
95
98
|
"/intents",
|
|
96
99
|
response_model=IntentOut,
|
|
97
100
|
name="payments_create_intent",
|
|
98
101
|
status_code=status.HTTP_201_CREATED,
|
|
99
102
|
dependencies=[Depends(require_idempotency_key)],
|
|
103
|
+
tags=["Payment Intents"],
|
|
100
104
|
)
|
|
101
105
|
async def create_intent(
|
|
102
106
|
data: IntentCreateIn,
|
|
@@ -113,11 +117,13 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
113
117
|
|
|
114
118
|
routers.append(user)
|
|
115
119
|
|
|
120
|
+
# ===== Payment Intents (confirm/cancel/refund/list/get/capture/resume) =====
|
|
116
121
|
@prot.post(
|
|
117
122
|
"/intents/{provider_intent_id}/confirm",
|
|
118
123
|
response_model=IntentOut,
|
|
119
124
|
name="payments_confirm_intent",
|
|
120
125
|
dependencies=[Depends(require_idempotency_key)],
|
|
126
|
+
tags=["Payment Intents"],
|
|
121
127
|
)
|
|
122
128
|
async def confirm_intent(provider_intent_id: str, svc: PaymentsService = Depends(get_service)):
|
|
123
129
|
out = await svc.confirm_intent(provider_intent_id)
|
|
@@ -129,6 +135,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
129
135
|
response_model=IntentOut,
|
|
130
136
|
name="payments_cancel_intent",
|
|
131
137
|
dependencies=[Depends(require_idempotency_key)],
|
|
138
|
+
tags=["Payment Intents"],
|
|
132
139
|
)
|
|
133
140
|
async def cancel_intent(provider_intent_id: str, svc: PaymentsService = Depends(get_service)):
|
|
134
141
|
out = await svc.cancel_intent(provider_intent_id)
|
|
@@ -140,6 +147,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
140
147
|
response_model=IntentOut,
|
|
141
148
|
name="payments_refund_intent",
|
|
142
149
|
dependencies=[Depends(require_idempotency_key)],
|
|
150
|
+
tags=["Payment Intents", "Refunds"],
|
|
143
151
|
)
|
|
144
152
|
async def refund_intent(
|
|
145
153
|
provider_intent_id: str, data: RefundIn, svc: PaymentsService = Depends(get_service)
|
|
@@ -153,6 +161,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
153
161
|
response_model=Paginated[TransactionRow],
|
|
154
162
|
name="payments_list_transactions",
|
|
155
163
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
164
|
+
tags=["Transactions"],
|
|
156
165
|
)
|
|
157
166
|
async def list_transactions(svc: PaymentsService = Depends(get_service)):
|
|
158
167
|
from sqlalchemy import select
|
|
@@ -196,6 +205,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
196
205
|
"/webhooks/{provider}",
|
|
197
206
|
name="payments_webhook",
|
|
198
207
|
response_model=WebhookAckOut,
|
|
208
|
+
tags=["Webhooks"],
|
|
199
209
|
)
|
|
200
210
|
async def webhooks(
|
|
201
211
|
provider: str,
|
|
@@ -208,12 +218,14 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
208
218
|
await svc.session.flush()
|
|
209
219
|
return JSONResponse(out)
|
|
210
220
|
|
|
221
|
+
# ===== Payment Methods (attach/list/detach/default/get/update/delete alias) =====
|
|
211
222
|
@user.post(
|
|
212
223
|
"/methods/attach",
|
|
213
224
|
response_model=PaymentMethodOut,
|
|
214
225
|
name="payments_attach_method",
|
|
215
226
|
status_code=status.HTTP_201_CREATED,
|
|
216
227
|
dependencies=[Depends(require_idempotency_key)],
|
|
228
|
+
tags=["Payment Methods"],
|
|
217
229
|
)
|
|
218
230
|
async def attach_method(
|
|
219
231
|
data: PaymentMethodAttachIn, svc: PaymentsService = Depends(get_service)
|
|
@@ -227,6 +239,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
227
239
|
response_model=Paginated[PaymentMethodOut],
|
|
228
240
|
name="payments_list_methods",
|
|
229
241
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
242
|
+
tags=["Payment Methods"],
|
|
230
243
|
)
|
|
231
244
|
async def list_methods(
|
|
232
245
|
customer_provider_id: str,
|
|
@@ -253,6 +266,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
253
266
|
name="payments_detach_method",
|
|
254
267
|
response_model=PaymentMethodOut,
|
|
255
268
|
dependencies=[Depends(require_idempotency_key)],
|
|
269
|
+
tags=["Payment Methods"],
|
|
256
270
|
)
|
|
257
271
|
async def detach_method(provider_method_id: str, svc: PaymentsService = Depends(get_service)):
|
|
258
272
|
out = await svc.detach_payment_method(provider_method_id)
|
|
@@ -264,6 +278,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
264
278
|
name="payments_set_default_method",
|
|
265
279
|
response_model=PaymentMethodOut, # ADD
|
|
266
280
|
dependencies=[Depends(require_idempotency_key)],
|
|
281
|
+
tags=["Payment Methods"],
|
|
267
282
|
)
|
|
268
283
|
async def set_default_method(
|
|
269
284
|
provider_method_id: str,
|
|
@@ -281,6 +296,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
281
296
|
name="payments_create_product",
|
|
282
297
|
status_code=status.HTTP_201_CREATED,
|
|
283
298
|
dependencies=[Depends(require_idempotency_key)],
|
|
299
|
+
tags=["Products"],
|
|
284
300
|
)
|
|
285
301
|
async def create_product(data: ProductCreateIn, svc: PaymentsService = Depends(get_service)):
|
|
286
302
|
out = await svc.create_product(data)
|
|
@@ -293,6 +309,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
293
309
|
name="payments_create_price",
|
|
294
310
|
status_code=status.HTTP_201_CREATED,
|
|
295
311
|
dependencies=[Depends(require_idempotency_key)],
|
|
312
|
+
tags=["Prices"],
|
|
296
313
|
)
|
|
297
314
|
async def create_price(data: PriceCreateIn, svc: PaymentsService = Depends(get_service)):
|
|
298
315
|
out = await svc.create_price(data)
|
|
@@ -306,6 +323,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
306
323
|
name="payments_create_subscription",
|
|
307
324
|
status_code=status.HTTP_201_CREATED,
|
|
308
325
|
dependencies=[Depends(require_idempotency_key)],
|
|
326
|
+
tags=["Subscriptions"],
|
|
309
327
|
)
|
|
310
328
|
async def create_subscription(
|
|
311
329
|
data: SubscriptionCreateIn, svc: PaymentsService = Depends(get_service)
|
|
@@ -319,6 +337,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
319
337
|
response_model=SubscriptionOut,
|
|
320
338
|
name="payments_update_subscription",
|
|
321
339
|
dependencies=[Depends(require_idempotency_key)],
|
|
340
|
+
tags=["Subscriptions"],
|
|
322
341
|
)
|
|
323
342
|
async def update_subscription(
|
|
324
343
|
provider_subscription_id: str,
|
|
@@ -334,6 +353,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
334
353
|
response_model=SubscriptionOut,
|
|
335
354
|
name="payments_cancel_subscription",
|
|
336
355
|
dependencies=[Depends(require_idempotency_key)],
|
|
356
|
+
tags=["Subscriptions"],
|
|
337
357
|
)
|
|
338
358
|
async def cancel_subscription(
|
|
339
359
|
provider_subscription_id: str,
|
|
@@ -351,6 +371,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
351
371
|
name="payments_create_invoice",
|
|
352
372
|
status_code=status.HTTP_201_CREATED,
|
|
353
373
|
dependencies=[Depends(require_idempotency_key)],
|
|
374
|
+
tags=["Invoices"],
|
|
354
375
|
)
|
|
355
376
|
async def create_invoice(
|
|
356
377
|
data: InvoiceCreateIn,
|
|
@@ -370,6 +391,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
370
391
|
response_model=InvoiceOut,
|
|
371
392
|
name="payments_finalize_invoice",
|
|
372
393
|
dependencies=[Depends(require_idempotency_key)],
|
|
394
|
+
tags=["Invoices"],
|
|
373
395
|
)
|
|
374
396
|
async def finalize_invoice(
|
|
375
397
|
provider_invoice_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -383,6 +405,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
383
405
|
response_model=InvoiceOut,
|
|
384
406
|
name="payments_void_invoice",
|
|
385
407
|
dependencies=[Depends(require_idempotency_key)],
|
|
408
|
+
tags=["Invoices"],
|
|
386
409
|
)
|
|
387
410
|
async def void_invoice(provider_invoice_id: str, svc: PaymentsService = Depends(get_service)):
|
|
388
411
|
out = await svc.void_invoice(provider_invoice_id)
|
|
@@ -394,6 +417,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
394
417
|
response_model=InvoiceOut,
|
|
395
418
|
name="payments_pay_invoice",
|
|
396
419
|
dependencies=[Depends(require_idempotency_key)],
|
|
420
|
+
tags=["Invoices"],
|
|
397
421
|
)
|
|
398
422
|
async def pay_invoice(provider_invoice_id: str, svc: PaymentsService = Depends(get_service)):
|
|
399
423
|
out = await svc.pay_invoice(provider_invoice_id)
|
|
@@ -401,13 +425,21 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
401
425
|
return out
|
|
402
426
|
|
|
403
427
|
# INTENTS: get/hydrate
|
|
404
|
-
@prot.get(
|
|
428
|
+
@prot.get(
|
|
429
|
+
"/intents/{provider_intent_id}",
|
|
430
|
+
response_model=IntentOut,
|
|
431
|
+
name="payments_get_intent",
|
|
432
|
+
tags=["Payment Intents"],
|
|
433
|
+
)
|
|
405
434
|
async def get_intent(provider_intent_id: str, svc: PaymentsService = Depends(get_service)):
|
|
406
435
|
return await svc.get_intent(provider_intent_id)
|
|
407
436
|
|
|
408
437
|
# STATEMENTS (rollup)
|
|
409
438
|
@svc.get(
|
|
410
|
-
"/statements/daily",
|
|
439
|
+
"/statements/daily",
|
|
440
|
+
response_model=list[StatementRow],
|
|
441
|
+
name="payments_daily_statements",
|
|
442
|
+
tags=["Statements"],
|
|
411
443
|
)
|
|
412
444
|
async def daily_statements(
|
|
413
445
|
date_from: str | None = None,
|
|
@@ -422,6 +454,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
422
454
|
response_model=IntentOut,
|
|
423
455
|
name="payments_capture_intent",
|
|
424
456
|
dependencies=[Depends(require_idempotency_key)],
|
|
457
|
+
tags=["Payment Intents"],
|
|
425
458
|
)
|
|
426
459
|
async def capture_intent(
|
|
427
460
|
provider_intent_id: str,
|
|
@@ -437,6 +470,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
437
470
|
response_model=Paginated[IntentOut],
|
|
438
471
|
name="payments_list_intents",
|
|
439
472
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
473
|
+
tags=["Payment Intents"],
|
|
440
474
|
)
|
|
441
475
|
async def list_intents_endpoint(
|
|
442
476
|
customer_provider_id: Optional[str] = None,
|
|
@@ -461,6 +495,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
461
495
|
status_code=status.HTTP_201_CREATED,
|
|
462
496
|
response_model=InvoiceOut,
|
|
463
497
|
dependencies=[Depends(require_idempotency_key)],
|
|
498
|
+
tags=["Invoices"],
|
|
464
499
|
)
|
|
465
500
|
async def add_invoice_line(
|
|
466
501
|
provider_invoice_id: str,
|
|
@@ -476,6 +511,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
476
511
|
response_model=Paginated[InvoiceOut],
|
|
477
512
|
name="payments_list_invoices",
|
|
478
513
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
514
|
+
tags=["Invoices"],
|
|
479
515
|
)
|
|
480
516
|
async def list_invoices_endpoint(
|
|
481
517
|
customer_provider_id: Optional[str] = None,
|
|
@@ -494,7 +530,10 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
494
530
|
return ctx.wrap(items, next_cursor=next_cursor)
|
|
495
531
|
|
|
496
532
|
@prot.get(
|
|
497
|
-
"/invoices/{provider_invoice_id}",
|
|
533
|
+
"/invoices/{provider_invoice_id}",
|
|
534
|
+
response_model=InvoiceOut,
|
|
535
|
+
name="payments_get_invoice",
|
|
536
|
+
tags=["Invoices"],
|
|
498
537
|
)
|
|
499
538
|
async def get_invoice_endpoint(
|
|
500
539
|
provider_invoice_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -506,6 +545,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
506
545
|
response_model=InvoiceOut,
|
|
507
546
|
name="payments_preview_invoice",
|
|
508
547
|
dependencies=[Depends(require_idempotency_key)],
|
|
548
|
+
tags=["Invoices"],
|
|
509
549
|
)
|
|
510
550
|
async def preview_invoice_endpoint(
|
|
511
551
|
customer_provider_id: str,
|
|
@@ -521,6 +561,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
521
561
|
status_code=status.HTTP_201_CREATED,
|
|
522
562
|
dependencies=[Depends(require_idempotency_key)],
|
|
523
563
|
response_model=UsageRecordOut,
|
|
564
|
+
tags=["Usage Records"],
|
|
524
565
|
)
|
|
525
566
|
async def create_usage_record_endpoint(
|
|
526
567
|
data: UsageRecordIn, svc: PaymentsService = Depends(get_service)
|
|
@@ -536,6 +577,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
536
577
|
status_code=status.HTTP_201_CREATED,
|
|
537
578
|
response_model=SetupIntentOut,
|
|
538
579
|
dependencies=[Depends(require_idempotency_key)],
|
|
580
|
+
tags=["Setup Intents"],
|
|
539
581
|
)
|
|
540
582
|
async def create_setup_intent(
|
|
541
583
|
data: SetupIntentCreateIn,
|
|
@@ -550,6 +592,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
550
592
|
name="payments_confirm_setup_intent",
|
|
551
593
|
response_model=SetupIntentOut,
|
|
552
594
|
dependencies=[Depends(require_idempotency_key)],
|
|
595
|
+
tags=["Setup Intents"],
|
|
553
596
|
)
|
|
554
597
|
async def confirm_setup_intent(
|
|
555
598
|
provider_setup_intent_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -562,6 +605,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
562
605
|
"/setup_intents/{provider_setup_intent_id}",
|
|
563
606
|
name="payments_get_setup_intent",
|
|
564
607
|
response_model=SetupIntentOut,
|
|
608
|
+
tags=["Setup Intents"],
|
|
565
609
|
)
|
|
566
610
|
async def get_setup_intent(
|
|
567
611
|
provider_setup_intent_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -574,6 +618,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
574
618
|
name="payments_resume_intent",
|
|
575
619
|
response_model=IntentOut,
|
|
576
620
|
dependencies=[Depends(require_idempotency_key)],
|
|
621
|
+
tags=["Payment Intents"],
|
|
577
622
|
)
|
|
578
623
|
async def resume_intent(
|
|
579
624
|
provider_intent_id: str,
|
|
@@ -589,6 +634,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
589
634
|
name="payments_list_disputes",
|
|
590
635
|
response_model=Paginated[DisputeOut],
|
|
591
636
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
637
|
+
tags=["Disputes"],
|
|
592
638
|
)
|
|
593
639
|
async def list_disputes(
|
|
594
640
|
status: Optional[str] = None,
|
|
@@ -604,6 +650,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
604
650
|
"/disputes/{provider_dispute_id}",
|
|
605
651
|
name="payments_get_dispute",
|
|
606
652
|
response_model=DisputeOut,
|
|
653
|
+
tags=["Disputes"],
|
|
607
654
|
)
|
|
608
655
|
async def get_dispute(provider_dispute_id: str, svc: PaymentsService = Depends(get_service)):
|
|
609
656
|
return await svc.get_dispute(provider_dispute_id)
|
|
@@ -613,6 +660,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
613
660
|
name="payments_submit_dispute_evidence",
|
|
614
661
|
dependencies=[Depends(require_idempotency_key)],
|
|
615
662
|
response_model=DisputeOut,
|
|
663
|
+
tags=["Disputes"],
|
|
616
664
|
)
|
|
617
665
|
async def submit_dispute_evidence(
|
|
618
666
|
provider_dispute_id: str,
|
|
@@ -624,7 +672,9 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
624
672
|
return out
|
|
625
673
|
|
|
626
674
|
# ===== Balance & Payouts =====
|
|
627
|
-
@svc.get(
|
|
675
|
+
@svc.get(
|
|
676
|
+
"/balance", name="payments_get_balance", response_model=BalanceSnapshotOut, tags=["Balance"]
|
|
677
|
+
)
|
|
628
678
|
async def get_balance(svc: PaymentsService = Depends(get_service)):
|
|
629
679
|
return await svc.get_balance_snapshot()
|
|
630
680
|
|
|
@@ -633,6 +683,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
633
683
|
name="payments_list_payouts",
|
|
634
684
|
response_model=Paginated[PayoutOut],
|
|
635
685
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
686
|
+
tags=["Payouts"],
|
|
636
687
|
)
|
|
637
688
|
async def list_payouts(svc: PaymentsService = Depends(get_service)):
|
|
638
689
|
ctx = use_pagination()
|
|
@@ -643,6 +694,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
643
694
|
"/payouts/{provider_payout_id}",
|
|
644
695
|
name="payments_get_payout",
|
|
645
696
|
response_model=PayoutOut,
|
|
697
|
+
tags=["Payouts"],
|
|
646
698
|
)
|
|
647
699
|
async def get_payout(provider_payout_id: str, svc: PaymentsService = Depends(get_service)):
|
|
648
700
|
return await svc.get_payout(provider_payout_id)
|
|
@@ -653,6 +705,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
653
705
|
name="payments_replay_webhooks",
|
|
654
706
|
response_model=WebhookReplayOut,
|
|
655
707
|
dependencies=[Depends(require_idempotency_key)],
|
|
708
|
+
tags=["Webhooks"],
|
|
656
709
|
)
|
|
657
710
|
async def replay_webhooks(
|
|
658
711
|
since: Optional[str] = None,
|
|
@@ -670,6 +723,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
670
723
|
response_model=Paginated[CustomerOut],
|
|
671
724
|
name="payments_list_customers",
|
|
672
725
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
726
|
+
tags=["Customers"],
|
|
673
727
|
)
|
|
674
728
|
async def list_customers_endpoint(
|
|
675
729
|
provider: Optional[str] = None,
|
|
@@ -688,6 +742,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
688
742
|
"/customers/{provider_customer_id}",
|
|
689
743
|
response_model=CustomerOut,
|
|
690
744
|
name="payments_get_customer",
|
|
745
|
+
tags=["Customers"],
|
|
691
746
|
)
|
|
692
747
|
async def get_customer_endpoint(
|
|
693
748
|
provider_customer_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -699,6 +754,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
699
754
|
"/methods/{provider_method_id}",
|
|
700
755
|
response_model=PaymentMethodOut,
|
|
701
756
|
name="payments_get_method",
|
|
757
|
+
tags=["Payment Methods"],
|
|
702
758
|
)
|
|
703
759
|
async def get_method(provider_method_id: str, svc: PaymentsService = Depends(get_service)):
|
|
704
760
|
return await svc.get_payment_method(provider_method_id)
|
|
@@ -708,6 +764,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
708
764
|
response_model=PaymentMethodOut,
|
|
709
765
|
name="payments_update_method",
|
|
710
766
|
dependencies=[Depends(require_idempotency_key)],
|
|
767
|
+
tags=["Payment Methods"],
|
|
711
768
|
)
|
|
712
769
|
async def update_method(
|
|
713
770
|
provider_method_id: str,
|
|
@@ -723,6 +780,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
723
780
|
"/products/{provider_product_id}",
|
|
724
781
|
response_model=ProductOut,
|
|
725
782
|
name="payments_get_product",
|
|
783
|
+
tags=["Products"],
|
|
726
784
|
)
|
|
727
785
|
async def get_product_endpoint(
|
|
728
786
|
provider_product_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -734,6 +792,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
734
792
|
response_model=Paginated[ProductOut],
|
|
735
793
|
name="payments_list_products",
|
|
736
794
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
795
|
+
tags=["Products"],
|
|
737
796
|
)
|
|
738
797
|
async def list_products_endpoint(
|
|
739
798
|
active: Optional[bool] = None,
|
|
@@ -750,6 +809,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
750
809
|
response_model=ProductOut,
|
|
751
810
|
name="payments_update_product",
|
|
752
811
|
dependencies=[Depends(require_idempotency_key)],
|
|
812
|
+
tags=["Products"],
|
|
753
813
|
)
|
|
754
814
|
async def update_product_endpoint(
|
|
755
815
|
provider_product_id: str,
|
|
@@ -765,6 +825,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
765
825
|
"/prices/{provider_price_id}",
|
|
766
826
|
response_model=PriceOut,
|
|
767
827
|
name="payments_get_price",
|
|
828
|
+
tags=["Prices"],
|
|
768
829
|
)
|
|
769
830
|
async def get_price_endpoint(
|
|
770
831
|
provider_price_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -776,6 +837,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
776
837
|
response_model=Paginated[PriceOut],
|
|
777
838
|
name="payments_list_prices",
|
|
778
839
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
840
|
+
tags=["Prices"],
|
|
779
841
|
)
|
|
780
842
|
async def list_prices_endpoint(
|
|
781
843
|
provider_product_id: Optional[str] = None,
|
|
@@ -796,6 +858,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
796
858
|
response_model=PriceOut,
|
|
797
859
|
name="payments_update_price",
|
|
798
860
|
dependencies=[Depends(require_idempotency_key)],
|
|
861
|
+
tags=["Prices"],
|
|
799
862
|
)
|
|
800
863
|
async def update_price_endpoint(
|
|
801
864
|
provider_price_id: str,
|
|
@@ -811,6 +874,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
811
874
|
"/subscriptions/{provider_subscription_id}",
|
|
812
875
|
response_model=SubscriptionOut,
|
|
813
876
|
name="payments_get_subscription",
|
|
877
|
+
tags=["Subscriptions"],
|
|
814
878
|
)
|
|
815
879
|
async def get_subscription_endpoint(
|
|
816
880
|
provider_subscription_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -822,6 +886,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
822
886
|
response_model=Paginated[SubscriptionOut],
|
|
823
887
|
name="payments_list_subscriptions",
|
|
824
888
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
889
|
+
tags=["Subscriptions"],
|
|
825
890
|
)
|
|
826
891
|
async def list_subscriptions_endpoint(
|
|
827
892
|
customer_provider_id: Optional[str] = None,
|
|
@@ -843,6 +908,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
843
908
|
response_model=Paginated[InvoiceLineItemOut],
|
|
844
909
|
name="payments_list_invoice_line_items",
|
|
845
910
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
911
|
+
tags=["Invoices"],
|
|
846
912
|
)
|
|
847
913
|
async def list_invoice_lines_endpoint(
|
|
848
914
|
provider_invoice_id: str,
|
|
@@ -860,6 +926,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
860
926
|
response_model=Paginated[RefundOut],
|
|
861
927
|
name="payments_list_refunds",
|
|
862
928
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
929
|
+
tags=["Refunds"],
|
|
863
930
|
)
|
|
864
931
|
async def list_refunds_endpoint(
|
|
865
932
|
provider_payment_intent_id: Optional[str] = None,
|
|
@@ -877,6 +944,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
877
944
|
"/refunds/{provider_refund_id}",
|
|
878
945
|
response_model=RefundOut,
|
|
879
946
|
name="payments_get_refund",
|
|
947
|
+
tags=["Refunds"],
|
|
880
948
|
)
|
|
881
949
|
async def get_refund_endpoint(
|
|
882
950
|
provider_refund_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -889,6 +957,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
889
957
|
response_model=Paginated[UsageRecordOut],
|
|
890
958
|
name="payments_list_usage_records",
|
|
891
959
|
dependencies=[Depends(cursor_pager(default_limit=50, max_limit=200))],
|
|
960
|
+
tags=["Usage Records"],
|
|
892
961
|
)
|
|
893
962
|
async def list_usage_records_endpoint(
|
|
894
963
|
subscription_item: Optional[str] = None,
|
|
@@ -910,6 +979,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
910
979
|
"/usage_records/{usage_record_id}",
|
|
911
980
|
response_model=UsageRecordOut,
|
|
912
981
|
name="payments_get_usage_record",
|
|
982
|
+
tags=["Usage Records"],
|
|
913
983
|
)
|
|
914
984
|
async def get_usage_record_endpoint(
|
|
915
985
|
usage_record_id: str, svc: PaymentsService = Depends(get_service)
|
|
@@ -923,6 +993,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
923
993
|
summary="Delete Invoice Line Item (draft invoices only)",
|
|
924
994
|
response_model=InvoiceOut,
|
|
925
995
|
dependencies=[Depends(require_idempotency_key)],
|
|
996
|
+
tags=["Invoices"],
|
|
926
997
|
)
|
|
927
998
|
async def delete_invoice_line_item_endpoint(
|
|
928
999
|
provider_invoice_id: str,
|
|
@@ -944,6 +1015,7 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
944
1015
|
summary="Remove Method Alias (non-destructive)",
|
|
945
1016
|
response_model=PaymentMethodOut,
|
|
946
1017
|
dependencies=[Depends(require_idempotency_key)],
|
|
1018
|
+
tags=["Payment Methods"],
|
|
947
1019
|
)
|
|
948
1020
|
async def delete_method_alias(alias_id: str, svc: PaymentsService = Depends(get_service)):
|
|
949
1021
|
"""
|
|
@@ -955,26 +1027,6 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
|
|
|
955
1027
|
await svc.session.flush()
|
|
956
1028
|
return out
|
|
957
1029
|
|
|
958
|
-
# --- Back-compat shim (deprecated): keep old path but mark deprecated ---
|
|
959
|
-
@prot.delete(
|
|
960
|
-
"/methods/{provider_method_id}",
|
|
961
|
-
name="payments_delete_method_alias_deprecated",
|
|
962
|
-
summary="(Deprecated) Remove Method Alias — use /method_aliases/{alias_id}",
|
|
963
|
-
deprecated=True,
|
|
964
|
-
response_model=PaymentMethodOut,
|
|
965
|
-
dependencies=[Depends(require_idempotency_key)],
|
|
966
|
-
)
|
|
967
|
-
async def delete_method_alias_deprecated(
|
|
968
|
-
provider_method_id: str, svc: PaymentsService = Depends(get_service)
|
|
969
|
-
):
|
|
970
|
-
"""
|
|
971
|
-
DEPRECATED: use DELETE /method_aliases/{alias_id} instead.
|
|
972
|
-
Non-destructive; only removes local alias/association.
|
|
973
|
-
"""
|
|
974
|
-
out = await svc.detach_payment_method(provider_method_id)
|
|
975
|
-
await svc.session.flush()
|
|
976
|
-
return out
|
|
977
|
-
|
|
978
1030
|
routers.append(svc)
|
|
979
1031
|
routers.append(pub)
|
|
980
1032
|
return routers
|
|
@@ -12,7 +12,7 @@ svc_infra/apf_payments/settings.py,sha256=VnNQbajbv843buUisqa82xOQ-f5JA8JzHD8o01
|
|
|
12
12
|
svc_infra/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
svc_infra/api/fastapi/__init__.py,sha256=VVdQjak74_wTDqmvL05_C97vIFugQxPVU-3JQEFBgR8,747
|
|
14
14
|
svc_infra/api/fastapi/apf_payments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
svc_infra/api/fastapi/apf_payments/router.py,sha256=
|
|
15
|
+
svc_infra/api/fastapi/apf_payments/router.py,sha256=PczpPo3Q1MzwA5a54WmJleoa95_oSkQbQ9VBhELDhmc,34979
|
|
16
16
|
svc_infra/api/fastapi/apf_payments/setup.py,sha256=PX-LHDiyu2eDuaw2m98VPUkF6EmXXRkbjRqh_gL8Kls,2263
|
|
17
17
|
svc_infra/api/fastapi/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
svc_infra/api/fastapi/auth/_cookies.py,sha256=U4heUmMnLezHx8U6ksuUEpSZ6sNMJcIO0gdLpmZ5FXw,1367
|
|
@@ -228,7 +228,7 @@ svc_infra/obs/templates/sidecars/railway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
|
|
|
228
228
|
svc_infra/obs/templates/sidecars/railway/agent.yaml,sha256=hYv35yG92XEP_4joMFmMcVTD-4fG_zHitmChjreUJh4,516
|
|
229
229
|
svc_infra/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
230
230
|
svc_infra/utils.py,sha256=VX1yjTx61-YvAymyRhGy18DhybiVdPddiYD_FlKTbJU,952
|
|
231
|
-
svc_infra-0.1.
|
|
232
|
-
svc_infra-0.1.
|
|
233
|
-
svc_infra-0.1.
|
|
234
|
-
svc_infra-0.1.
|
|
231
|
+
svc_infra-0.1.583.dist-info/METADATA,sha256=wUj0munpxtD92jOrF7dsASp2RYGuar2361cD2YzlRl0,3487
|
|
232
|
+
svc_infra-0.1.583.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
233
|
+
svc_infra-0.1.583.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
|
|
234
|
+
svc_infra-0.1.583.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|