@waffo/pancake-ts 0.19.0 → 0.19.1

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/dist/index.d.cts CHANGED
@@ -177,7 +177,7 @@ declare enum OnetimeOrderStatus {
177
177
  * - pending -> active, canceled, closed (PSP CLOSE from never-activated)
178
178
  * - active -> canceling, past_due, canceled, expired
179
179
  * - canceling -> active, canceled
180
- * - past_due -> active, canceled
180
+ * - past_due -> active, canceling, canceled
181
181
  * - closed -> terminal (never-activated subscription closed by PSP)
182
182
  * - canceled -> terminal
183
183
  * - expired -> terminal
@@ -1571,7 +1571,9 @@ declare class CustomerSession {
1571
1571
  *
1572
1572
  * @example
1573
1573
  * const { orderId, status } = await customer.cancelSubscription({ orderId: "ORD_xxx" });
1574
- * // status: "canceled" (was pending) or "canceling" (was active)
1574
+ * // status: "canceled" (was pending)
1575
+ * // or "canceling" (was active — stops at the end of the current period)
1576
+ * // or "canceling" (was past_due — stops immediately)
1575
1577
  */
1576
1578
  cancelSubscription(params: CancelSubscriptionParams): Promise<CancelSubscriptionResult & {
1577
1579
  warnings?: Notice[];
@@ -1591,6 +1593,12 @@ declare class CustomerSession {
1591
1593
  /**
1592
1594
  * Reactivate a subscription that is in `canceling` status.
1593
1595
  *
1596
+ * A subscription that had an unpaid charge at the moment cancellation was
1597
+ * requested is refused with 400 (`Subscription with an unpaid balance cannot
1598
+ * be reactivated`), which is worded differently from the 400 returned when
1599
+ * the order is not in `canceling` status. Cancelling a `past_due`
1600
+ * subscription always falls into the former category.
1601
+ *
1594
1602
  * @param params - Order to reactivate
1595
1603
  * @returns Order ID and resulting status
1596
1604
  *
@@ -1766,8 +1774,14 @@ declare class OrdersResource {
1766
1774
  /**
1767
1775
  * Cancel a subscription order.
1768
1776
  *
1769
- * - pending -> canceled (immediate)
1770
- * - active/trialing -> canceling (PSP cancel, webhook updates later)
1777
+ * - pending -> canceled (immediate, no PSP call)
1778
+ * - active/trialing -> canceling (PSP cancel scheduled for the end of the
1779
+ * current billing period; the subscription stays usable until then)
1780
+ * - past_due -> canceling (PSP cancel dispatched immediately; the billing
1781
+ * period has already lapsed, so nothing is left to use)
1782
+ *
1783
+ * In both canceling cases the terminal `canceled` status is written when the
1784
+ * PSP cancellation webhook arrives, not by this call.
1771
1785
  *
1772
1786
  * @param params - Order to cancel
1773
1787
  * @returns Order ID and resulting status
package/dist/index.d.ts CHANGED
@@ -177,7 +177,7 @@ declare enum OnetimeOrderStatus {
177
177
  * - pending -> active, canceled, closed (PSP CLOSE from never-activated)
178
178
  * - active -> canceling, past_due, canceled, expired
179
179
  * - canceling -> active, canceled
180
- * - past_due -> active, canceled
180
+ * - past_due -> active, canceling, canceled
181
181
  * - closed -> terminal (never-activated subscription closed by PSP)
182
182
  * - canceled -> terminal
183
183
  * - expired -> terminal
@@ -1571,7 +1571,9 @@ declare class CustomerSession {
1571
1571
  *
1572
1572
  * @example
1573
1573
  * const { orderId, status } = await customer.cancelSubscription({ orderId: "ORD_xxx" });
1574
- * // status: "canceled" (was pending) or "canceling" (was active)
1574
+ * // status: "canceled" (was pending)
1575
+ * // or "canceling" (was active — stops at the end of the current period)
1576
+ * // or "canceling" (was past_due — stops immediately)
1575
1577
  */
1576
1578
  cancelSubscription(params: CancelSubscriptionParams): Promise<CancelSubscriptionResult & {
1577
1579
  warnings?: Notice[];
@@ -1591,6 +1593,12 @@ declare class CustomerSession {
1591
1593
  /**
1592
1594
  * Reactivate a subscription that is in `canceling` status.
1593
1595
  *
1596
+ * A subscription that had an unpaid charge at the moment cancellation was
1597
+ * requested is refused with 400 (`Subscription with an unpaid balance cannot
1598
+ * be reactivated`), which is worded differently from the 400 returned when
1599
+ * the order is not in `canceling` status. Cancelling a `past_due`
1600
+ * subscription always falls into the former category.
1601
+ *
1594
1602
  * @param params - Order to reactivate
1595
1603
  * @returns Order ID and resulting status
1596
1604
  *
@@ -1766,8 +1774,14 @@ declare class OrdersResource {
1766
1774
  /**
1767
1775
  * Cancel a subscription order.
1768
1776
  *
1769
- * - pending -> canceled (immediate)
1770
- * - active/trialing -> canceling (PSP cancel, webhook updates later)
1777
+ * - pending -> canceled (immediate, no PSP call)
1778
+ * - active/trialing -> canceling (PSP cancel scheduled for the end of the
1779
+ * current billing period; the subscription stays usable until then)
1780
+ * - past_due -> canceling (PSP cancel dispatched immediately; the billing
1781
+ * period has already lapsed, so nothing is left to use)
1782
+ *
1783
+ * In both canceling cases the terminal `canceled` status is written when the
1784
+ * PSP cancellation webhook arrives, not by this call.
1771
1785
  *
1772
1786
  * @param params - Order to cancel
1773
1787
  * @returns Order ID and resulting status
package/dist/index.js CHANGED
@@ -541,7 +541,9 @@ var CustomerSession = class {
541
541
  *
542
542
  * @example
543
543
  * const { orderId, status } = await customer.cancelSubscription({ orderId: "ORD_xxx" });
544
- * // status: "canceled" (was pending) or "canceling" (was active)
544
+ * // status: "canceled" (was pending)
545
+ * // or "canceling" (was active — stops at the end of the current period)
546
+ * // or "canceling" (was past_due — stops immediately)
545
547
  */
546
548
  async cancelSubscription(params) {
547
549
  validateShortId("orderId", params.orderId, "ORD");
@@ -563,6 +565,12 @@ var CustomerSession = class {
563
565
  /**
564
566
  * Reactivate a subscription that is in `canceling` status.
565
567
  *
568
+ * A subscription that had an unpaid charge at the moment cancellation was
569
+ * requested is refused with 400 (`Subscription with an unpaid balance cannot
570
+ * be reactivated`), which is worded differently from the 400 returned when
571
+ * the order is not in `canceling` status. Cancelling a `past_due`
572
+ * subscription always falls into the former category.
573
+ *
566
574
  * @param params - Order to reactivate
567
575
  * @returns Order ID and resulting status
568
576
  *
@@ -761,8 +769,14 @@ var OrdersResource = class {
761
769
  /**
762
770
  * Cancel a subscription order.
763
771
  *
764
- * - pending -> canceled (immediate)
765
- * - active/trialing -> canceling (PSP cancel, webhook updates later)
772
+ * - pending -> canceled (immediate, no PSP call)
773
+ * - active/trialing -> canceling (PSP cancel scheduled for the end of the
774
+ * current billing period; the subscription stays usable until then)
775
+ * - past_due -> canceling (PSP cancel dispatched immediately; the billing
776
+ * period has already lapsed, so nothing is left to use)
777
+ *
778
+ * In both canceling cases the terminal `canceled` status is written when the
779
+ * PSP cancellation webhook arrives, not by this call.
766
780
  *
767
781
  * @param params - Order to cancel
768
782
  * @returns Order ID and resulting status