Add new infra architecture 13

This commit is contained in:
Urtzi Alfaro
2026-01-21 23:16:19 +01:00
parent 66dfd50fbc
commit aeff6b1537
22 changed files with 552 additions and 151 deletions

View File

@@ -4,6 +4,7 @@ Implements SetupIntent-first architecture for secure payment flows
Implements PaymentProvider interface for easy SDK swapping
"""
import os
import stripe
import uuid
import logging
@@ -30,12 +31,13 @@ class StripeClient(PaymentProvider):
def __init__(self):
"""Initialize Stripe client with configuration"""
settings = BaseServiceSettings()
stripe.api_key = settings.STRIPE_SECRET_KEY
# Read Stripe settings directly from environment to avoid BaseServiceSettings validation
stripe.api_key = os.environ.get("STRIPE_SECRET_KEY")
# Let the SDK use its default pinned API version (2025-12-15.clover for v14.1.0)
# Only override if explicitly set in environment
if settings.STRIPE_API_VERSION:
stripe.api_version = settings.STRIPE_API_VERSION
stripe_api_version = os.environ.get("STRIPE_API_VERSION")
if stripe_api_version:
stripe.api_version = stripe_api_version
async def create_setup_intent_for_verification(
self,