Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -743,9 +743,9 @@ async def stripe_webhook(request: Request):
|
|
| 743 |
amt = CREDIT_PACKS[kind]["credits"]
|
| 744 |
cur.execute("UPDATE users SET credits=credits+? WHERE user_id=?", (amt, uid))
|
| 745 |
|
| 746 |
-
|
| 747 |
|
| 748 |
-
elif etype in ("customer.subscription.created", "subscription.updated"):
|
| 749 |
customer = data.get("customer")
|
| 750 |
status = data.get("status", "unknown")
|
| 751 |
if customer:
|
|
|
|
| 743 |
amt = CREDIT_PACKS[kind]["credits"]
|
| 744 |
cur.execute("UPDATE users SET credits=credits+? WHERE user_id=?", (amt, uid))
|
| 745 |
|
| 746 |
+
conn.commit()
|
| 747 |
|
| 748 |
+
elif etype in ("customer.subscription.created", "customer.subscription.updated"):
|
| 749 |
customer = data.get("customer")
|
| 750 |
status = data.get("status", "unknown")
|
| 751 |
if customer:
|