diff --git a/tasks.py b/tasks.py index e7bcf3e..9e1b0de 100644 --- a/tasks.py +++ b/tasks.py @@ -38,7 +38,7 @@ async def on_invoice_paid(payment: Payment) -> None: myextension = await get_myextension(myextension_id) assert myextension - # update something + # update something in the db data_to_update = { "total": myextension.total + payment.amount @@ -46,9 +46,9 @@ async def on_invoice_paid(payment: Payment) -> None: await update_myextension(myextension_id=myextension_id, **data_to_update.dict()) - # here we could send some data to a websocket on wss:///api/v1/ws/ - + # and then listen to it on the frontend, which we do with index.html connectWebocket() + some_payment_data = { "name": myextension.name, "amount": payment.amount, diff --git a/templates/myextension/index.html b/templates/myextension/index.html index 0bd9e57..61baace 100644 --- a/templates/myextension/index.html +++ b/templates/myextension/index.html @@ -195,9 +195,8 @@ {% endblock %} {% block scripts %} {{ window_vars(user) }}