@vio-live/web-sdk 0.6.0 → 0.7.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.
- package/dist/{chunk-MOKVTWQW.js → chunk-4ZEN4J7I.js} +189 -2
- package/dist/chunk-4ZEN4J7I.js.map +1 -0
- package/dist/{chunk-6X225SGW.js → chunk-GPMDZSC2.js} +246 -6
- package/dist/{chunk-6X225SGW.js.map → chunk-GPMDZSC2.js.map} +1 -1
- package/dist/core/index.d.ts +180 -100
- package/dist/core/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +3 -3
- package/dist/{tokens-TIH4RkPl.d.ts → tokens-CCZuuTN6.d.ts} +12 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-MOKVTWQW.js.map +0 -1
package/dist/core/index.d.ts
CHANGED
|
@@ -640,6 +640,168 @@ declare global {
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
+
/**
|
|
644
|
+
* Vipps MobilePay Payment Adapter — GraphQL Integration & Types.
|
|
645
|
+
*
|
|
646
|
+
* Vipps payment integration uses 2 GraphQL operations:
|
|
647
|
+
*
|
|
648
|
+
* 1. `CreatePaymentVipps` mutation:
|
|
649
|
+
* Initiates a Vipps payment session for a checkout and returns `payment_url`.
|
|
650
|
+
*
|
|
651
|
+
* 2. `GetVippsStatus` query:
|
|
652
|
+
* Queries Vipps payment state directly for a checkout (`state`).
|
|
653
|
+
*/
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* GraphQL mutation to create a Vipps payment session.
|
|
657
|
+
*/
|
|
658
|
+
declare const CREATE_PAYMENT_VIPPS_MUTATION = "\nmutation CreatePaymentVipps($checkoutId: String!, $email: String!, $returnUrl: String!) {\n Payment {\n CreatePaymentVipps(checkout_id: $checkoutId, email: $email, return_url: $returnUrl) {\n payment_url\n }\n }\n}\n";
|
|
659
|
+
/**
|
|
660
|
+
* GraphQL query to fetch current Vipps payment status.
|
|
661
|
+
*/
|
|
662
|
+
declare const GET_VIPPS_STATUS_QUERY = "\nquery GetVippsStatus($checkoutId: String!) {\n Payment {\n GetVippsStatus(checkout_id: $checkoutId) {\n state\n }\n }\n}\n";
|
|
663
|
+
interface CreatePaymentVippsVariables extends Record<string, unknown> {
|
|
664
|
+
checkoutId: string;
|
|
665
|
+
email: string;
|
|
666
|
+
returnUrl: string;
|
|
667
|
+
}
|
|
668
|
+
interface CreatePaymentVippsResponse {
|
|
669
|
+
payment_url: string;
|
|
670
|
+
}
|
|
671
|
+
interface GetVippsStatusVariables extends Record<string, unknown> {
|
|
672
|
+
checkoutId: string;
|
|
673
|
+
}
|
|
674
|
+
interface VippsStatusResult {
|
|
675
|
+
state: string;
|
|
676
|
+
}
|
|
677
|
+
type VippsPaymentState = 'CREATED' | 'INITIATED' | 'AUTHORIZED' | 'TERMINATED' | 'EXPIRED' | string;
|
|
678
|
+
/**
|
|
679
|
+
* Executes the `CreatePaymentVipps` GraphQL mutation.
|
|
680
|
+
*/
|
|
681
|
+
declare function createPaymentVipps(variables: CreatePaymentVippsVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<CreatePaymentVippsResponse | null>;
|
|
682
|
+
/**
|
|
683
|
+
* Executes the `GetVippsStatus` GraphQL query.
|
|
684
|
+
*/
|
|
685
|
+
declare function getVippsStatus(variables: GetVippsStatusVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<VippsStatusResult | null>;
|
|
686
|
+
|
|
687
|
+
declare const CREATE_CART_MUTATION = "\nmutation CreateCart($customerSessionId: String!, $currency: String!, $shippingCountry: String) {\n Cart {\n CreateCart(customer_session_id: $customerSessionId, currency: $currency, shipping_country: $shippingCountry) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
688
|
+
declare const ADD_ITEM_MUTATION = "\nmutation AddItem($cartId: String!, $lineItems: [LineItemInput!]!) {\n Cart {\n AddItem(cart_id: $cartId, line_items: $lineItems) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
689
|
+
declare const DELETE_ITEM_MUTATION = "\nmutation DeleteItem($cartId: String!, $cartItemId: String!) {\n Cart {\n DeleteItem(cart_id: $cartId, cart_item_id: $cartItemId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
690
|
+
declare const UPDATE_ITEM_MUTATION = "\nmutation UpdateItem($cartId: String!, $cartItemId: String!, $shippingId: String, $qty: Int) {\n Cart {\n UpdateItem(cart_id: $cartId, cart_item_id: $cartItemId, shipping_id: $shippingId, qty: $qty) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
691
|
+
declare const GET_CART_QUERY = "\nquery GetCart($cartId: String!) {\n Cart {\n GetCart(cart_id: $cartId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
692
|
+
declare const GET_LINE_ITEMS_BY_SUPPLIER_QUERY = "\nquery GetLineItemsBySupplier($cartId: String!) {\n Cart {\n GetLineItemsBySupplier(cart_id: $cartId) {\n supplier {\n id\n name\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n }\n }\n}\n";
|
|
693
|
+
declare const UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION = "\nmutation UpdateShippingsBySupplier($cartId: String!, $data: [DataUpdateShippingsBySupplier!]!) {\n Cart {\n UpdateShippingsBySupplier(cart_id: $cartId, data: $data) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
694
|
+
declare const CREATE_CHECKOUT_MUTATION = "\nmutation CreateCheckout($cartId: String!) {\n Checkout {\n CreateCheckout(cart_id: $cartId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
695
|
+
declare const UPDATE_CHECKOUT_MUTATION = "\nmutation UpdateCheckout($checkoutId: String!, $status: String, $successUrl: String, $email: String, $cancelUrl: String, $paymentMethod: String, $shippingAddress: AddressArgs, $billingAddress: AddressArgs, $buyerAcceptsPurchaseConditions: Boolean, $buyerAcceptsTermsConditions: Boolean) {\n Checkout {\n UpdateCheckout(checkout_id: $checkoutId, status: $status, success_url: $successUrl, email: $email, cancel_url: $cancelUrl, payment_method: $paymentMethod, shipping_address: $shippingAddress, billing_address: $billingAddress, buyer_accepts_purchase_conditions: $buyerAcceptsPurchaseConditions, buyer_accepts_terms_conditions: $buyerAcceptsTermsConditions) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
696
|
+
declare const GET_CHECKOUT_QUERY = "\nquery GetCheckout($checkoutId: String!) {\n Checkout {\n GetCheckout(checkout_id: $checkoutId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
697
|
+
declare const GET_AVAILABLE_PAYMENT_METHODS_QUERY = "\nquery Config {\n Payment {\n GetAvailablePaymentMethods {\n config {\n name\n type\n value\n }\n name\n }\n }\n}\n";
|
|
698
|
+
/** Transport options for a cart/checkout GraphQL call. */
|
|
699
|
+
interface CartQueryOptions {
|
|
700
|
+
endpoint?: string;
|
|
701
|
+
apiKey?: string;
|
|
702
|
+
/** Sponsor commerce key — goes in the Authorization header. */
|
|
703
|
+
commerceKey?: string;
|
|
704
|
+
/** True when the commerce key came from a resolved sponsor (bootstrap).
|
|
705
|
+
* False = we fell back to the host apiKey — writes like CreateCart should
|
|
706
|
+
* NOT proceed with the wrong key (the cart would be orphaned). */
|
|
707
|
+
sponsorResolved?: boolean;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Resolve endpoint + keys for cart GraphQL calls. Awaits Vio.bootstrap() once
|
|
711
|
+
* if it hasn't run yet (the sponsor commerce keys come from bootstrap), then
|
|
712
|
+
* uses the sponsor's commerce apiKey (via the Vio facade on globalThis,
|
|
713
|
+
* avoiding an import cycle); falls back to the host apiKey.
|
|
714
|
+
*/
|
|
715
|
+
declare function getCartGraphQLOptions(sponsorId?: number): Promise<CartQueryOptions>;
|
|
716
|
+
/** Stable per-browser customer session id (backend CreateCart requires one). */
|
|
717
|
+
declare function getCustomerSessionId(): string;
|
|
718
|
+
interface GraphQLEnvelope {
|
|
719
|
+
data?: Record<string, Record<string, unknown>>;
|
|
720
|
+
errors?: Array<{
|
|
721
|
+
message?: string;
|
|
722
|
+
}>;
|
|
723
|
+
}
|
|
724
|
+
/** Execute a GraphQL query/mutation against the configured commerce endpoint.
|
|
725
|
+
* Callers that skip `getCartGraphQLOptions()` (or pass a bare sponsorId) get
|
|
726
|
+
* it resolved here instead of silently sending an unauthenticated request. */
|
|
727
|
+
declare function executeCartGraphQL(query: string, variables: Record<string, unknown>, options?: CartQueryOptions | number | undefined): Promise<GraphQLEnvelope>;
|
|
728
|
+
declare function createCart(customerSessionId: string, currency: string, shippingCountry?: string | null, options?: CartQueryOptions): Promise<any>;
|
|
729
|
+
declare function addItem(cartId: string, lineItems: unknown[], options?: CartQueryOptions): Promise<any>;
|
|
730
|
+
declare function deleteItem(cartId: string, cartItemId: string, options?: CartQueryOptions): Promise<any>;
|
|
731
|
+
declare function updateItem(cartId: string, cartItemId: string, shippingId?: string | null, qty?: number | null, options?: CartQueryOptions): Promise<any>;
|
|
732
|
+
declare function getCart(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
733
|
+
declare function getLineItemsBySupplier(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
734
|
+
declare function updateShippingsBySupplier(cartId: string, data: unknown[], options?: CartQueryOptions): Promise<any>;
|
|
735
|
+
declare function createCheckout(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
736
|
+
declare function updateCheckout(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
|
|
737
|
+
declare function getCheckout(checkoutId: string, options?: CartQueryOptions): Promise<any>;
|
|
738
|
+
declare function getAvailablePaymentMethods(options?: CartQueryOptions): Promise<any>;
|
|
739
|
+
declare const CREATE_PAYMENT_STRIPE_MUTATION = "\nmutation CreatePaymentStripe($checkoutId: String!, $successUrl: String!, $paymentMethod: String!, $email: String!) {\n Payment {\n CreatePaymentStripe(checkout_id: $checkoutId, success_url: $successUrl, payment_method: $paymentMethod, email: $email) {\n order_id\n checkout_url\n }\n }\n}\n";
|
|
740
|
+
declare function createPaymentStripe(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Kustom (former Klarna Checkout) — embedded KCO v3 checkout.
|
|
744
|
+
*
|
|
745
|
+
* Kustom kept the Klarna Checkout dialect on its own hosts, so the flow is
|
|
746
|
+
* the classic KCO embed:
|
|
747
|
+
*
|
|
748
|
+
* 1. Vio Commerce creates the order (`Payment { CreatePaymentKustom }`,
|
|
749
|
+
* authed with the sponsor's commerce API key; the seller's own
|
|
750
|
+
* kco_*_api_* key lives server-side, per seller, never here).
|
|
751
|
+
* 2. The response's `html_snippet` is injected into a container — it
|
|
752
|
+
* renders Kustom's iframe, which collects address, shipping AND payment
|
|
753
|
+
* by itself (the widget does everything; no Vio address form).
|
|
754
|
+
* 3. On completion Kustom redirects to the confirmation URL
|
|
755
|
+
* (`?order_id=…&payment_processor=KUSTOM`), where the SDK re-reads the
|
|
756
|
+
* order (`Payment { GetKustomOrder }`) and renders its confirmation
|
|
757
|
+
* snippet — KCO's own receipt.
|
|
758
|
+
*
|
|
759
|
+
* The Commerce order itself is created server-side by Kustom's push webhook
|
|
760
|
+
* (shopcart /checkout/payment/kustom/ok) — the browser never confirms money.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
/** KCO order fields the SDK consumes (the full order is much larger). */
|
|
764
|
+
interface KustomOrder {
|
|
765
|
+
order_id: string;
|
|
766
|
+
status: string;
|
|
767
|
+
html_snippet: string;
|
|
768
|
+
purchase_country?: string;
|
|
769
|
+
purchase_currency?: string;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Qliro Checkout — embedded checkout via Vio Commerce.
|
|
774
|
+
*
|
|
775
|
+
* Same embed philosophy as Kustom (the widget collects address, shipping
|
|
776
|
+
* AND payment), different provider API underneath — shopcart normalizes
|
|
777
|
+
* Qliro's Merchant API (OrderId / CustomerCheckoutStatus / OrderHtmlSnippet)
|
|
778
|
+
* to the { order_id, status, html_snippet } shape both flows share:
|
|
779
|
+
*
|
|
780
|
+
* 1. `Payment { CreatePaymentQliro }` creates the order and returns the
|
|
781
|
+
* snippet (sponsor-key authed; the seller's MerchantApiKey/Secret live
|
|
782
|
+
* server-side, per seller, never here).
|
|
783
|
+
* 2. The snippet is injected (script-executing embed, shared with Kustom).
|
|
784
|
+
* 3. On completion Qliro redirects to the confirmation URL
|
|
785
|
+
* (`?checkout_id=…&payment_processor=QLIRO`); the SDK re-reads the
|
|
786
|
+
* order via `Payment { GetQliroOrder(checkout_id) }` — Qliro
|
|
787
|
+
* correlates by the OWNING CHECKOUT, not the order id — and renders
|
|
788
|
+
* the snippet again, which shows Qliro's own receipt.
|
|
789
|
+
*
|
|
790
|
+
* The Commerce order is created server-side by Qliro's push webhook
|
|
791
|
+
* (shopcart /checkout/payment/qliro/ok) — the browser never confirms money.
|
|
792
|
+
*/
|
|
793
|
+
|
|
794
|
+
/** Normalized Qliro order (shopcart maps the PascalCase Merchant API). */
|
|
795
|
+
interface QliroOrder {
|
|
796
|
+
order_id: string;
|
|
797
|
+
/** Qliro CustomerCheckoutStatus: InProcess | Completed | OnHold | Refused. */
|
|
798
|
+
status: string;
|
|
799
|
+
html_snippet: string;
|
|
800
|
+
purchase_country?: string;
|
|
801
|
+
purchase_currency?: string;
|
|
802
|
+
total_price?: number;
|
|
803
|
+
}
|
|
804
|
+
|
|
643
805
|
/**
|
|
644
806
|
* Checkout types — multi-sponsor compatible.
|
|
645
807
|
*
|
|
@@ -647,7 +809,7 @@ declare global {
|
|
|
647
809
|
* merchant, same as iOS multi-sponsor model). Multiple sponsors → multiple
|
|
648
810
|
* sequential checkouts.
|
|
649
811
|
*/
|
|
650
|
-
type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe';
|
|
812
|
+
type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro';
|
|
651
813
|
interface CheckoutAddress {
|
|
652
814
|
firstName: string;
|
|
653
815
|
lastName: string;
|
|
@@ -809,6 +971,23 @@ declare class CheckoutManager extends EventTarget {
|
|
|
809
971
|
getVippsStatus(checkoutId: string, sponsorId?: number): Promise<{
|
|
810
972
|
state?: string;
|
|
811
973
|
} | null>;
|
|
974
|
+
/**
|
|
975
|
+
* Kustom (former Klarna Checkout) — create the KCO order via Vio Commerce
|
|
976
|
+
* and render its html_snippet into `container`. The widget collects
|
|
977
|
+
* address, shipping and payment by itself; the SDK renders nothing else.
|
|
978
|
+
*/
|
|
979
|
+
mountKustomCheckout(container: HTMLElement, sponsorId?: number): Promise<KustomOrder>;
|
|
980
|
+
/** Re-read a Kustom order — used on the confirmation return trip. */
|
|
981
|
+
getKustomOrder(orderId: string, sponsorId?: number): Promise<KustomOrder | null>;
|
|
982
|
+
/** Render a Kustom html_snippet (e.g. the confirmation receipt) into a container. */
|
|
983
|
+
renderKustomSnippet(container: HTMLElement, htmlSnippet: string): void;
|
|
984
|
+
/**
|
|
985
|
+
* Qliro Checkout — create the order via Vio Commerce and render its
|
|
986
|
+
* html_snippet into `container` (widget-does-everything, like Kustom).
|
|
987
|
+
*/
|
|
988
|
+
mountQliroCheckout(container: HTMLElement, sponsorId?: number): Promise<QliroOrder>;
|
|
989
|
+
/** Re-read the Qliro order owned by a checkout — the confirmation trip. */
|
|
990
|
+
getQliroOrder(checkoutId: string, sponsorId?: number): Promise<QliroOrder | null>;
|
|
812
991
|
setAddress(address: CheckoutAddress): void;
|
|
813
992
|
selectPaymentMethod(method: PaymentMethod): void;
|
|
814
993
|
/**
|
|
@@ -1150,105 +1329,6 @@ declare class VioFacade {
|
|
|
1150
1329
|
}
|
|
1151
1330
|
declare const Vio: VioFacade;
|
|
1152
1331
|
|
|
1153
|
-
/**
|
|
1154
|
-
* Vipps MobilePay Payment Adapter — GraphQL Integration & Types.
|
|
1155
|
-
*
|
|
1156
|
-
* Vipps payment integration uses 2 GraphQL operations:
|
|
1157
|
-
*
|
|
1158
|
-
* 1. `CreatePaymentVipps` mutation:
|
|
1159
|
-
* Initiates a Vipps payment session for a checkout and returns `payment_url`.
|
|
1160
|
-
*
|
|
1161
|
-
* 2. `GetVippsStatus` query:
|
|
1162
|
-
* Queries Vipps payment state directly for a checkout (`state`).
|
|
1163
|
-
*/
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* GraphQL mutation to create a Vipps payment session.
|
|
1167
|
-
*/
|
|
1168
|
-
declare const CREATE_PAYMENT_VIPPS_MUTATION = "\nmutation CreatePaymentVipps($checkoutId: String!, $email: String!, $returnUrl: String!) {\n Payment {\n CreatePaymentVipps(checkout_id: $checkoutId, email: $email, return_url: $returnUrl) {\n payment_url\n }\n }\n}\n";
|
|
1169
|
-
/**
|
|
1170
|
-
* GraphQL query to fetch current Vipps payment status.
|
|
1171
|
-
*/
|
|
1172
|
-
declare const GET_VIPPS_STATUS_QUERY = "\nquery GetVippsStatus($checkoutId: String!) {\n Payment {\n GetVippsStatus(checkout_id: $checkoutId) {\n state\n }\n }\n}\n";
|
|
1173
|
-
interface CreatePaymentVippsVariables extends Record<string, unknown> {
|
|
1174
|
-
checkoutId: string;
|
|
1175
|
-
email: string;
|
|
1176
|
-
returnUrl: string;
|
|
1177
|
-
}
|
|
1178
|
-
interface CreatePaymentVippsResponse {
|
|
1179
|
-
payment_url: string;
|
|
1180
|
-
}
|
|
1181
|
-
interface GetVippsStatusVariables extends Record<string, unknown> {
|
|
1182
|
-
checkoutId: string;
|
|
1183
|
-
}
|
|
1184
|
-
interface VippsStatusResult {
|
|
1185
|
-
state: string;
|
|
1186
|
-
}
|
|
1187
|
-
type VippsPaymentState = 'CREATED' | 'INITIATED' | 'AUTHORIZED' | 'TERMINATED' | 'EXPIRED' | string;
|
|
1188
|
-
/**
|
|
1189
|
-
* Executes the `CreatePaymentVipps` GraphQL mutation.
|
|
1190
|
-
*/
|
|
1191
|
-
declare function createPaymentVipps(variables: CreatePaymentVippsVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<CreatePaymentVippsResponse | null>;
|
|
1192
|
-
/**
|
|
1193
|
-
* Executes the `GetVippsStatus` GraphQL query.
|
|
1194
|
-
*/
|
|
1195
|
-
declare function getVippsStatus(variables: GetVippsStatusVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<VippsStatusResult | null>;
|
|
1196
|
-
|
|
1197
|
-
declare const CREATE_CART_MUTATION = "\nmutation CreateCart($customerSessionId: String!, $currency: String!, $shippingCountry: String) {\n Cart {\n CreateCart(customer_session_id: $customerSessionId, currency: $currency, shipping_country: $shippingCountry) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1198
|
-
declare const ADD_ITEM_MUTATION = "\nmutation AddItem($cartId: String!, $lineItems: [LineItemInput!]!) {\n Cart {\n AddItem(cart_id: $cartId, line_items: $lineItems) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1199
|
-
declare const DELETE_ITEM_MUTATION = "\nmutation DeleteItem($cartId: String!, $cartItemId: String!) {\n Cart {\n DeleteItem(cart_id: $cartId, cart_item_id: $cartItemId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1200
|
-
declare const UPDATE_ITEM_MUTATION = "\nmutation UpdateItem($cartId: String!, $cartItemId: String!, $shippingId: String, $qty: Int) {\n Cart {\n UpdateItem(cart_id: $cartId, cart_item_id: $cartItemId, shipping_id: $shippingId, qty: $qty) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1201
|
-
declare const GET_CART_QUERY = "\nquery GetCart($cartId: String!) {\n Cart {\n GetCart(cart_id: $cartId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1202
|
-
declare const GET_LINE_ITEMS_BY_SUPPLIER_QUERY = "\nquery GetLineItemsBySupplier($cartId: String!) {\n Cart {\n GetLineItemsBySupplier(cart_id: $cartId) {\n supplier {\n id\n name\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n }\n }\n}\n";
|
|
1203
|
-
declare const UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION = "\nmutation UpdateShippingsBySupplier($cartId: String!, $data: [DataUpdateShippingsBySupplier!]!) {\n Cart {\n UpdateShippingsBySupplier(cart_id: $cartId, data: $data) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
|
|
1204
|
-
declare const CREATE_CHECKOUT_MUTATION = "\nmutation CreateCheckout($cartId: String!) {\n Checkout {\n CreateCheckout(cart_id: $cartId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
1205
|
-
declare const UPDATE_CHECKOUT_MUTATION = "\nmutation UpdateCheckout($checkoutId: String!, $status: String, $successUrl: String, $email: String, $cancelUrl: String, $paymentMethod: String, $shippingAddress: AddressArgs, $billingAddress: AddressArgs, $buyerAcceptsPurchaseConditions: Boolean, $buyerAcceptsTermsConditions: Boolean) {\n Checkout {\n UpdateCheckout(checkout_id: $checkoutId, status: $status, success_url: $successUrl, email: $email, cancel_url: $cancelUrl, payment_method: $paymentMethod, shipping_address: $shippingAddress, billing_address: $billingAddress, buyer_accepts_purchase_conditions: $buyerAcceptsPurchaseConditions, buyer_accepts_terms_conditions: $buyerAcceptsTermsConditions) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
1206
|
-
declare const GET_CHECKOUT_QUERY = "\nquery GetCheckout($checkoutId: String!) {\n Checkout {\n GetCheckout(checkout_id: $checkoutId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
|
|
1207
|
-
declare const GET_AVAILABLE_PAYMENT_METHODS_QUERY = "\nquery Config {\n Payment {\n GetAvailablePaymentMethods {\n config {\n name\n type\n value\n }\n name\n }\n }\n}\n";
|
|
1208
|
-
/** Transport options for a cart/checkout GraphQL call. */
|
|
1209
|
-
interface CartQueryOptions {
|
|
1210
|
-
endpoint?: string;
|
|
1211
|
-
apiKey?: string;
|
|
1212
|
-
/** Sponsor commerce key — goes in the Authorization header. */
|
|
1213
|
-
commerceKey?: string;
|
|
1214
|
-
/** True when the commerce key came from a resolved sponsor (bootstrap).
|
|
1215
|
-
* False = we fell back to the host apiKey — writes like CreateCart should
|
|
1216
|
-
* NOT proceed with the wrong key (the cart would be orphaned). */
|
|
1217
|
-
sponsorResolved?: boolean;
|
|
1218
|
-
}
|
|
1219
|
-
/**
|
|
1220
|
-
* Resolve endpoint + keys for cart GraphQL calls. Awaits Vio.bootstrap() once
|
|
1221
|
-
* if it hasn't run yet (the sponsor commerce keys come from bootstrap), then
|
|
1222
|
-
* uses the sponsor's commerce apiKey (via the Vio facade on globalThis,
|
|
1223
|
-
* avoiding an import cycle); falls back to the host apiKey.
|
|
1224
|
-
*/
|
|
1225
|
-
declare function getCartGraphQLOptions(sponsorId?: number): Promise<CartQueryOptions>;
|
|
1226
|
-
/** Stable per-browser customer session id (backend CreateCart requires one). */
|
|
1227
|
-
declare function getCustomerSessionId(): string;
|
|
1228
|
-
interface GraphQLEnvelope {
|
|
1229
|
-
data?: Record<string, Record<string, unknown>>;
|
|
1230
|
-
errors?: Array<{
|
|
1231
|
-
message?: string;
|
|
1232
|
-
}>;
|
|
1233
|
-
}
|
|
1234
|
-
/** Execute a GraphQL query/mutation against the configured commerce endpoint.
|
|
1235
|
-
* Callers that skip `getCartGraphQLOptions()` (or pass a bare sponsorId) get
|
|
1236
|
-
* it resolved here instead of silently sending an unauthenticated request. */
|
|
1237
|
-
declare function executeCartGraphQL(query: string, variables: Record<string, unknown>, options?: CartQueryOptions | number | undefined): Promise<GraphQLEnvelope>;
|
|
1238
|
-
declare function createCart(customerSessionId: string, currency: string, shippingCountry?: string | null, options?: CartQueryOptions): Promise<any>;
|
|
1239
|
-
declare function addItem(cartId: string, lineItems: unknown[], options?: CartQueryOptions): Promise<any>;
|
|
1240
|
-
declare function deleteItem(cartId: string, cartItemId: string, options?: CartQueryOptions): Promise<any>;
|
|
1241
|
-
declare function updateItem(cartId: string, cartItemId: string, shippingId?: string | null, qty?: number | null, options?: CartQueryOptions): Promise<any>;
|
|
1242
|
-
declare function getCart(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
1243
|
-
declare function getLineItemsBySupplier(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
1244
|
-
declare function updateShippingsBySupplier(cartId: string, data: unknown[], options?: CartQueryOptions): Promise<any>;
|
|
1245
|
-
declare function createCheckout(cartId: string, options?: CartQueryOptions): Promise<any>;
|
|
1246
|
-
declare function updateCheckout(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
|
|
1247
|
-
declare function getCheckout(checkoutId: string, options?: CartQueryOptions): Promise<any>;
|
|
1248
|
-
declare function getAvailablePaymentMethods(options?: CartQueryOptions): Promise<any>;
|
|
1249
|
-
declare const CREATE_PAYMENT_STRIPE_MUTATION = "\nmutation CreatePaymentStripe($checkoutId: String!, $successUrl: String!, $paymentMethod: String!, $email: String!) {\n Payment {\n CreatePaymentStripe(checkout_id: $checkoutId, success_url: $successUrl, payment_method: $paymentMethod, email: $email) {\n order_id\n checkout_url\n }\n }\n}\n";
|
|
1250
|
-
declare function createPaymentStripe(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
|
|
1251
|
-
|
|
1252
1332
|
/**
|
|
1253
1333
|
* SDK version reported in analytics events (`sdk_version`) and available
|
|
1254
1334
|
* to consumers. Kept as a constant (not a package.json import) so the
|
package/dist/core/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-
|
|
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';
|
|
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-
|
|
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';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.d.ts
CHANGED
|
@@ -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-
|
|
3
|
-
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-
|
|
2
|
+
import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-CCZuuTN6.js';
|
|
3
|
+
export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CCZuuTN6.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
6
|
|
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-
|
|
2
|
-
export { VioTokens, applyVioTheme } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-GPMDZSC2.js';
|
|
2
|
+
export { VioTokens, applyVioTheme } from '../chunk-GPMDZSC2.js';
|
|
3
|
+
import '../chunk-4ZEN4J7I.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
6
|
// node_modules/@lit/react/node/create-component.js
|
|
@@ -315,6 +315,10 @@ declare class VioCheckout extends LitElement {
|
|
|
315
315
|
/** Payment method names enabled for the sponsor (backend-configured).
|
|
316
316
|
* null = not loaded yet → all buttons render; [] = none enabled. */
|
|
317
317
|
private availableMethods;
|
|
318
|
+
private kustomMounting;
|
|
319
|
+
private kustomMountedOrderId;
|
|
320
|
+
private qliroMounting;
|
|
321
|
+
private qliroMountedOrderId;
|
|
318
322
|
/** Redirecting to the Stripe / Vipps hosted page. */
|
|
319
323
|
private stripeLoading;
|
|
320
324
|
private vippsLoading;
|
|
@@ -422,6 +426,14 @@ declare class VioCheckout extends LitElement {
|
|
|
422
426
|
render(): lit_html.TemplateResult<1>;
|
|
423
427
|
private renderConfirmation;
|
|
424
428
|
/** Klarna Payments widget panel: shipping + category chips + widget + pay button. */
|
|
429
|
+
/** Mount the Kustom embedded checkout once it's the chosen method. */
|
|
430
|
+
private mountKustomIfNeeded;
|
|
431
|
+
private unmountKustom;
|
|
432
|
+
private renderKustomPanel;
|
|
433
|
+
/** Mount the Qliro embedded checkout once it's the chosen method. */
|
|
434
|
+
private mountQliroIfNeeded;
|
|
435
|
+
private unmountQliro;
|
|
436
|
+
private renderQliroPanel;
|
|
425
437
|
private renderKlarnaPanel;
|
|
426
438
|
/** Express layout — only the Klarna widget + a compact order summary. */
|
|
427
439
|
private renderKlarnaExpress;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -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-
|
|
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-CCZuuTN6.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-
|
|
2
|
-
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { registerVioElements } from '../chunk-GPMDZSC2.js';
|
|
2
|
+
export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-GPMDZSC2.js';
|
|
3
|
+
import '../chunk-4ZEN4J7I.js';
|
|
4
4
|
|
|
5
5
|
// src/ui/index.ts
|
|
6
6
|
registerVioElements();
|