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
|
|
@ -1,3 +1,4 @@
|
|||
from typing import Literal
|
||||
from fastapi import HTTPException, Request
|
||||
from sqlmodel import Session, select
|
||||
import stripe
|
||||
|
|
@ -15,11 +16,12 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
async def handle_stripe_webhook(
|
||||
request: Request,
|
||||
webhook_type: Literal["connect", "standard"],
|
||||
db_session: Session,
|
||||
) -> dict:
|
||||
# Get Stripe credentials
|
||||
creds = await get_stripe_internal_credentials()
|
||||
webhook_secret = creds.get('stripe_webhook_secret')
|
||||
webhook_secret = creds.get(f'stripe_webhook_{webhook_type}_secret')
|
||||
stripe.api_key = creds.get("stripe_secret_key")
|
||||
|
||||
if not webhook_secret:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue