@flopay/shared 1.2.5 → 1.2.7

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
@@ -191,8 +191,12 @@ type CheckoutProductType = 'item' | 'subscription';
191
191
  interface CheckoutSessionProduct {
192
192
  uuid: string;
193
193
  checkoutSessionId: string;
194
- /** Whether this product is a one-time item or a recurring subscription. */
195
- type: CheckoutProductType;
194
+ /**
195
+ * Whether this product is a one-time item or a recurring subscription.
196
+ * Optional to mirror {@link CheckoutProduct.type}; when omitted, consumers
197
+ * treat the product as an `'item'` for display ordering.
198
+ */
199
+ type?: CheckoutProductType;
196
200
  /** Preferred catalog code for the product. */
197
201
  code?: string;
198
202
  /**
@@ -647,8 +651,13 @@ interface CheckoutItem {
647
651
  * migrate; the SDK folds them into this shape internally.
648
652
  */
649
653
  interface CheckoutProduct {
650
- /** Whether this product is a one-time item or a recurring subscription. */
651
- type: CheckoutProductType;
654
+ /**
655
+ * @deprecated Optional and no longer needed — the backend resolves item vs
656
+ * subscription from the catalog `code`. Pass it only to refine the
657
+ * client-side optimistic display rendered before the session response loads
658
+ * (subscriptions are listed first). Safe to omit.
659
+ */
660
+ type?: CheckoutProductType;
652
661
  /** Catalog code — preferred identifier. */
653
662
  code?: string;
654
663
  /** @deprecated Falls back to {@link CheckoutProduct.code} for back-compat. */
@@ -998,7 +1007,7 @@ declare function getConfiguredBillingApiUrl(): string;
998
1007
  declare function getFloPayEnvironment(): FloPayEnvironment;
999
1008
 
1000
1009
  /** Current SDK version. */
1001
- declare const SDK_VERSION = "1.2.5";
1010
+ declare const SDK_VERSION = "1.2.7";
1002
1011
  /** Billing API URL for staging environment. */
1003
1012
  declare const BILLING_API_URL_STAGING = "https://api.stage.flopay.com";
1004
1013
  /** Billing API URL for production environment. */
package/dist/index.d.ts CHANGED
@@ -191,8 +191,12 @@ type CheckoutProductType = 'item' | 'subscription';
191
191
  interface CheckoutSessionProduct {
192
192
  uuid: string;
193
193
  checkoutSessionId: string;
194
- /** Whether this product is a one-time item or a recurring subscription. */
195
- type: CheckoutProductType;
194
+ /**
195
+ * Whether this product is a one-time item or a recurring subscription.
196
+ * Optional to mirror {@link CheckoutProduct.type}; when omitted, consumers
197
+ * treat the product as an `'item'` for display ordering.
198
+ */
199
+ type?: CheckoutProductType;
196
200
  /** Preferred catalog code for the product. */
197
201
  code?: string;
198
202
  /**
@@ -647,8 +651,13 @@ interface CheckoutItem {
647
651
  * migrate; the SDK folds them into this shape internally.
648
652
  */
649
653
  interface CheckoutProduct {
650
- /** Whether this product is a one-time item or a recurring subscription. */
651
- type: CheckoutProductType;
654
+ /**
655
+ * @deprecated Optional and no longer needed — the backend resolves item vs
656
+ * subscription from the catalog `code`. Pass it only to refine the
657
+ * client-side optimistic display rendered before the session response loads
658
+ * (subscriptions are listed first). Safe to omit.
659
+ */
660
+ type?: CheckoutProductType;
652
661
  /** Catalog code — preferred identifier. */
653
662
  code?: string;
654
663
  /** @deprecated Falls back to {@link CheckoutProduct.code} for back-compat. */
@@ -998,7 +1007,7 @@ declare function getConfiguredBillingApiUrl(): string;
998
1007
  declare function getFloPayEnvironment(): FloPayEnvironment;
999
1008
 
1000
1009
  /** Current SDK version. */
1001
- declare const SDK_VERSION = "1.2.5";
1010
+ declare const SDK_VERSION = "1.2.7";
1002
1011
  /** Billing API URL for staging environment. */
1003
1012
  declare const BILLING_API_URL_STAGING = "https://api.stage.flopay.com";
1004
1013
  /** Billing API URL for production environment. */
package/dist/index.mjs CHANGED
@@ -79,7 +79,7 @@ var PAYMENT_METHOD_LOGOS = {
79
79
  };
80
80
 
81
81
  // src/constants.ts
82
- var SDK_VERSION = "1.2.5";
82
+ var SDK_VERSION = "1.2.7";
83
83
  var BILLING_API_URL_STAGING = "https://api.stage.flopay.com";
84
84
  var BILLING_API_URL_PRODUCTION = "https://api.flopay.com";
85
85
  var DEFAULT_API_BASE_URL = BILLING_API_URL_STAGING;
@@ -1855,7 +1855,7 @@ function buildCheckoutDisplayData(session, options = {}) {
1855
1855
  const itemsList = [];
1856
1856
  const products = session.products ?? [];
1857
1857
  const subscriptions = products.filter((p) => p.type === "subscription");
1858
- const items = products.filter((p) => p.type === "item");
1858
+ const items = products.filter((p) => p.type !== "subscription");
1859
1859
  const resolvedCurrency = resolveSessionCurrency(session.currency, void 0, void 0, products);
1860
1860
  const currency = (resolvedCurrency ?? "USD").toUpperCase();
1861
1861
  for (const sub of subscriptions) {