Clean up payment isolation
This commit is contained in:
parent
cfea8b5889
commit
7dd8ef45c0
@ -75,7 +75,7 @@ async def fetch_transaction_by_session_id(
|
||||
# Web API
|
||||
# Fetch stripe transaction for milestone
|
||||
@router.get(
|
||||
"/fetch_stripe_transaction_for_milestone/{project_id}/{milestone_index}",
|
||||
"/fetch_stripe_transaction_for_milestone/",
|
||||
operation_id="fetch_stripe_transaction_for_milestone",
|
||||
summary="Fetch stripe transaction for milestone",
|
||||
description="Fetch stripe transaction for milestone",
|
||||
@ -125,7 +125,7 @@ async def create_stripe_transaction_for_milestone(
|
||||
)
|
||||
async def create_payment_link(
|
||||
transaction_id: str
|
||||
):
|
||||
) -> Optional[str]:
|
||||
return await payment_hub.create_payment_link(transaction_id)
|
||||
|
||||
# Web API
|
||||
@ -138,7 +138,7 @@ async def create_payment_link(
|
||||
)
|
||||
async def create_checkout_session(
|
||||
transaction_id: str
|
||||
):
|
||||
) -> Tuple[Optional[str], Optional[str]]:
|
||||
return await payment_hub.create_checkout_session(transaction_id)
|
||||
|
||||
# Web API
|
||||
@ -151,7 +151,7 @@ async def create_checkout_session(
|
||||
)
|
||||
async def fetch_payment_link(
|
||||
transaction_id: str
|
||||
):
|
||||
) -> Optional[str]:
|
||||
return await payment_hub.fetch_payment_link(transaction_id)
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ async def fetch_payment_link(
|
||||
)
|
||||
async def fetch_checkout_session_id(
|
||||
transaction_id: str
|
||||
):
|
||||
) -> Optional[str]:
|
||||
return await payment_hub.fetch_checkout_session_id(transaction_id)
|
||||
|
||||
# Web API
|
||||
@ -178,7 +178,7 @@ async def fetch_checkout_session_id(
|
||||
)
|
||||
async def fetch_checkout_session_url(
|
||||
transaction_id: str
|
||||
):
|
||||
) -> Optional[str]:
|
||||
return await payment_hub.fetch_checkout_session_url(transaction_id)
|
||||
|
||||
# Web API
|
||||
@ -189,31 +189,11 @@ async def fetch_checkout_session_url(
|
||||
summary="Invoke checkout session webhook",
|
||||
description="Invoke checkout session webhook",
|
||||
)
|
||||
async def invoke_checkout_session_webhook():
|
||||
return await payment_hub.invoke_checkout_session_webhook()
|
||||
|
||||
@router.get(
|
||||
"/test/{user_id}",
|
||||
operation_id="test",
|
||||
summary="test user_id",
|
||||
description="test user_id",
|
||||
)
|
||||
async def test(
|
||||
user_id: str
|
||||
async def invoke_checkout_session_webhook(
|
||||
payload: str,
|
||||
stripe_signature: str
|
||||
):
|
||||
return user_id
|
||||
|
||||
@router.get(
|
||||
"/testproj/{project_id}",
|
||||
operation_id="test",
|
||||
summary="test project_id",
|
||||
description="test project_id",
|
||||
return await payment_hub.invoke_checkout_session_webhook(
|
||||
payload,
|
||||
stripe_signature
|
||||
)
|
||||
async def test_project(
|
||||
project_id: str
|
||||
):
|
||||
return await ProjectDoc.get(project_id)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user