@wavezfm/api 0.7.26 → 0.7.27

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 CHANGED
@@ -8,12 +8,12 @@
8
8
  - Mercado Pago payment submission requires `expectedAmountMinor` for `subscription_prepaid` and `gift_subscription_prepaid`, using the displayed Mercado Pago checkout configuration's BRL amount multiplied by 100. The field remains optional for other payment kinds.
9
9
  - New Mercado Pago Subscriber purchases remain prepaid, including card payments, without automatic renewal. The retained legacy `createMercadoPagoSubscription()` helper requires a confirmed BRL amount but does not make new recurring checkout available; Mercado Pago upgrade management applies only to existing managed recurring subscriptions.
10
10
  - The updated server rejects missing confirmations with `BILLING_PRICE_CONFIRMATION_REQUIRED` and price changes with `BILLING_PRICE_CHANGED` before starting payment. Older clients must reload current prices and obtain buyer confirmation; the SDK never accepts a replacement price or retries payment automatically.
11
- - Stripe annual upgrades retain the existing subscription's actual currency and credit unused monthly time on the invoice. That credit reduces the payment instead of adding monthly days to the new annual period. Current cycle synchronization resolves provider state rather than accepting an outdated webhook snapshot.
11
+ - Stripe annual upgrades retain the existing subscription's actual currency and charge the annual plan upfront. Remaining paid access is kept as time, then another 12 calendar months are added; the next annual renewal moves to the combined end. There is no monetary proration credit for the retained time. Current cycle synchronization resolves provider state rather than accepting an outdated webhook snapshot.
12
12
  - New Stripe subscription product names use the supplied locale across all eleven website languages, including Czech. Existing paid invoices keep their historical names. Fixed local annual defaults were updated; explicit configured prices retain priority, and existing recurring subscriptions are not repriced retroactively.
13
13
 
14
14
  ### Annual subscription upgrade confirmation
15
15
 
16
- - Added `billing.previewSubscriptionUpgrade()` with typed amounts, ISO currency, proration credit, expiry and charge timing. `billing.upgradeSubscription()` now requires the returned `quoteId` after the buyer confirms the displayed charge. Older quote-free calls are rejected by the server before charging; no automatic retry or confirmation is performed by the SDK.
16
+ - Added `billing.previewSubscriptionUpgrade()` with typed amounts, ISO currency, expiry, charge timing and retained-time dates: `remainingAccessSeconds`, `annualStartsAt`, `accessUntil`, `renewalAt` and `remainingTimeTreatment`. `billing.upgradeSubscription()` requires the returned `quoteId` after the buyer confirms the displayed charge and dates. Older quote-free calls and old monetary-credit quotes are rejected by the server before charging; no automatic retry or confirmation is performed by the SDK.
17
17
 
18
18
  ### October 10 contract synchronization
19
19
 
package/README.md CHANGED
@@ -435,6 +435,27 @@ not an available new recurring checkout flow. Annual-upgrade management for
435
435
  Mercado Pago applies only to existing managed recurring subscriptions, not new
436
436
  prepaid purchases.
437
437
 
438
+ ### Annual upgrade with remaining paid time
439
+
440
+ Call `billing.previewSubscriptionUpgrade({ locale })` and display the returned
441
+ quote before confirming with `billing.upgradeSubscription({ quoteId, locale })`.
442
+ Stripe keeps the existing subscription currency and charges the annual price
443
+ upfront. Remaining paid access is preserved as time, without a monetary
444
+ proration credit, and another 12 calendar months are added after it.
445
+
446
+ The quote exposes `remainingAccessSeconds`, `annualStartsAt`, `accessUntil`,
447
+ `renewalAt` and `remainingTimeTreatment`. For Stripe the dates are ISO values,
448
+ `remainingTimeTreatment` is `preserved_time` (including when no time remains),
449
+ and the next annual renewal occurs at `renewalAt`, after the retained time plus
450
+ the purchased year. Display the exact `amountDueMinor` and currency; invoice
451
+ adjustments may affect the amount due. For existing Mercado Pago recurring
452
+ subscriptions, the existing deferred-change flow remains: the amount due now
453
+ is zero, the new time fields are null/zero and the treatment is `none`.
454
+
455
+ Old monetary-credit quotes are not valid for this policy. Obtain a fresh quote
456
+ and explicit buyer confirmation; never automatically retry a payment. Earlier
457
+ paid upgrades are not changed retroactively.
458
+
438
459
  ## Admin CDN images
439
460
 
440
461
  `client.adminMedia` uses an administrator **user session** and CSRF protection;
package/dist/types.d.ts CHANGED
@@ -1175,6 +1175,16 @@ export interface SubscriptionUpgradeQuote {
1175
1175
  expiresAt: string;
1176
1176
  chargeTiming: "immediate" | "next_billing_date";
1177
1177
  scheduledChangeAt: string | null;
1178
+ /** Paid access retained by this upgrade, in whole seconds. */
1179
+ remainingAccessSeconds: number;
1180
+ /** Start of the additional annual coverage; ISO date for Stripe, null for Mercado Pago. */
1181
+ annualStartsAt: string | null;
1182
+ /** End of paid coverage after adding 12 calendar months; ISO date for Stripe. */
1183
+ accessUntil: string | null;
1184
+ /** Stripe's next annual renewal, after the retained time plus the purchased year. */
1185
+ renewalAt: string | null;
1186
+ /** Retained time is access, not a monetary proration credit. */
1187
+ remainingTimeTreatment: "preserved_time" | "none";
1178
1188
  }
1179
1189
  export interface SubscriptionUpgradePreviewResponse {
1180
1190
  success: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavezfm/api",
3
- "version": "0.7.26",
3
+ "version": "0.7.27",
4
4
  "description": "Official JavaScript/TypeScript API client for WavezFM.",
5
5
  "homepage": "https://docs.wavez.fm/docs",
6
6
  "repository": {