Add subcription feature 2

This commit is contained in:
Urtzi Alfaro
2026-01-14 13:15:48 +01:00
parent 6ddf608d37
commit a4c3b7da3f
32 changed files with 4240 additions and 965 deletions

View File

@@ -1138,7 +1138,7 @@ async def register_with_subscription(
):
"""Process user registration with subscription creation"""
@router.post(route_builder.build_base_route("payment-customers/create", include_tenant_prefix=False))
@router.post("/api/v1/payment-customers/create")
async def create_payment_customer(
user_data: Dict[str, Any],
payment_method_id: Optional[str] = Query(None, description="Optional payment method ID"),
@@ -1146,7 +1146,7 @@ async def create_payment_customer(
):
"""
Create a payment customer in the payment provider
This endpoint is designed for service-to-service communication from auth service
during user registration. It creates a payment customer that can be used later
for subscription creation.
@@ -1241,7 +1241,7 @@ async def register_with_subscription(
return {
"success": True,
"message": "Registration and subscription created successfully",
"data": result
**result
}
except Exception as e:
logger.error("Failed to register with subscription", error=str(e))
@@ -1291,7 +1291,7 @@ async def link_subscription_to_tenant(
return {
"success": True,
"message": "Subscription linked to tenant successfully",
"data": result
**result
}
except Exception as e: