34 lines
943 B
Python
34 lines
943 B
Python
from fastapi import APIRouter
|
|
from fastapi.responses import JSONResponse
|
|
from backend.application.payment_hub import PaymentHub
|
|
from fastapi.encoders import jsonable_encoder
|
|
|
|
router = APIRouter()
|
|
payment_hub = PaymentHub()
|
|
|
|
# Web API
|
|
# Fetch wechat qr code
|
|
@router.get(
|
|
"/fetch_wechat_qr_code/{project_id}",
|
|
operation_id="fetch_wechat_qr_code",
|
|
summary="Fetch wechat qr code",
|
|
description="Fetch wechat qr code",
|
|
)
|
|
async def fetch_wechat_qr_code(
|
|
project_id: str
|
|
):
|
|
return await payment_hub.fetch_wechat_qr_code(project_id)
|
|
|
|
# Web API
|
|
# Fetch stripe account id
|
|
@router.get(
|
|
"/fetch_stripe_account_id/{user_id}",
|
|
operation_id="fetch_stripe_account_id",
|
|
summary="Fetch stripe account id",
|
|
description="Fetch stripe account id",
|
|
)
|
|
async def fetch_stripe_account_id(
|
|
user_id: str
|
|
):
|
|
res = await payment_hub.fetch_stripe_account_id(user_id)
|
|
return JSONResponse(content=jsonable_encoder(str(res))) |