mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: use OAuth for stripe connect
This commit is contained in:
parent
93c0838fab
commit
0449d6f87c
9 changed files with 266 additions and 50 deletions
|
|
@ -74,7 +74,9 @@ class RedisConfig(BaseModel):
|
|||
class InternalStripeConfig(BaseModel):
|
||||
stripe_secret_key: str | None
|
||||
stripe_publishable_key: str | None
|
||||
stripe_webhook_secret: str | None
|
||||
stripe_webhook_standard_secret: str | None
|
||||
stripe_webhook_connect_secret: str | None
|
||||
stripe_client_id: str | None
|
||||
|
||||
|
||||
class InternalPaymentsConfig(BaseModel):
|
||||
|
|
@ -275,7 +277,9 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
|||
# Payments config
|
||||
env_stripe_secret_key = os.environ.get("LEARNHOUSE_STRIPE_SECRET_KEY")
|
||||
env_stripe_publishable_key = os.environ.get("LEARNHOUSE_STRIPE_PUBLISHABLE_KEY")
|
||||
env_stripe_webhook_secret = os.environ.get("LEARNHOUSE_STRIPE_WEBHOOK_SECRET")
|
||||
env_stripe_webhook_standard_secret = os.environ.get("LEARNHOUSE_STRIPE_WEBHOOK_STANDARD_SECRET")
|
||||
env_stripe_webhook_connect_secret = os.environ.get("LEARNHOUSE_STRIPE_WEBHOOK_CONNECT_SECRET")
|
||||
env_stripe_client_id = os.environ.get("LEARNHOUSE_STRIPE_CLIENT_ID")
|
||||
|
||||
stripe_secret_key = env_stripe_secret_key or yaml_config.get("payments_config", {}).get(
|
||||
"stripe", {}
|
||||
|
|
@ -285,9 +289,17 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
|||
"stripe", {}
|
||||
).get("stripe_publishable_key")
|
||||
|
||||
stripe_webhook_secret = env_stripe_webhook_secret or yaml_config.get("payments_config", {}).get(
|
||||
stripe_webhook_standard_secret = env_stripe_webhook_standard_secret or yaml_config.get("payments_config", {}).get(
|
||||
"stripe", {}
|
||||
).get("stripe_webhook_secret")
|
||||
).get("stripe_webhook_standard_secret")
|
||||
|
||||
stripe_webhook_connect_secret = env_stripe_webhook_connect_secret or yaml_config.get("payments_config", {}).get(
|
||||
"stripe", {}
|
||||
).get("stripe_webhook_connect_secret")
|
||||
|
||||
stripe_client_id = env_stripe_client_id or yaml_config.get("payments_config", {}).get(
|
||||
"stripe", {}
|
||||
).get("stripe_client_id")
|
||||
|
||||
# Create HostingConfig and DatabaseConfig objects
|
||||
hosting_config = HostingConfig(
|
||||
|
|
@ -335,7 +347,9 @@ def get_learnhouse_config() -> LearnHouseConfig:
|
|||
stripe=InternalStripeConfig(
|
||||
stripe_secret_key=stripe_secret_key,
|
||||
stripe_publishable_key=stripe_publishable_key,
|
||||
stripe_webhook_secret=stripe_webhook_secret
|
||||
stripe_webhook_standard_secret=stripe_webhook_standard_secret,
|
||||
stripe_webhook_connect_secret=stripe_webhook_connect_secret,
|
||||
stripe_client_id=stripe_client_id
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ payments_config:
|
|||
stripe:
|
||||
stripe_secret_key: ""
|
||||
stripe_publishable_key: ""
|
||||
stripe_webhook_secret: ""
|
||||
stripe_webhook_standard_secret: ""
|
||||
stripe_client_id: ""
|
||||
|
||||
ai_config:
|
||||
chromadb_config:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue