freeleaps-service-hub/apps/payment/webapi/routes/payment/payment_manager_controller.py
2024-11-18 22:01:54 -08:00

32 lines
796 B
Python

from fastapi import APIRouter
from backend.application.payment_hub import PaymentHub
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
):
return await payment_hub.fetch_stripe_account_id(user_id)