Skip to content

Commit

Permalink
server/stripe: fix duplicate endpoint ID warning
Browse files Browse the repository at this point in the history
  • Loading branch information
frankie567 committed Mar 21, 2024
1 parent 02b0dc1 commit 5e1e843
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/polar/integrations/stripe/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def enqueue(event: stripe.Event) -> None:
log.info("stripe.webhook.queued", task_name=task_name)


@router.get("/refresh")
@router.get("/refresh", name="integrations.stripe.refresh")
def stripe_connect_refresh(return_path: str | None = Query(None)) -> RedirectResponse:
if return_path is None:
raise HTTPException(404)
Expand All @@ -61,15 +61,17 @@ async def __call__(self, request: Request) -> stripe.Event:
raise HTTPException(status_code=401) from e


@router.post("/webhook", status_code=202)
@router.post("/webhook", status_code=202, name="integrations.stripe.webhook")
async def webhook(
event: stripe.Event = Depends(WebhookEventGetter(settings.STRIPE_WEBHOOK_SECRET)),
) -> None:
if event["type"] in DIRECT_IMPLEMENTED_WEBHOOKS:
await enqueue(event)


@router.post("/webhook-connect", status_code=202)
@router.post(
"/webhook-connect", status_code=202, name="integrations.stripe.webhook_connect"
)
async def webhook_connect(
event: stripe.Event = Depends(
WebhookEventGetter(settings.STRIPE_CONNECT_WEBHOOK_SECRET)
Expand Down

0 comments on commit 5e1e843

Please sign in to comment.