@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.cjs CHANGED
@@ -588,7 +588,9 @@ var CustomerSession = class {
588
588
  *
589
589
  * @example
590
590
  * const { orderId, status } = await customer.cancelSubscription({ orderId: "ORD_xxx" });
591
- * // status: "canceled" (was pending) or "canceling" (was active)
591
+ * // status: "canceled" (was pending)
592
+ * // or "canceling" (was active — stops at the end of the current period)
593
+ * // or "canceling" (was past_due — stops immediately)
592
594
  */
593
595
  async cancelSubscription(params) {
594
596
  validateShortId("orderId", params.orderId, "ORD");
@@ -610,6 +612,12 @@ var CustomerSession = class {
610
612
  /**
611
613
  * Reactivate a subscription that is in `canceling` status.
612
614
  *
615
+ * A subscription that had an unpaid charge at the moment cancellation was
616
+ * requested is refused with 400 (`Subscription with an unpaid balance cannot
617
+ * be reactivated`), which is worded differently from the 400 returned when
618
+ * the order is not in `canceling` status. Cancelling a `past_due`
619
+ * subscription always falls into the former category.
620
+ *
613
621
  * @param params - Order to reactivate
614
622
  * @returns Order ID and resulting status
615
623
  *
@@ -808,8 +816,14 @@ var OrdersResource = class {
808
816
  /**
809
817
  * Cancel a subscription order.
810
818
  *
811
- * - pending -> canceled (immediate)
812
- * - active/trialing -> canceling (PSP cancel, webhook updates later)
819
+ * - pending -> canceled (immediate, no PSP call)
820
+ * - active/trialing -> canceling (PSP cancel scheduled for the end of the
821
+ * current billing period; the subscription stays usable until then)
822
+ * - past_due -> canceling (PSP cancel dispatched immediately; the billing
823
+ * period has already lapsed, so nothing is left to use)
824
+ *
825
+ * In both canceling cases the terminal `canceled` status is written when the
826
+ * PSP cancellation webhook arrives, not by this call.
813
827
  *
814
828
  * @param params - Order to cancel
815
829
  * @returns Order ID and resulting status