@vio-live/web-sdk 0.8.0 → 0.9.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.
@@ -802,6 +802,45 @@ interface QliroOrder {
802
802
  total_price?: number;
803
803
  }
804
804
 
805
+ /**
806
+ * Walley (former Collector) — embedded checkout via Vio Commerce.
807
+ *
808
+ * Third embedded provider, same category as Kustom/Qliro: the widget
809
+ * collects address, shipping AND payment by itself.
810
+ *
811
+ * 1. `Payment { CreatePaymentWalley }` initializes the session (sponsor-key
812
+ * authed; the seller's own Walley credentials live server-side, per
813
+ * seller, never here) and returns a SYNTHESIZED html_snippet — Walley's
814
+ * real embed is a `<script data-token>` loader, so shopcart wraps it
815
+ * in the same shape Kustom/Qliro use, and this module reuses their
816
+ * exact script-executing injection.
817
+ * 2. Walley's own script renders the iframe. On completion it dispatches
818
+ * the DOM event `walleyCheckoutPurchaseCompleted` — the PRIMARY success
819
+ * signal, no page reload needed. `redirectPageUri` is registered too
820
+ * (`?checkout_id=…&payment_processor=WALLEY`, same contract as
821
+ * Kustom/Qliro) as a safety net in case the event is missed (tab
822
+ * backgrounded, page reload).
823
+ * 3. Either path re-reads the session (`Payment { GetWalleyOrder }`) BY
824
+ * OWNING CHECKOUT — same as Qliro — and re-renders Walley's own
825
+ * receipt.
826
+ *
827
+ * The Commerce order itself is created server-side by Walley's notification
828
+ * webhook (shopcart /checkout/payment/walley/ok) — the browser never
829
+ * confirms money.
830
+ */
831
+
832
+ /** Normalized Walley session (shopcart maps privateId/publicToken/status). */
833
+ interface WalleyOrder {
834
+ order_id: string;
835
+ /** Walley status: Initialized | CustomerIdentified | CommittedToPurchase | PurchaseCompleted | Aborted. */
836
+ status: string;
837
+ html_snippet: string;
838
+ public_token?: string;
839
+ purchase_country?: string;
840
+ purchase_currency?: string;
841
+ total_price?: number;
842
+ }
843
+
805
844
  /**
806
845
  * Checkout types — multi-sponsor compatible.
807
846
  *
@@ -809,7 +848,7 @@ interface QliroOrder {
809
848
  * merchant, same as iOS multi-sponsor model). Multiple sponsors → multiple
810
849
  * sequential checkouts.
811
850
  */
812
- type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro';
851
+ type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro' | 'walley';
813
852
  interface CheckoutAddress {
814
853
  firstName: string;
815
854
  lastName: string;
@@ -988,6 +1027,15 @@ declare class CheckoutManager extends EventTarget {
988
1027
  mountQliroCheckout(container: HTMLElement, sponsorId?: number): Promise<QliroOrder>;
989
1028
  /** Re-read the Qliro order owned by a checkout — the confirmation trip. */
990
1029
  getQliroOrder(checkoutId: string, sponsorId?: number): Promise<QliroOrder | null>;
1030
+ /**
1031
+ * Mount the Walley embedded checkout. `onPurchaseCompleted` fires as soon
1032
+ * as Walley's own script dispatches its success event INSIDE the widget —
1033
+ * no redirect needed. `getWalleyOrder`/the confirmation-URL fallback
1034
+ * remain for the case the event is missed (tab backgrounded, reload).
1035
+ */
1036
+ mountWalleyCheckout(container: HTMLElement, sponsorId?: number, onPurchaseCompleted?: (order: WalleyOrder) => void): Promise<WalleyOrder>;
1037
+ /** Re-read the Walley session owned by a checkout — the confirmation trip. */
1038
+ getWalleyOrder(checkoutId: string, sponsorId?: number): Promise<WalleyOrder | null>;
991
1039
  setAddress(address: CheckoutAddress): void;
992
1040
  selectPaymentMethod(method: PaymentMethod): void;
993
1041
  /**
@@ -1336,6 +1384,6 @@ declare const Vio: VioFacade;
1336
1384
  *
1337
1385
  * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
1338
1386
  */
1339
- declare const SDK_VERSION = "0.5.1";
1387
+ declare const SDK_VERSION = "0.9.0";
1340
1388
 
1341
1389
  export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type BootstrapResponse, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, CartManager, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier };
@@ -1,4 +1,4 @@
1
1
  import '../chunk-QYQQ5J6E.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-4ZEN4J7I.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-SNIF67UB.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import './chunk-QYQQ5J6E.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-4ZEN4J7I.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-SNIF67UB.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import * as _lit_react from '@lit/react';
2
- import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-DtqqmAiG.js';
3
- export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-DtqqmAiG.js';
2
+ import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-CrO2ciCS.js';
3
+ export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CrO2ciCS.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
 
@@ -1,6 +1,6 @@
1
- import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-YNKOGPTE.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-YNKOGPTE.js';
3
- import '../chunk-4ZEN4J7I.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-OTL6QM3G.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-OTL6QM3G.js';
3
+ import '../chunk-SNIF67UB.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
@@ -319,6 +319,8 @@ declare class VioCheckout extends LitElement {
319
319
  private kustomMountedOrderId;
320
320
  private qliroMounting;
321
321
  private qliroMountedOrderId;
322
+ private walleyMounting;
323
+ private walleyMountedOrderId;
322
324
  /** Redirecting to the Stripe / Vipps hosted page. */
323
325
  private stripeLoading;
324
326
  private vippsLoading;
@@ -434,6 +436,15 @@ declare class VioCheckout extends LitElement {
434
436
  private mountQliroIfNeeded;
435
437
  private unmountQliro;
436
438
  private renderQliroPanel;
439
+ /**
440
+ * Mount the Walley embedded checkout once it's the chosen method. Unlike
441
+ * Kustom/Qliro, success is signalled INLINE by Walley's own DOM event
442
+ * (`walleyCheckoutPurchaseCompleted`) — no redirect round-trip needed, so
443
+ * we handle it here instead of only in the confirmation-return branch.
444
+ */
445
+ private mountWalleyIfNeeded;
446
+ private unmountWalley;
447
+ private renderWalleyPanel;
437
448
  private renderKlarnaPanel;
438
449
  /** Express layout — only the Klarna widget + a compact order summary. */
439
450
  private renderKlarnaExpress;
@@ -1,4 +1,4 @@
1
- export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-DtqqmAiG.js';
1
+ export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CrO2ciCS.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
4
 
package/dist/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { registerVioElements } from '../chunk-YNKOGPTE.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-YNKOGPTE.js';
3
- import '../chunk-4ZEN4J7I.js';
1
+ import { registerVioElements } from '../chunk-OTL6QM3G.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-OTL6QM3G.js';
3
+ import '../chunk-SNIF67UB.js';
4
4
 
5
5
  // src/ui/index.ts
6
6
  registerVioElements();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vio-live/web-sdk",
3
- "version": "0.8.0",
4
- "description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
3
+ "version": "0.9.0",
4
+ "description": "Vio Web SDK \u2014 in-site shoppable + native checkout, designed for editorial commerce sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",