@waffo/pancake-ts 0.19.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +17 -17
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -6
- package/dist/index.d.ts +21 -6
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/docs/webhook-guide.md +45 -13
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -353,6 +353,8 @@ interface NotificationSettings {
|
|
|
353
353
|
emailTrialStarted: boolean;
|
|
354
354
|
emailTrialEnding: boolean;
|
|
355
355
|
emailUpcomingCharge: boolean;
|
|
356
|
+
/** One toggle for all three plan-change customer emails (scheduled / failed / applied) */
|
|
357
|
+
emailSubscriptionPlanChanged: boolean;
|
|
356
358
|
notifyNewOrders: boolean;
|
|
357
359
|
notifyNewSubscriptions: boolean;
|
|
358
360
|
notifySubscriptionCanceled: boolean;
|
|
@@ -360,7 +362,7 @@ interface NotificationSettings {
|
|
|
360
362
|
notifySubscriptionPastDue: boolean;
|
|
361
363
|
notifySubscriptionRenewed: boolean;
|
|
362
364
|
notifySubscriptionUncanceled: boolean;
|
|
363
|
-
|
|
365
|
+
notifySubscriptionPlanChanged: boolean;
|
|
364
366
|
notifyChargeback: boolean;
|
|
365
367
|
}
|
|
366
368
|
/**
|
|
@@ -371,7 +373,7 @@ interface NotificationSettings {
|
|
|
371
373
|
* endpoint if included. Payout result notifications are platform-managed and always
|
|
372
374
|
* delivered — they have no toggle key. Use this type for any merchant-side update.
|
|
373
375
|
*/
|
|
374
|
-
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "
|
|
376
|
+
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback">;
|
|
375
377
|
/**
|
|
376
378
|
* Single-theme checkout page styling.
|
|
377
379
|
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
@@ -1034,14 +1036,22 @@ declare enum WebhookEventType {
|
|
|
1034
1036
|
OrderCompleted = "order.completed",
|
|
1035
1037
|
/** Subscription first payment succeeded (newly activated) */
|
|
1036
1038
|
SubscriptionActivated = "subscription.activated",
|
|
1037
|
-
/** Subscription
|
|
1039
|
+
/** Subscription payment succeeded — a pure payment event, carries no subscription period or status */
|
|
1038
1040
|
SubscriptionPaymentSucceeded = "subscription.payment_succeeded",
|
|
1041
|
+
/** Current billing period rolled forward (renewal) */
|
|
1042
|
+
SubscriptionRenewed = "subscription.renewed",
|
|
1043
|
+
/** Subscription recovered from past due (a retried charge succeeded) */
|
|
1044
|
+
SubscriptionRecovered = "subscription.recovered",
|
|
1045
|
+
/** Plan change took effect (upgrade/downgrade) */
|
|
1046
|
+
SubscriptionPlanChanged = "subscription.plan_changed",
|
|
1047
|
+
/** Plan change confirmed, takes effect next billing period */
|
|
1048
|
+
SubscriptionPlanChangeScheduled = "subscription.plan_change_scheduled",
|
|
1049
|
+
/** Plan change did not complete, the current plan stays in effect */
|
|
1050
|
+
SubscriptionPlanChangeFailed = "subscription.plan_change_failed",
|
|
1039
1051
|
/** Customer initiated cancellation (expires at end of current period) */
|
|
1040
1052
|
SubscriptionCanceling = "subscription.canceling",
|
|
1041
1053
|
/** Customer withdrew cancellation (subscription restored) */
|
|
1042
1054
|
SubscriptionUncanceled = "subscription.uncanceled",
|
|
1043
|
-
/** Subscription product changed (upgrade/downgrade) */
|
|
1044
|
-
SubscriptionUpdated = "subscription.updated",
|
|
1045
1055
|
/** Subscription fully terminated */
|
|
1046
1056
|
SubscriptionCanceled = "subscription.canceled",
|
|
1047
1057
|
/** Renewal payment failed (past due) */
|
|
@@ -1057,7 +1067,12 @@ declare enum WebhookEventType {
|
|
|
1057
1067
|
*/
|
|
1058
1068
|
interface WebhookEventData {
|
|
1059
1069
|
orderId: string;
|
|
1060
|
-
/**
|
|
1070
|
+
/**
|
|
1071
|
+
* Order status (e.g., "completed", "active", "canceling").
|
|
1072
|
+
*
|
|
1073
|
+
* Absent on `subscription.payment_succeeded` — that event describes one charge only.
|
|
1074
|
+
* Read the subscription's status from the subscription events instead.
|
|
1075
|
+
*/
|
|
1061
1076
|
orderStatus?: string;
|
|
1062
1077
|
buyerEmail: string;
|
|
1063
1078
|
/** Merchant-provided customer identity from checkout session */
|
package/dist/index.d.ts
CHANGED
|
@@ -353,6 +353,8 @@ interface NotificationSettings {
|
|
|
353
353
|
emailTrialStarted: boolean;
|
|
354
354
|
emailTrialEnding: boolean;
|
|
355
355
|
emailUpcomingCharge: boolean;
|
|
356
|
+
/** One toggle for all three plan-change customer emails (scheduled / failed / applied) */
|
|
357
|
+
emailSubscriptionPlanChanged: boolean;
|
|
356
358
|
notifyNewOrders: boolean;
|
|
357
359
|
notifyNewSubscriptions: boolean;
|
|
358
360
|
notifySubscriptionCanceled: boolean;
|
|
@@ -360,7 +362,7 @@ interface NotificationSettings {
|
|
|
360
362
|
notifySubscriptionPastDue: boolean;
|
|
361
363
|
notifySubscriptionRenewed: boolean;
|
|
362
364
|
notifySubscriptionUncanceled: boolean;
|
|
363
|
-
|
|
365
|
+
notifySubscriptionPlanChanged: boolean;
|
|
364
366
|
notifyChargeback: boolean;
|
|
365
367
|
}
|
|
366
368
|
/**
|
|
@@ -371,7 +373,7 @@ interface NotificationSettings {
|
|
|
371
373
|
* endpoint if included. Payout result notifications are platform-managed and always
|
|
372
374
|
* delivered — they have no toggle key. Use this type for any merchant-side update.
|
|
373
375
|
*/
|
|
374
|
-
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "
|
|
376
|
+
type MerchantWritableNotificationSettings = Pick<NotificationSettings, "notifyNewOrders" | "notifyNewSubscriptions" | "notifySubscriptionCanceled" | "notifySubscriptionEnded" | "notifySubscriptionPastDue" | "notifySubscriptionRenewed" | "notifySubscriptionUncanceled" | "notifySubscriptionPlanChanged" | "notifyChargeback">;
|
|
375
377
|
/**
|
|
376
378
|
* Single-theme checkout page styling.
|
|
377
379
|
* @see docs/api-reference/endpoints/stores/overview.mdx
|
|
@@ -1034,14 +1036,22 @@ declare enum WebhookEventType {
|
|
|
1034
1036
|
OrderCompleted = "order.completed",
|
|
1035
1037
|
/** Subscription first payment succeeded (newly activated) */
|
|
1036
1038
|
SubscriptionActivated = "subscription.activated",
|
|
1037
|
-
/** Subscription
|
|
1039
|
+
/** Subscription payment succeeded — a pure payment event, carries no subscription period or status */
|
|
1038
1040
|
SubscriptionPaymentSucceeded = "subscription.payment_succeeded",
|
|
1041
|
+
/** Current billing period rolled forward (renewal) */
|
|
1042
|
+
SubscriptionRenewed = "subscription.renewed",
|
|
1043
|
+
/** Subscription recovered from past due (a retried charge succeeded) */
|
|
1044
|
+
SubscriptionRecovered = "subscription.recovered",
|
|
1045
|
+
/** Plan change took effect (upgrade/downgrade) */
|
|
1046
|
+
SubscriptionPlanChanged = "subscription.plan_changed",
|
|
1047
|
+
/** Plan change confirmed, takes effect next billing period */
|
|
1048
|
+
SubscriptionPlanChangeScheduled = "subscription.plan_change_scheduled",
|
|
1049
|
+
/** Plan change did not complete, the current plan stays in effect */
|
|
1050
|
+
SubscriptionPlanChangeFailed = "subscription.plan_change_failed",
|
|
1039
1051
|
/** Customer initiated cancellation (expires at end of current period) */
|
|
1040
1052
|
SubscriptionCanceling = "subscription.canceling",
|
|
1041
1053
|
/** Customer withdrew cancellation (subscription restored) */
|
|
1042
1054
|
SubscriptionUncanceled = "subscription.uncanceled",
|
|
1043
|
-
/** Subscription product changed (upgrade/downgrade) */
|
|
1044
|
-
SubscriptionUpdated = "subscription.updated",
|
|
1045
1055
|
/** Subscription fully terminated */
|
|
1046
1056
|
SubscriptionCanceled = "subscription.canceled",
|
|
1047
1057
|
/** Renewal payment failed (past due) */
|
|
@@ -1057,7 +1067,12 @@ declare enum WebhookEventType {
|
|
|
1057
1067
|
*/
|
|
1058
1068
|
interface WebhookEventData {
|
|
1059
1069
|
orderId: string;
|
|
1060
|
-
/**
|
|
1070
|
+
/**
|
|
1071
|
+
* Order status (e.g., "completed", "active", "canceling").
|
|
1072
|
+
*
|
|
1073
|
+
* Absent on `subscription.payment_succeeded` — that event describes one charge only.
|
|
1074
|
+
* Read the subscription's status from the subscription events instead.
|
|
1075
|
+
*/
|
|
1061
1076
|
orderStatus?: string;
|
|
1062
1077
|
buyerEmail: string;
|
|
1063
1078
|
/** Merchant-provided customer identity from checkout session */
|
package/dist/index.js
CHANGED
|
@@ -1517,9 +1517,13 @@ var WebhookEventType = /* @__PURE__ */ ((WebhookEventType2) => {
|
|
|
1517
1517
|
WebhookEventType2["OrderCompleted"] = "order.completed";
|
|
1518
1518
|
WebhookEventType2["SubscriptionActivated"] = "subscription.activated";
|
|
1519
1519
|
WebhookEventType2["SubscriptionPaymentSucceeded"] = "subscription.payment_succeeded";
|
|
1520
|
+
WebhookEventType2["SubscriptionRenewed"] = "subscription.renewed";
|
|
1521
|
+
WebhookEventType2["SubscriptionRecovered"] = "subscription.recovered";
|
|
1522
|
+
WebhookEventType2["SubscriptionPlanChanged"] = "subscription.plan_changed";
|
|
1523
|
+
WebhookEventType2["SubscriptionPlanChangeScheduled"] = "subscription.plan_change_scheduled";
|
|
1524
|
+
WebhookEventType2["SubscriptionPlanChangeFailed"] = "subscription.plan_change_failed";
|
|
1520
1525
|
WebhookEventType2["SubscriptionCanceling"] = "subscription.canceling";
|
|
1521
1526
|
WebhookEventType2["SubscriptionUncanceled"] = "subscription.uncanceled";
|
|
1522
|
-
WebhookEventType2["SubscriptionUpdated"] = "subscription.updated";
|
|
1523
1527
|
WebhookEventType2["SubscriptionCanceled"] = "subscription.canceled";
|
|
1524
1528
|
WebhookEventType2["SubscriptionPastDue"] = "subscription.past_due";
|
|
1525
1529
|
WebhookEventType2["RefundSucceeded"] = "refund.succeeded";
|