@waffo/pancake-ts 0.19.0 → 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.
@@ -424,7 +424,7 @@ All events include the **Order**, **Amount**, and **Product** sections. Addition
424
424
  | `paymentFailureReason` | `string` | Payment failure reason (present when failed) |
425
425
  | `paymentDate` | `string` | Payment date (ISO 8601 date, e.g., `"2026-04-18"`) |
426
426
 
427
- **Subscription fields** (present for `subscription.*` events):
427
+ **Subscription fields** present on the subscription domain events, **not** on `subscription.payment_succeeded`:
428
428
 
429
429
  | Field | Type | Description |
430
430
  | -------------------- | -------- | --------------------------------------------------------------------- |
@@ -433,6 +433,34 @@ All events include the **Order**, **Amount**, and **Product** sections. Addition
433
433
  | `currentPeriodEnd` | `string` | Current billing period end date (ISO 8601) |
434
434
  | `canceledAt` | `string` | Subscription cancellation timestamp (ISO 8601, present when canceled) |
435
435
 
436
+ Which events carry that block:
437
+
438
+ | Event | Subscription block | `orderStatus` |
439
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------- |
440
+ | `subscription.activated`, `subscription.renewed`, `subscription.recovered`, `subscription.plan_changed`, `subscription.plan_change_scheduled`, `subscription.plan_change_failed`, `subscription.canceling`, `subscription.uncanceled`, `subscription.canceled`, `subscription.past_due` | Yes | Yes |
441
+ | `subscription.payment_succeeded` | No | No |
442
+ | `order.completed`, `refund.succeeded`, `refund.failed` | No | Yes |
443
+
444
+ ### Migrating off the subscription fields on `subscription.payment_succeeded`
445
+
446
+ `subscription.payment_succeeded` is a pure payment event: it describes one charge and carries
447
+ no `billingPeriod`, `currentPeriodStart`, `currentPeriodEnd`, `canceledAt` or `orderStatus`.
448
+ The subscription's period and status now travel on the subscription domain events only, where
449
+ they are written and published inside the same request — so they no longer arrive empty.
450
+
451
+ If your handler reads any of those five fields off `subscription.payment_succeeded`:
452
+
453
+ | You used it for | Read it from instead |
454
+ | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
455
+ | Extending access after a renewal | `subscription.renewed` — emitted whenever the current period actually rolls forward |
456
+ | Detecting the first paid period | `subscription.activated` — now always carries the full period |
457
+ | Knowing the subscription is healthy | `subscription.recovered` — emitted when a retried charge brings a past-due subscription back to active |
458
+ | Reading the subscription status | any subscription domain event (`orderStatus`), or query the order via GraphQL |
459
+
460
+ The renewal receipt itself is unchanged: `subscription.payment_succeeded` still carries the
461
+ payment fields (`paymentId`, `paymentStatus`, `amount`, `taxAmount`, …) and `orderId`, so a
462
+ handler that only uses those needs no change.
463
+
436
464
  **Refund fields** (present for `refund.succeeded`, `refund.failed`):
437
465
 
438
466
  | Field | Type | Description |
@@ -443,18 +471,22 @@ All events include the **Order**, **Amount**, and **Product** sections. Addition
443
471
 
444
472
  ## Event Types
445
473
 
446
- | Enum Value | String | Trigger |
447
- | ------------------------------ | -------------------------------- | ------------------------------------------------------------------ |
448
- | `OrderCompleted` | `order.completed` | One-time order first payment succeeded |
449
- | `SubscriptionActivated` | `subscription.activated` | New subscription activated |
450
- | `SubscriptionPaymentSucceeded` | `subscription.payment_succeeded` | Subscription renewal payment succeeded |
451
- | `SubscriptionCanceling` | `subscription.canceling` | Customer initiated cancellation (expires at end of billing period) |
452
- | `SubscriptionUncanceled` | `subscription.uncanceled` | Customer withdrew cancellation request |
453
- | `SubscriptionUpdated` | `subscription.updated` | Subscription product changed (upgrade/downgrade) |
454
- | `SubscriptionCanceled` | `subscription.canceled` | Subscription fully terminated |
455
- | `SubscriptionPastDue` | `subscription.past_due` | Renewal payment failed (past due) |
456
- | `RefundSucceeded` | `refund.succeeded` | Refund completed successfully |
457
- | `RefundFailed` | `refund.failed` | Refund failed |
474
+ | Enum Value | String | Trigger |
475
+ | --------------------------------- | ------------------------------------ | ------------------------------------------------------------------ |
476
+ | `OrderCompleted` | `order.completed` | One-time order first payment succeeded |
477
+ | `SubscriptionActivated` | `subscription.activated` | New subscription activated |
478
+ | `SubscriptionPaymentSucceeded` | `subscription.payment_succeeded` | Subscription payment succeeded (pure payment event) |
479
+ | `SubscriptionRenewed` | `subscription.renewed` | Current billing period rolled forward (renewal) |
480
+ | `SubscriptionRecovered` | `subscription.recovered` | Past-due subscription recovered by a successful retry |
481
+ | `SubscriptionPlanChanged` | `subscription.plan_changed` | Plan change took effect (upgrade/downgrade) |
482
+ | `SubscriptionPlanChangeScheduled` | `subscription.plan_change_scheduled` | Plan change confirmed, effective next billing period |
483
+ | `SubscriptionPlanChangeFailed` | `subscription.plan_change_failed` | Plan change did not complete, current plan stays in effect |
484
+ | `SubscriptionCanceling` | `subscription.canceling` | Customer initiated cancellation (expires at end of billing period) |
485
+ | `SubscriptionUncanceled` | `subscription.uncanceled` | Customer withdrew cancellation request |
486
+ | `SubscriptionCanceled` | `subscription.canceled` | Subscription fully terminated |
487
+ | `SubscriptionPastDue` | `subscription.past_due` | Renewal payment failed (past due) |
488
+ | `RefundSucceeded` | `refund.succeeded` | Refund completed successfully |
489
+ | `RefundFailed` | `refund.failed` | Refund failed |
458
490
 
459
491
  ## Key Rotation & Migration
460
492
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waffo/pancake-ts",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "TypeScript SDK for Waffo Pancake MoR platform — RSA-SHA256 signing, zero runtime dependencies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",