@monetize.software/sdk 3.0.0-alpha.12 → 3.0.0-alpha.13

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/core.d.ts CHANGED
@@ -743,6 +743,17 @@ export declare class BillingClient {
743
743
  errorUrl?: string;
744
744
  shopUrl?: string;
745
745
  trialDays?: number;
746
+ /** Активный offer для этой цены — резолвится host'ом через
747
+ * `paywall.getOfferForPrice(priceId)?.offer.id` или
748
+ * `findApplicableOffer(client.getCachedOffers(), priceId)?.id`. Без
749
+ * явной передачи бэк сделает auto-resolve по email — но только для
750
+ * end_date-офферов. duration_minutes-офферы тикают в clientStorage и
751
+ * сервер их не видит: для них offerId ОБЯЗАН прийти от клиента, иначе
752
+ * скидка не применится на чекауте, хотя UI её показывал.
753
+ *
754
+ * Передавать offer-id всегда безопасно — бэк сам проверит applicable
755
+ * ли offer к этому юзеру (страна/email/режим) и игнорирует если нет. */
756
+ offerId?: string;
746
757
  /**
747
758
  * Stage 1 защиты от дубликатов покупок. Идемпотентный ключ запроса
748
759
  * (UUID). Повторный вызов с тем же ключом вернёт тот же checkout-URL
package/dist/core.js CHANGED
@@ -839,6 +839,7 @@ class yt {
839
839
  body: JSON.stringify({
840
840
  email: this.identity.email,
841
841
  priceId: Number(t.priceId),
842
+ offerId: t.offerId,
842
843
  successUrl: u,
843
844
  errorUrl: t.errorUrl,
844
845
  shopUrl: d,