note subscriptions not deleted from database in readme

This commit is contained in:
Shawn Erquhart
2025-03-03 12:20:07 -05:00
parent f86bf29978
commit 47eea6453d

View File

@@ -113,7 +113,10 @@ polar.registerRoutes(http, {
path: "/events/polar", path: "/events/polar",
// Optional callbacks for webhook events // Optional callbacks for webhook events
onSubscriptionUpdated: async (ctx, event) => { onSubscriptionUpdated: async (ctx, event) => {
// Handle subscription updates, like cancellations // Handle subscription updates, like cancellations.
// Note that a cancelled subscription will not be deleted from the database,
// so this information remains available without a hook, eg., via
// `getCurrentSubscription()`.
if (event.data.customerCancellationReason) { if (event.data.customerCancellationReason) {
console.log("Customer cancelled:", event.data.customerCancellationReason); console.log("Customer cancelled:", event.data.customerCancellationReason);
} }