Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,13 @@ async def api_ticket_create(

ticket_id = urlsafe_short_hash()
base_url = str(request.base_url).rstrip("/")
webhook_url = f"{base_url}/events/api/v1/tickets/{ticket_id}/satspay-webhook"
# Use internal address for webhook — SatsPay calls it server-side and
# cannot reach the public domain from within the container.
internal_base = f"http://{settings.host}:{settings.port}"
webhook_url = (
f"{internal_base}/events/api/v1/tickets/{ticket_id}/satspay-webhook"
)
complete_url = f"{base_url}/events/ticket/{ticket_id}"

try:
charge = await create_satspay_charge(
api_key=wallet_record.inkey,
Expand Down Expand Up @@ -683,7 +687,7 @@ async def api_ticket_delete(


@tickets_api_router.post("/{ticket_id}/satspay-webhook")
async def api_ticket_satspay_webhook(ticket_id: str, request: Request) -> None:
async def api_ticket_satspay_webhook(ticket_id: str) -> None:
ticket = await get_ticket(ticket_id)
if not ticket:
logger.warning(f"SatsPay webhook: ticket {ticket_id} does not exist.")
Expand Down
Loading