svc-infra 0.1.591__py3-none-any.whl → 0.1.593__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.

@@ -797,10 +797,3 @@ class PaymentsService:
797
797
 
798
798
  async def get_usage_record(self, usage_record_id: str) -> UsageRecordOut:
799
799
  return await self._get_adapter().get_usage_record(usage_record_id)
800
-
801
- async def delete_invoice_line_item(
802
- self, provider_invoice_id: str, provider_line_item_id: str
803
- ) -> InvoiceOut:
804
- return await self._get_adapter().delete_invoice_line_item(
805
- provider_invoice_id, provider_line_item_id
806
- )
@@ -9,17 +9,26 @@ STRIPE_KEY = os.getenv("STRIPE_SECRET") or os.getenv("STRIPE_API_KEY")
9
9
  STRIPE_WH = os.getenv("STRIPE_WH_SECRET")
10
10
  PROVIDER = (os.getenv("APF_PAYMENTS_PROVIDER") or os.getenv("PAYMENTS_PROVIDER", "stripe")).lower()
11
11
 
12
+ AIYDAN_KEY = os.getenv("AIYDAN_API_KEY")
13
+ AIYDAN_CLIENT_KEY = os.getenv("AIYDAN_CLIENT_KEY")
14
+ AIYDAN_MERCHANT = os.getenv("AIYDAN_MERCHANT_ACCOUNT")
15
+ AIYDAN_HMAC = os.getenv("AIYDAN_HMAC_KEY")
16
+ AIYDAN_BASE_URL = os.getenv("AIYDAN_BASE_URL")
17
+ AIYDAN_WH = os.getenv("AIYDAN_WH_SECRET")
18
+
12
19
 
13
20
  class StripeConfig(BaseModel):
14
21
  secret_key: SecretStr
15
22
  webhook_secret: Optional[SecretStr] = None
16
23
 
17
24
 
18
- class AdyenConfig(BaseModel):
25
+ class AiydanConfig(BaseModel):
19
26
  api_key: SecretStr
20
27
  client_key: Optional[SecretStr] = None
21
28
  merchant_account: Optional[str] = None
22
29
  hmac_key: Optional[SecretStr] = None
30
+ base_url: Optional[str] = None
31
+ webhook_secret: Optional[SecretStr] = None
23
32
 
24
33
 
25
34
  class PaymentsSettings(BaseModel):
@@ -34,7 +43,18 @@ class PaymentsSettings(BaseModel):
34
43
  if STRIPE_KEY
35
44
  else None
36
45
  )
37
- adyen: Optional[AdyenConfig] = None
46
+ aiydan: Optional[AiydanConfig] = (
47
+ AiydanConfig(
48
+ api_key=SecretStr(AIYDAN_KEY),
49
+ client_key=SecretStr(AIYDAN_CLIENT_KEY) if AIYDAN_CLIENT_KEY else None,
50
+ merchant_account=AIYDAN_MERCHANT,
51
+ hmac_key=SecretStr(AIYDAN_HMAC) if AIYDAN_HMAC else None,
52
+ base_url=AIYDAN_BASE_URL,
53
+ webhook_secret=SecretStr(AIYDAN_WH) if AIYDAN_WH else None,
54
+ )
55
+ if AIYDAN_KEY
56
+ else None
57
+ )
38
58
 
39
59
 
40
60
  _SETTINGS: Optional[PaymentsSettings] = None
@@ -985,28 +985,6 @@ def build_payments_routers(prefix: str = "/payments") -> list[DualAPIRouter]:
985
985
  ):
986
986
  return await svc.get_usage_record(usage_record_id)
987
987
 
988
- # --- Invoices: delete line item ---
989
- @prot.delete(
990
- "/invoices/{provider_invoice_id}/lines/{provider_line_item_id}",
991
- name="payments_delete_invoice_line_item",
992
- summary="Delete Invoice Line Item (draft invoices only)",
993
- response_model=InvoiceOut,
994
- dependencies=[Depends(require_idempotency_key)],
995
- tags=["Invoices"],
996
- )
997
- async def delete_invoice_line_item_endpoint(
998
- provider_invoice_id: str,
999
- provider_line_item_id: str,
1000
- svc: PaymentsService = Depends(get_service),
1001
- ):
1002
- """
1003
- Removes a line item from a DRAFT invoice only. For finalized invoices,
1004
- use `void` or `credit` flows instead.
1005
- """
1006
- out = await svc.delete_invoice_line_item(provider_invoice_id, provider_line_item_id)
1007
- await svc.session.flush()
1008
- return out
1009
-
1010
988
  # --- Canonical: remove local alias/association (non-destructive) ---
1011
989
  @prot.delete(
1012
990
  "/method_aliases/{alias_id}",
@@ -24,6 +24,12 @@ def _maybe_register_default_providers(
24
24
  reg.register(StripeAdapter())
25
25
  except Exception:
26
26
  pass
27
+ try:
28
+ from svc_infra.apf_payments.provider.aiydan import AiydanAdapter
29
+
30
+ reg.register(AiydanAdapter())
31
+ except Exception:
32
+ pass
27
33
  if adapters:
28
34
  for a in adapters:
29
35
  reg.register(a) # must implement ProviderAdapter protocol (name, create_intent, etc.)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: svc-infra
3
- Version: 0.1.591
3
+ Version: 0.1.593
4
4
  Summary: Infrastructure for building and deploying prod-ready services
5
5
  License: MIT
6
6
  Keywords: fastapi,sqlalchemy,alembic,auth,infra,async,pydantic
@@ -26,6 +26,7 @@ Provides-Extra: pg2
26
26
  Provides-Extra: redshift
27
27
  Provides-Extra: snowflake
28
28
  Provides-Extra: sqlite
29
+ Requires-Dist: adyen (>=13.4.0,<14.0.0)
29
30
  Requires-Dist: ai-infra (>=0.1.63,<0.2.0)
30
31
  Requires-Dist: aiosqlite (>=0.20.0,<0.21.0) ; extra == "sqlite"
31
32
  Requires-Dist: alembic (>=1.13.2,<2.0.0)
@@ -1,19 +1,21 @@
1
1
  svc_infra/__init__.py,sha256=8maroJlM18MasrrLLcSbleK9pc0Q26Ek_sLvfafEG1c,49
2
+ svc_infra/apf_payments/README.md,sha256=jW2YLnqsQbRkZQCbIwYL1fg0NnwT76KQ-Mxov75OX7A,22356
2
3
  svc_infra/apf_payments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
4
  svc_infra/apf_payments/alembic.py,sha256=XJIcCDOoaO1EeJbSx_qK9o4cBi430qyo5gECtjHIojw,299
4
5
  svc_infra/apf_payments/models.py,sha256=u4U5oszha5uulCIrNoajaFDIc5YmTlh2mtm-yJUvr9I,14251
5
- svc_infra/apf_payments/provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ svc_infra/apf_payments/provider/__init__.py,sha256=zBh26eY7kcWHD4RXqAKfqaspY0_VE9thfts7aE8zbHg,142
7
+ svc_infra/apf_payments/provider/aiydan.py,sha256=QyzNGsp5F9BB43QwI686-cNzxA2GASKDfJmCsMq86BY,30972
6
8
  svc_infra/apf_payments/provider/base.py,sha256=1t5znglpGFhjt4zdbuzE5VlHvGarFwzH2oscK8yyKNY,7678
7
9
  svc_infra/apf_payments/provider/registry.py,sha256=NZ4pUkFcbXNtqWEpFeI3NwoKRYGWe9fVQakmlrVLTKE,878
8
10
  svc_infra/apf_payments/provider/stripe.py,sha256=Xb_UjdobbBzK-an9cO1jRWiP6OHvki5MDp6JnS6a1-I,34392
9
11
  svc_infra/apf_payments/schemas.py,sha256=1fdGnrXrm8Rmk9nwDsbcvrVIyPL2o8HwbZ7-KY9-yZo,8561
10
- svc_infra/apf_payments/service.py,sha256=bn3BTOTdfkJ4b0Z9cHuFHvlMcv9B1b2n0v-unveUplA,31060
11
- svc_infra/apf_payments/settings.py,sha256=VnNQbajbv843buUisqa82xOQ-f5JA8JzHD8o01-yhPQ,1239
12
+ svc_infra/apf_payments/service.py,sha256=YjSjR7xB51_Xvq_gxibBCaXwTP2UwsF2gUAANN_OJOs,30799
13
+ svc_infra/apf_payments/settings.py,sha256=vVWsvz_ajtVlRPH4N8ijSI4V7hUfjZFZT3h4wHRNa-s,2032
12
14
  svc_infra/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
15
  svc_infra/api/fastapi/__init__.py,sha256=VVdQjak74_wTDqmvL05_C97vIFugQxPVU-3JQEFBgR8,747
14
16
  svc_infra/api/fastapi/apf_payments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- svc_infra/api/fastapi/apf_payments/router.py,sha256=_9bqyZ9ZZsX43_b2LCghipPLkkHIEcswpR0yJxry-1U,34919
16
- svc_infra/api/fastapi/apf_payments/setup.py,sha256=tTUEcsT4FE5hxKvdl-R1S8JwJEJ-7cjQfw3RyzdZRs8,2501
17
+ svc_infra/api/fastapi/apf_payments/router.py,sha256=zZM5gioXOHK4AfTGSmmqrsMNgqZ0AFBPxnN_at-DhNo,34071
18
+ svc_infra/api/fastapi/apf_payments/setup.py,sha256=bk_LLLXyqTA-lqf0v-mdpqLEMbXB17U1IQjG-qSBejQ,2677
17
19
  svc_infra/api/fastapi/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
20
  svc_infra/api/fastapi/auth/_cookies.py,sha256=U4heUmMnLezHx8U6ksuUEpSZ6sNMJcIO0gdLpmZ5FXw,1367
19
21
  svc_infra/api/fastapi/auth/add.py,sha256=HSVP3Y01_gXPnRiJG0tEA9OS-cBd-zmqsiDbLMFGWu4,9528
@@ -228,7 +230,7 @@ svc_infra/obs/templates/sidecars/railway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
228
230
  svc_infra/obs/templates/sidecars/railway/agent.yaml,sha256=hYv35yG92XEP_4joMFmMcVTD-4fG_zHitmChjreUJh4,516
229
231
  svc_infra/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
230
232
  svc_infra/utils.py,sha256=VX1yjTx61-YvAymyRhGy18DhybiVdPddiYD_FlKTbJU,952
231
- svc_infra-0.1.591.dist-info/METADATA,sha256=cCJ81CBhhMMND7aL8Kx9O3YBsC2oS2G42bZspnRIiPI,3487
232
- svc_infra-0.1.591.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
233
- svc_infra-0.1.591.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
234
- svc_infra-0.1.591.dist-info/RECORD,,
233
+ svc_infra-0.1.593.dist-info/METADATA,sha256=ppEktfFTTLD_Sn6UR81aJgkVCewdHOUj4ZjpnLp1GS8,3527
234
+ svc_infra-0.1.593.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
235
+ svc_infra-0.1.593.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
236
+ svc_infra-0.1.593.dist-info/RECORD,,