@wix/auto_sdk_payments_checkout-sessions 1.0.11 → 1.0.12

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +1 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.d.ts +7 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.d.ts +7 -1
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/schemas.d.ts +3 -0
  8. package/build/cjs/schemas.js +5 -0
  9. package/build/cjs/schemas.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs.map +1 -1
  12. package/build/es/index.typings.d.mts +7 -1
  13. package/build/es/index.typings.mjs.map +1 -1
  14. package/build/es/meta.d.mts +7 -1
  15. package/build/es/meta.mjs.map +1 -1
  16. package/build/es/schemas.d.mts +3 -0
  17. package/build/es/schemas.mjs +5 -0
  18. package/build/es/schemas.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +1 -1
  20. package/build/internal/cjs/index.js.map +1 -1
  21. package/build/internal/cjs/index.typings.d.ts +7 -1
  22. package/build/internal/cjs/index.typings.js.map +1 -1
  23. package/build/internal/cjs/meta.d.ts +7 -1
  24. package/build/internal/cjs/meta.js.map +1 -1
  25. package/build/internal/cjs/schemas.d.ts +3 -0
  26. package/build/internal/cjs/schemas.js +5 -0
  27. package/build/internal/cjs/schemas.js.map +1 -1
  28. package/build/internal/es/index.d.mts +1 -1
  29. package/build/internal/es/index.mjs.map +1 -1
  30. package/build/internal/es/index.typings.d.mts +7 -1
  31. package/build/internal/es/index.typings.mjs.map +1 -1
  32. package/build/internal/es/meta.d.mts +7 -1
  33. package/build/internal/es/meta.mjs.map +1 -1
  34. package/build/internal/es/schemas.d.mts +3 -0
  35. package/build/internal/es/schemas.mjs +5 -0
  36. package/build/internal/es/schemas.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { Cart, ConstructCheckoutSessionOptions, ConstructCheckoutSessionResponse, ConstructCheckoutSessionApplicationErrors } from './index.typings.js';
3
- export { CallbackUrls, CheckoutSession, ConstructCheckoutSessionRequest, CustomerInfo, FreeTrialPeriod, LineItem, RegisterCheckoutSessionWebhookRequest, RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionInfo, SubscriptionSettings, WebhookType, WebhookTypeWithLiterals } from './index.typings.js';
3
+ export { CallbackUrls, CheckoutSession, ConstructCheckoutSessionRequest, CustomerInfo, FreeTrialPeriod, LineItem, PhysicalProperties, RegisterCheckoutSessionWebhookRequest, RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionInfo, SubscriptionSettings, WebhookType, WebhookTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function constructCheckoutSession$1(httpClient: HttpClient): ConstructCheckoutSessionSignature;
6
6
  interface ConstructCheckoutSessionSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.public.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.context.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Cart,\n ConstructCheckoutSessionApplicationErrors,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionResponse,\n constructCheckoutSession as universalConstructCheckoutSession,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function constructCheckoutSession(\n httpClient: HttpClient\n): ConstructCheckoutSessionSignature {\n return (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ) =>\n universalConstructCheckoutSession(\n cart,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConstructCheckoutSessionSignature {\n /**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @returns Response after creating a checkout session.\n */\n (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n >;\n}\n\nexport {\n CallbackUrls,\n Cart,\n CheckoutSession,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionRequest,\n ConstructCheckoutSessionResponse,\n CustomerInfo,\n FreeTrialPeriod,\n LineItem,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n SubscriptionFrequency,\n SubscriptionInfo,\n SubscriptionSettings,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { constructCheckoutSession as publicConstructCheckoutSession } from './payments-platform-v1-checkout-session-checkout-sessions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const constructCheckoutSession: MaybeContext<\n BuildRESTFunction<typeof publicConstructCheckoutSession> &\n typeof publicConstructCheckoutSession\n> = /*#__PURE__*/ createRESTModule(publicConstructCheckoutSession);\n\nexport {\n SubscriptionFrequency,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n CheckoutSession,\n ConstructCheckoutSessionRequest,\n SubscriptionInfo,\n SubscriptionSettings,\n FreeTrialPeriod,\n LineItem,\n CustomerInfo,\n Cart,\n CallbackUrls,\n ConstructCheckoutSessionResponse,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n ConstructCheckoutSessionOptions,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n SubscriptionFrequencyWithLiterals,\n WebhookTypeWithLiterals,\n ConstructCheckoutSessionApplicationErrors,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AAsKL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3YO,SAASC,0BACd,YACmC;AACnC,SAAO,CACL,MAWA,YAQAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvCA,IAAAC,uBAAiC;AAG1B,IAAMC,4BAGK,2DAAiBA,yBAA8B;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession","sdkTransformError","constructCheckoutSession","import_rest_modules","constructCheckoutSession"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.public.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.context.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface PhysicalProperties {\n /** Whether the item requires shipping. */\n shippable?: boolean | null;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n /** Optional. Physical properties of the item, used when the item requires shipping. */\n physicalProperties?: PhysicalProperties;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Cart,\n ConstructCheckoutSessionApplicationErrors,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionResponse,\n constructCheckoutSession as universalConstructCheckoutSession,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function constructCheckoutSession(\n httpClient: HttpClient\n): ConstructCheckoutSessionSignature {\n return (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ) =>\n universalConstructCheckoutSession(\n cart,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConstructCheckoutSessionSignature {\n /**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @returns Response after creating a checkout session.\n */\n (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n >;\n}\n\nexport {\n CallbackUrls,\n Cart,\n CheckoutSession,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionRequest,\n ConstructCheckoutSessionResponse,\n CustomerInfo,\n FreeTrialPeriod,\n LineItem,\n PhysicalProperties,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n SubscriptionFrequency,\n SubscriptionInfo,\n SubscriptionSettings,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { constructCheckoutSession as publicConstructCheckoutSession } from './payments-platform-v1-checkout-session-checkout-sessions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const constructCheckoutSession: MaybeContext<\n BuildRESTFunction<typeof publicConstructCheckoutSession> &\n typeof publicConstructCheckoutSession\n> = /*#__PURE__*/ createRESTModule(publicConstructCheckoutSession);\n\nexport {\n SubscriptionFrequency,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n CheckoutSession,\n ConstructCheckoutSessionRequest,\n SubscriptionInfo,\n SubscriptionSettings,\n FreeTrialPeriod,\n PhysicalProperties,\n LineItem,\n CustomerInfo,\n Cart,\n CallbackUrls,\n ConstructCheckoutSessionResponse,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n ConstructCheckoutSessionOptions,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n SubscriptionFrequencyWithLiterals,\n WebhookTypeWithLiterals,\n ConstructCheckoutSessionApplicationErrors,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AA6KL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AElZO,SAASC,0BACd,YACmC;AACnC,SAAO,CACL,MAWA,YAQAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvCA,IAAAC,uBAAiC;AAG1B,IAAMC,4BAGK,2DAAiBA,yBAA8B;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession","sdkTransformError","constructCheckoutSession","import_rest_modules","constructCheckoutSession"]}
@@ -132,6 +132,10 @@ interface FreeTrialPeriod {
132
132
  */
133
133
  interval?: number;
134
134
  }
135
+ interface PhysicalProperties {
136
+ /** Whether the item requires shipping. */
137
+ shippable?: boolean | null;
138
+ }
135
139
  interface LineItem {
136
140
  /**
137
141
  * Name of the item, shown on the checkout page.
@@ -159,6 +163,8 @@ interface LineItem {
159
163
  * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.
160
164
  */
161
165
  subscriptionInfo?: SubscriptionInfo;
166
+ /** Optional. Physical properties of the item, used when the item requires shipping. */
167
+ physicalProperties?: PhysicalProperties;
162
168
  }
163
169
  /**
164
170
  * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the
@@ -314,4 +320,4 @@ interface ConstructCheckoutSessionOptions {
314
320
  callbackUrls: CallbackUrls;
315
321
  }
316
322
 
317
- export { type CallbackUrls, type Cart, type CheckoutSession, type ConstructCheckoutSessionApplicationErrors, type ConstructCheckoutSessionOptions, type ConstructCheckoutSessionRequest, type ConstructCheckoutSessionResponse, type CustomerInfo, type FreeTrialPeriod, type LineItem, type RegisterCheckoutSessionWebhookRequest, type RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionInfo, type SubscriptionSettings, WebhookType, type WebhookTypeWithLiterals, constructCheckoutSession };
323
+ export { type CallbackUrls, type Cart, type CheckoutSession, type ConstructCheckoutSessionApplicationErrors, type ConstructCheckoutSessionOptions, type ConstructCheckoutSessionRequest, type ConstructCheckoutSessionResponse, type CustomerInfo, type FreeTrialPeriod, type LineItem, type PhysicalProperties, type RegisterCheckoutSessionWebhookRequest, type RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionInfo, type SubscriptionSettings, WebhookType, type WebhookTypeWithLiterals, constructCheckoutSession };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AAsKL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession","sdkTransformError"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface PhysicalProperties {\n /** Whether the item requires shipping. */\n shippable?: boolean | null;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n /** Optional. Physical properties of the item, used when the item requires shipping. */\n physicalProperties?: PhysicalProperties;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AA6KL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession","sdkTransformError"]}
@@ -133,6 +133,10 @@ interface FreeTrialPeriod {
133
133
  */
134
134
  interval?: number;
135
135
  }
136
+ interface PhysicalProperties {
137
+ /** Whether the item requires shipping. */
138
+ shippable?: boolean | null;
139
+ }
136
140
  interface LineItem {
137
141
  /**
138
142
  * Name of the item, shown on the checkout page.
@@ -160,6 +164,8 @@ interface LineItem {
160
164
  * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.
161
165
  */
162
166
  subscriptionInfo?: SubscriptionInfo;
167
+ /** Optional. Physical properties of the item, used when the item requires shipping. */
168
+ physicalProperties?: PhysicalProperties;
163
169
  }
164
170
  /**
165
171
  * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the
@@ -295,4 +301,4 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
295
301
  };
296
302
  declare function constructCheckoutSession(): __PublicMethodMetaInfo<'POST', {}, ConstructCheckoutSessionRequest$1, ConstructCheckoutSessionRequest, ConstructCheckoutSessionResponse$1, ConstructCheckoutSessionResponse>;
297
303
 
298
- export { type CallbackUrls as CallbackUrlsOriginal, type Cart as CartOriginal, type CheckoutSession as CheckoutSessionOriginal, type ConstructCheckoutSessionApplicationErrors as ConstructCheckoutSessionApplicationErrorsOriginal, type ConstructCheckoutSessionRequest as ConstructCheckoutSessionRequestOriginal, type ConstructCheckoutSessionResponse as ConstructCheckoutSessionResponseOriginal, type CustomerInfo as CustomerInfoOriginal, type FreeTrialPeriod as FreeTrialPeriodOriginal, type LineItem as LineItemOriginal, type RegisterCheckoutSessionWebhookRequest as RegisterCheckoutSessionWebhookRequestOriginal, type RegisterCheckoutSessionWebhookResponse as RegisterCheckoutSessionWebhookResponseOriginal, SubscriptionFrequency as SubscriptionFrequencyOriginal, type SubscriptionFrequencyWithLiterals as SubscriptionFrequencyWithLiteralsOriginal, type SubscriptionInfo as SubscriptionInfoOriginal, type SubscriptionSettings as SubscriptionSettingsOriginal, WebhookType as WebhookTypeOriginal, type WebhookTypeWithLiterals as WebhookTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, constructCheckoutSession };
304
+ export { type CallbackUrls as CallbackUrlsOriginal, type Cart as CartOriginal, type CheckoutSession as CheckoutSessionOriginal, type ConstructCheckoutSessionApplicationErrors as ConstructCheckoutSessionApplicationErrorsOriginal, type ConstructCheckoutSessionRequest as ConstructCheckoutSessionRequestOriginal, type ConstructCheckoutSessionResponse as ConstructCheckoutSessionResponseOriginal, type CustomerInfo as CustomerInfoOriginal, type FreeTrialPeriod as FreeTrialPeriodOriginal, type LineItem as LineItemOriginal, type PhysicalProperties as PhysicalPropertiesOriginal, type RegisterCheckoutSessionWebhookRequest as RegisterCheckoutSessionWebhookRequestOriginal, type RegisterCheckoutSessionWebhookResponse as RegisterCheckoutSessionWebhookResponseOriginal, SubscriptionFrequency as SubscriptionFrequencyOriginal, type SubscriptionFrequencyWithLiterals as SubscriptionFrequencyWithLiteralsOriginal, type SubscriptionInfo as SubscriptionInfoOriginal, type SubscriptionSettings as SubscriptionSettingsOriginal, WebhookType as WebhookTypeOriginal, type WebhookTypeWithLiterals as WebhookTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, constructCheckoutSession };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.types.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.meta.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n","import * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSessionTypes from './payments-platform-v1-checkout-session-checkout-sessions.types.js';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function constructCheckoutSession(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes.ConstructCheckoutSessionRequest,\n ambassadorWixPaymentsPlatformV1CheckoutSessionTypes.ConstructCheckoutSessionRequest,\n ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes.ConstructCheckoutSessionResponse,\n ambassadorWixPaymentsPlatformV1CheckoutSessionTypes.ConstructCheckoutSessionResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/checkout-sessions/construct',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n CheckoutSession as CheckoutSessionOriginal,\n ConstructCheckoutSessionRequest as ConstructCheckoutSessionRequestOriginal,\n SubscriptionInfo as SubscriptionInfoOriginal,\n SubscriptionSettings as SubscriptionSettingsOriginal,\n SubscriptionFrequency as SubscriptionFrequencyOriginal,\n SubscriptionFrequencyWithLiterals as SubscriptionFrequencyWithLiteralsOriginal,\n FreeTrialPeriod as FreeTrialPeriodOriginal,\n LineItem as LineItemOriginal,\n CustomerInfo as CustomerInfoOriginal,\n Cart as CartOriginal,\n CallbackUrls as CallbackUrlsOriginal,\n ConstructCheckoutSessionResponse as ConstructCheckoutSessionResponseOriginal,\n RegisterCheckoutSessionWebhookRequest as RegisterCheckoutSessionWebhookRequestOriginal,\n WebhookType as WebhookTypeOriginal,\n WebhookTypeWithLiterals as WebhookTypeWithLiteralsOriginal,\n RegisterCheckoutSessionWebhookResponse as RegisterCheckoutSessionWebhookResponseOriginal,\n ConstructCheckoutSessionApplicationErrors as ConstructCheckoutSessionApplicationErrorsOriginal,\n} from './payments-platform-v1-checkout-session-checkout-sessions.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC+BO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AAsKL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;;;ACpPL,SAASC,4BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.types.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.meta.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.meta.js';\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface PhysicalProperties {\n /** Whether the item requires shipping. */\n shippable?: boolean | null;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n /** Optional. Physical properties of the item, used when the item requires shipping. */\n physicalProperties?: PhysicalProperties;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n","import * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSessionTypes from './payments-platform-v1-checkout-session-checkout-sessions.types.js';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function constructCheckoutSession(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes.ConstructCheckoutSessionRequest,\n ambassadorWixPaymentsPlatformV1CheckoutSessionTypes.ConstructCheckoutSessionRequest,\n ambassadorWixPaymentsPlatformV1CheckoutSessionUniversalTypes.ConstructCheckoutSessionResponse,\n ambassadorWixPaymentsPlatformV1CheckoutSessionTypes.ConstructCheckoutSessionResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/checkout-sessions/construct',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n CheckoutSession as CheckoutSessionOriginal,\n ConstructCheckoutSessionRequest as ConstructCheckoutSessionRequestOriginal,\n SubscriptionInfo as SubscriptionInfoOriginal,\n SubscriptionSettings as SubscriptionSettingsOriginal,\n SubscriptionFrequency as SubscriptionFrequencyOriginal,\n SubscriptionFrequencyWithLiterals as SubscriptionFrequencyWithLiteralsOriginal,\n FreeTrialPeriod as FreeTrialPeriodOriginal,\n PhysicalProperties as PhysicalPropertiesOriginal,\n LineItem as LineItemOriginal,\n CustomerInfo as CustomerInfoOriginal,\n Cart as CartOriginal,\n CallbackUrls as CallbackUrlsOriginal,\n ConstructCheckoutSessionResponse as ConstructCheckoutSessionResponseOriginal,\n RegisterCheckoutSessionWebhookRequest as RegisterCheckoutSessionWebhookRequestOriginal,\n WebhookType as WebhookTypeOriginal,\n WebhookTypeWithLiterals as WebhookTypeWithLiteralsOriginal,\n RegisterCheckoutSessionWebhookResponse as RegisterCheckoutSessionWebhookResponseOriginal,\n ConstructCheckoutSessionApplicationErrors as ConstructCheckoutSessionApplicationErrorsOriginal,\n} from './payments-platform-v1-checkout-session-checkout-sessions.types.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACAA,0BAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC+BO,IAAK,wBAAL,kBAAKC,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AA6KL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;;;AC3PL,SAASC,4BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["constructCheckoutSession","SubscriptionFrequency","WebhookType","constructCheckoutSession"]}
@@ -32,6 +32,9 @@ declare const ConstructCheckoutSessionRequest: z.ZodObject<{
32
32
  title: z.ZodNullable<z.ZodOptional<z.ZodString>>;
33
33
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
34
34
  }, z.core.$strip>>;
35
+ physicalProperties: z.ZodOptional<z.ZodObject<{
36
+ shippable: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
37
+ }, z.core.$strip>>;
35
38
  }, z.core.$strip>>;
36
39
  customerInfo: z.ZodOptional<z.ZodObject<{
37
40
  firstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -87,6 +87,11 @@ var ConstructCheckoutSessionRequest = z.object({
87
87
  ).max(500).optional().nullable()
88
88
  }).describe(
89
89
  "Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\ncycle is `price \xD7 quantity`, and `quantity` is locked at session creation.\n\nAt most one line item per request may set `subscriptionInfo`. Requests with two or more\nsubscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`."
90
+ ).optional(),
91
+ physicalProperties: z.object({
92
+ shippable: z.boolean().describe("Whether the item requires shipping.").optional().nullable()
93
+ }).describe(
94
+ "Optional. Physical properties of the item, used when the item requires shipping."
90
95
  ).optional()
91
96
  })
92
97
  ).max(100),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../schemas.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.schemas.js';\n","import * as z from 'zod';\n\nexport const ConstructCheckoutSessionRequest = z.object({\n cart: z\n .object({\n items: z\n .array(\n z.object({\n name: z\n .string()\n .describe('Name of the item, shown on the checkout page.')\n .min(1)\n .max(255),\n quantity: z\n .number()\n .int()\n .describe('Quantity of this item to charge for.')\n .min(1),\n price: z\n .string()\n .describe(\n 'Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.'\n )\n .min(1)\n .max(50),\n subscriptionInfo: z\n .object({\n subscriptionSettings: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n 'Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\\nbilling cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\\n\\nNote that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\\n`interval` as low as 1.'\n )\n .min(1)\n .max(3650)\n .optional()\n .nullable(),\n autoRenewal: z\n .boolean()\n .describe(\n 'Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\\n\\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\\nis set and `autoRenewal` is omitted.'\n )\n .optional()\n .nullable(),\n billingCycles: z\n .number()\n .int()\n .describe(\n 'Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\\n\\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely.'\n )\n .min(1)\n .optional()\n .nullable(),\n freeTrialPeriod: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\\ngives a 14-day trial.\\n\\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\\nrestriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\\n`MIN_VALUE`).\"\n )\n .min(1)\n .max(999)\n .optional(),\n })\n .describe('Free trial period before the first charge.')\n .optional(),\n })\n .describe(\n 'Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\\nline item.'\n ),\n title: z\n .string()\n .describe(\n 'Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\\ncheckout page (the heading of that block).'\n )\n .max(150)\n .optional()\n .nullable(),\n description: z\n .string()\n .describe(\n 'Subscription description shown to the buyer in the recurring-billing summary block on the\\nWix-hosted checkout page (the body text below the title).'\n )\n .max(500)\n .optional()\n .nullable(),\n })\n .describe(\n 'Subscription configuration. When set, the line item follows a scheduled-billing model defined by\\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\\ncycle is `price × quantity`, and `quantity` is locked at session creation.\\n\\nAt most one line item per request may set `subscriptionInfo`. Requests with two or more\\nsubscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.'\n )\n .optional(),\n })\n )\n .max(100),\n customerInfo: z\n .object({\n firstName: z\n .string()\n .describe(\"Buyer's first name.\")\n .max(100)\n .optional()\n .nullable(),\n lastName: z\n .string()\n .describe(\"Buyer's last name.\")\n .max(100)\n .optional()\n .nullable(),\n phone: z\n .string()\n .describe(\"Buyer's phone number.\")\n .optional()\n .nullable(),\n email: z\n .string()\n .describe(\"Buyer's email address.\")\n .email()\n .optional()\n .nullable(),\n })\n .describe(\n 'Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\\nWix checkout page.'\n )\n .optional(),\n })\n .describe(\n 'Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.'\n ),\n options: z.object({\n callbackUrls: z\n .object({\n postFlowUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment — both when they click **Continue browsing** and when they navigate back to\\na cart-style page.'\n )\n .url(),\n thankYouPageUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to after a successful payment.'\n )\n .url(),\n })\n .describe(\n 'URLs the buyer is redirected to after completing or leaving the checkout flow.'\n ),\n }),\n});\nexport const ConstructCheckoutSessionResponse = z.object({\n checkoutSession: z\n .object({\n _id: z\n .string()\n .describe(\n 'Checkout session ID, generated by this call. The caller does not supply it.'\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n redirectUrl: z\n .string()\n .describe(\n 'URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\\nan anonymous shopper; any session held by the calling app is not carried over.\\n\\nThe URL carries query parameters Wix needs in order to render the page correctly (for example, a\\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\\nbuyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.'\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe('The created checkout session.')\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,kCAAoC,SAAO;AAAA,EACtD,MACG,SAAO;AAAA,IACN,OACG;AAAA,MACG,SAAO;AAAA,QACP,MACG,SAAO,EACP,SAAS,+CAA+C,EACxD,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,QACV,UACG,SAAO,EACP,IAAI,EACJ,SAAS,sCAAsC,EAC/C,IAAI,CAAC;AAAA,QACR,OACG,SAAO,EACP;AAAA,UACC;AAAA,QACF,EACC,IAAI,CAAC,EACL,IAAI,EAAE;AAAA,QACT,kBACG,SAAO;AAAA,UACN,sBACG,SAAO;AAAA,YACN,WAAa,OAAK;AAAA,cAChB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,YACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,IAAI,IAAI,EACR,SAAS,EACT,SAAS;AAAA,YACZ,aACG,UAAQ,EACR;AAAA,cACC;AAAA,YACF,EACC,SAAS,EACT,SAAS;AAAA,YACZ,eACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,SAAS,EACT,SAAS;AAAA,YACZ,iBACG,SAAO;AAAA,cACN,WAAa,OAAK;AAAA,gBAChB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACF,CAAC;AAAA,cACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,gBACC;AAAA,cACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG,EACP,SAAS;AAAA,YACd,CAAC,EACA,SAAS,4CAA4C,EACrD,SAAS;AAAA,UACd,CAAC,EACA;AAAA,YACC;AAAA,UACF;AAAA,UACF,OACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,UACZ,aACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA;AAAA,UACC;AAAA,QACF,EACC,SAAS;AAAA,MACd,CAAC;AAAA,IACH,EACC,IAAI,GAAG;AAAA,IACV,cACG,SAAO;AAAA,MACN,WACG,SAAO,EACP,SAAS,qBAAqB,EAC9B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,UACG,SAAO,EACP,SAAS,oBAAoB,EAC7B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,uBAAuB,EAChC,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,wBAAwB,EACjC,MAAM,EACN,SAAS,EACT,SAAS;AAAA,IACd,CAAC,EACA;AAAA,MACC;AAAA,IACF,EACC,SAAS;AAAA,EACd,CAAC,EACA;AAAA,IACC;AAAA,EACF;AAAA,EACF,SAAW,SAAO;AAAA,IAChB,cACG,SAAO;AAAA,MACN,aACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI;AAAA,MACP,iBACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI;AAAA,IACT,CAAC,EACA;AAAA,MACC;AAAA,IACF;AAAA,EACJ,CAAC;AACH,CAAC;AACM,IAAM,mCAAqC,SAAO;AAAA,EACvD,iBACG,SAAO;AAAA,IACN,KACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS,EACT,SAAS;AAAA,IACZ,aACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,EACJ,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS,+BAA+B,EACxC,SAAS;AACd,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../schemas.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.schemas.ts"],"sourcesContent":["export * from './src/payments-platform-v1-checkout-session-checkout-sessions.schemas.js';\n","import * as z from 'zod';\n\nexport const ConstructCheckoutSessionRequest = z.object({\n cart: z\n .object({\n items: z\n .array(\n z.object({\n name: z\n .string()\n .describe('Name of the item, shown on the checkout page.')\n .min(1)\n .max(255),\n quantity: z\n .number()\n .int()\n .describe('Quantity of this item to charge for.')\n .min(1),\n price: z\n .string()\n .describe(\n 'Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.'\n )\n .min(1)\n .max(50),\n subscriptionInfo: z\n .object({\n subscriptionSettings: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n 'Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\\nbilling cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\\n`INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\\n\\nNote that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\\n`interval` as low as 1.'\n )\n .min(1)\n .max(3650)\n .optional()\n .nullable(),\n autoRenewal: z\n .boolean()\n .describe(\n 'Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\\n\\nDefault: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\\nis set and `autoRenewal` is omitted.'\n )\n .optional()\n .nullable(),\n billingCycles: z\n .number()\n .int()\n .describe(\n 'Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\\n\\nWhen omitted along with `autoRenewal`, the subscription renews indefinitely.'\n )\n .min(1)\n .optional()\n .nullable(),\n freeTrialPeriod: z\n .object({\n frequency: z.enum([\n 'UNDEFINED',\n 'DAY',\n 'WEEK',\n 'MONTH',\n 'YEAR',\n ]),\n interval: z\n .number()\n .int()\n .describe(\n \"Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\\ngives a 14-day trial.\\n\\nUnlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\\nrestriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\\n`MIN_VALUE`).\"\n )\n .min(1)\n .max(999)\n .optional(),\n })\n .describe('Free trial period before the first charge.')\n .optional(),\n })\n .describe(\n 'Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\\nline item.'\n ),\n title: z\n .string()\n .describe(\n 'Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\\ncheckout page (the heading of that block).'\n )\n .max(150)\n .optional()\n .nullable(),\n description: z\n .string()\n .describe(\n 'Subscription description shown to the buyer in the recurring-billing summary block on the\\nWix-hosted checkout page (the body text below the title).'\n )\n .max(500)\n .optional()\n .nullable(),\n })\n .describe(\n 'Subscription configuration. When set, the line item follows a scheduled-billing model defined by\\n`subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\\ncycle is `price × quantity`, and `quantity` is locked at session creation.\\n\\nAt most one line item per request may set `subscriptionInfo`. Requests with two or more\\nsubscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.'\n )\n .optional(),\n physicalProperties: z\n .object({\n shippable: z\n .boolean()\n .describe('Whether the item requires shipping.')\n .optional()\n .nullable(),\n })\n .describe(\n 'Optional. Physical properties of the item, used when the item requires shipping.'\n )\n .optional(),\n })\n )\n .max(100),\n customerInfo: z\n .object({\n firstName: z\n .string()\n .describe(\"Buyer's first name.\")\n .max(100)\n .optional()\n .nullable(),\n lastName: z\n .string()\n .describe(\"Buyer's last name.\")\n .max(100)\n .optional()\n .nullable(),\n phone: z\n .string()\n .describe(\"Buyer's phone number.\")\n .optional()\n .nullable(),\n email: z\n .string()\n .describe(\"Buyer's email address.\")\n .email()\n .optional()\n .nullable(),\n })\n .describe(\n 'Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\\nWix checkout page.'\n )\n .optional(),\n })\n .describe(\n 'Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.'\n ),\n options: z.object({\n callbackUrls: z\n .object({\n postFlowUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to from the Wix checkout page when they choose to leave without\\ncompleting payment — both when they click **Continue browsing** and when they navigate back to\\na cart-style page.'\n )\n .url(),\n thankYouPageUrl: z\n .string()\n .describe(\n 'URL the buyer is redirected to after a successful payment.'\n )\n .url(),\n })\n .describe(\n 'URLs the buyer is redirected to after completing or leaving the checkout flow.'\n ),\n }),\n});\nexport const ConstructCheckoutSessionResponse = z.object({\n checkoutSession: z\n .object({\n _id: z\n .string()\n .describe(\n 'Checkout session ID, generated by this call. The caller does not supply it.'\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n redirectUrl: z\n .string()\n .describe(\n 'URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\\nan anonymous shopper; any session held by the calling app is not carried over.\\n\\nThe URL carries query parameters Wix needs in order to render the page correctly (for example, a\\n`successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\\nbuyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.'\n )\n .url()\n .optional()\n .nullable(),\n })\n .describe('The created checkout session.')\n .optional(),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,kCAAoC,SAAO;AAAA,EACtD,MACG,SAAO;AAAA,IACN,OACG;AAAA,MACG,SAAO;AAAA,QACP,MACG,SAAO,EACP,SAAS,+CAA+C,EACxD,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,QACV,UACG,SAAO,EACP,IAAI,EACJ,SAAS,sCAAsC,EAC/C,IAAI,CAAC;AAAA,QACR,OACG,SAAO,EACP;AAAA,UACC;AAAA,QACF,EACC,IAAI,CAAC,EACL,IAAI,EAAE;AAAA,QACT,kBACG,SAAO;AAAA,UACN,sBACG,SAAO;AAAA,YACN,WAAa,OAAK;AAAA,cAChB;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YACF,CAAC;AAAA,YACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,IAAI,IAAI,EACR,SAAS,EACT,SAAS;AAAA,YACZ,aACG,UAAQ,EACR;AAAA,cACC;AAAA,YACF,EACC,SAAS,EACT,SAAS;AAAA,YACZ,eACG,SAAO,EACP,IAAI,EACJ;AAAA,cACC;AAAA,YACF,EACC,IAAI,CAAC,EACL,SAAS,EACT,SAAS;AAAA,YACZ,iBACG,SAAO;AAAA,cACN,WAAa,OAAK;AAAA,gBAChB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACF,CAAC;AAAA,cACD,UACG,SAAO,EACP,IAAI,EACJ;AAAA,gBACC;AAAA,cACF,EACC,IAAI,CAAC,EACL,IAAI,GAAG,EACP,SAAS;AAAA,YACd,CAAC,EACA,SAAS,4CAA4C,EACrD,SAAS;AAAA,UACd,CAAC,EACA;AAAA,YACC;AAAA,UACF;AAAA,UACF,OACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,UACZ,aACG,SAAO,EACP;AAAA,YACC;AAAA,UACF,EACC,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA;AAAA,UACC;AAAA,QACF,EACC,SAAS;AAAA,QACZ,oBACG,SAAO;AAAA,UACN,WACG,UAAQ,EACR,SAAS,qCAAqC,EAC9C,SAAS,EACT,SAAS;AAAA,QACd,CAAC,EACA;AAAA,UACC;AAAA,QACF,EACC,SAAS;AAAA,MACd,CAAC;AAAA,IACH,EACC,IAAI,GAAG;AAAA,IACV,cACG,SAAO;AAAA,MACN,WACG,SAAO,EACP,SAAS,qBAAqB,EAC9B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,UACG,SAAO,EACP,SAAS,oBAAoB,EAC7B,IAAI,GAAG,EACP,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,uBAAuB,EAChC,SAAS,EACT,SAAS;AAAA,MACZ,OACG,SAAO,EACP,SAAS,wBAAwB,EACjC,MAAM,EACN,SAAS,EACT,SAAS;AAAA,IACd,CAAC,EACA;AAAA,MACC;AAAA,IACF,EACC,SAAS;AAAA,EACd,CAAC,EACA;AAAA,IACC;AAAA,EACF;AAAA,EACF,SAAW,SAAO;AAAA,IAChB,cACG,SAAO;AAAA,MACN,aACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI;AAAA,MACP,iBACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI;AAAA,IACT,CAAC,EACA;AAAA,MACC;AAAA,IACF;AAAA,EACJ,CAAC;AACH,CAAC;AACM,IAAM,mCAAqC,SAAO;AAAA,EACvD,iBACG,SAAO;AAAA,IACN,KACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS,EACT,SAAS;AAAA,IACZ,aACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,EACJ,SAAS,EACT,SAAS;AAAA,EACd,CAAC,EACA,SAAS,+BAA+B,EACxC,SAAS;AACd,CAAC;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { Cart, ConstructCheckoutSessionOptions, ConstructCheckoutSessionResponse, ConstructCheckoutSessionApplicationErrors } from './index.typings.mjs';
3
- export { CallbackUrls, CheckoutSession, ConstructCheckoutSessionRequest, CustomerInfo, FreeTrialPeriod, LineItem, RegisterCheckoutSessionWebhookRequest, RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionInfo, SubscriptionSettings, WebhookType, WebhookTypeWithLiterals } from './index.typings.mjs';
3
+ export { CallbackUrls, CheckoutSession, ConstructCheckoutSessionRequest, CustomerInfo, FreeTrialPeriod, LineItem, PhysicalProperties, RegisterCheckoutSessionWebhookRequest, RegisterCheckoutSessionWebhookResponse, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionInfo, SubscriptionSettings, WebhookType, WebhookTypeWithLiterals } from './index.typings.mjs';
4
4
 
5
5
  declare function constructCheckoutSession$1(httpClient: HttpClient): ConstructCheckoutSessionSignature;
6
6
  interface ConstructCheckoutSessionSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.public.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Cart,\n ConstructCheckoutSessionApplicationErrors,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionResponse,\n constructCheckoutSession as universalConstructCheckoutSession,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function constructCheckoutSession(\n httpClient: HttpClient\n): ConstructCheckoutSessionSignature {\n return (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ) =>\n universalConstructCheckoutSession(\n cart,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConstructCheckoutSessionSignature {\n /**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @returns Response after creating a checkout session.\n */\n (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n >;\n}\n\nexport {\n CallbackUrls,\n Cart,\n CheckoutSession,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionRequest,\n ConstructCheckoutSessionResponse,\n CustomerInfo,\n FreeTrialPeriod,\n LineItem,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n SubscriptionFrequency,\n SubscriptionInfo,\n SubscriptionSettings,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { constructCheckoutSession as publicConstructCheckoutSession } from './payments-platform-v1-checkout-session-checkout-sessions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const constructCheckoutSession: MaybeContext<\n BuildRESTFunction<typeof publicConstructCheckoutSession> &\n typeof publicConstructCheckoutSession\n> = /*#__PURE__*/ createRESTModule(publicConstructCheckoutSession);\n\nexport {\n SubscriptionFrequency,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n CheckoutSession,\n ConstructCheckoutSessionRequest,\n SubscriptionInfo,\n SubscriptionSettings,\n FreeTrialPeriod,\n LineItem,\n CustomerInfo,\n Cart,\n CallbackUrls,\n ConstructCheckoutSessionResponse,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n ConstructCheckoutSessionOptions,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n SubscriptionFrequencyWithLiterals,\n WebhookTypeWithLiterals,\n ConstructCheckoutSessionApplicationErrors,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKA,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AAsKL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3YO,SAASC,0BACd,YACmC;AACnC,SAAO,CACL,MAWA,YAQAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvCA,SAAS,wBAAwB;AAG1B,IAAMC,4BAGK,iCAAiBA,yBAA8B;","names":["SubscriptionFrequency","WebhookType","constructCheckoutSession","constructCheckoutSession","constructCheckoutSession"]}
1
+ {"version":3,"sources":["../../src/payments-platform-v1-checkout-session-checkout-sessions.universal.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.http.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.public.ts","../../src/payments-platform-v1-checkout-session-checkout-sessions.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPaymentsPlatformV1CheckoutSession from './payments-platform-v1-checkout-session-checkout-sessions.http.js';\n\n/** A Wix-hosted checkout page generated for a specific set of line items. */\nexport interface CheckoutSession {\n /**\n * Checkout session ID, generated by this call. The caller does not supply it.\n * @readonly\n * @format GUID\n */\n _id?: string | null;\n /**\n * URL of the Wix-hosted checkout page where the buyer completes payment. The buyer enters the page as\n * an anonymous shopper; any session held by the calling app is not carried over.\n *\n * The URL carries query parameters Wix needs in order to render the page correctly (for example, a\n * `successUrl` parameter derived from `callbackUrls.thankYouPageUrl`). Pass the URL through to the\n * buyer unchanged — do not strip, reorder, rewrite, or otherwise mutate its query string.\n * @readonly\n * @format WEB_URL\n */\n redirectUrl?: string | null;\n}\n\n/** Request to create a checkout session. */\nexport interface ConstructCheckoutSessionRequest {\n /** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\n cart: Cart;\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n\n/**\n * Recurring subscription configuration for a line item.\n *\n * `LineItem.name` and `subscriptionInfo.title`/`description` render in different parts of the\n * Wix-hosted checkout page: `LineItem.name` is the line label in the cart-summary list, while\n * `subscriptionInfo.title` and `subscriptionInfo.description` are the heading and body text on the\n * recurring-billing summary block (the area that shows the buyer the cadence and the free-trial terms,\n * if any). Set them to complementary values rather than duplicating `LineItem.name`.\n */\nexport interface SubscriptionInfo {\n /**\n * Billing frequency, cycles, and free trial configuration. Required when `subscriptionInfo` is set on a\n * line item.\n */\n subscriptionSettings?: SubscriptionSettings;\n /**\n * Subscription name shown to the buyer in the recurring-billing summary block on the Wix-hosted\n * checkout page (the heading of that block).\n * @maxLength 150\n */\n title?: string | null;\n /**\n * Subscription description shown to the buyer in the recurring-billing summary block on the\n * Wix-hosted checkout page (the body text below the title).\n * @maxLength 500\n */\n description?: string | null;\n}\n\n/**\n * Configuration for recurring subscription charges.\n *\n * `autoRenewal` and `billingCycles` are mutually exclusive — `autoRenewal: true` describes an\n * open-ended subscription that renews indefinitely, while `billingCycles: N` describes a fixed-term\n * subscription that stops after N charges. Setting `autoRenewal: true` together with any\n * `billingCycles` value is rejected with `INVALID_ARGUMENT` (application code\n * `AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT`).\n */\nexport interface SubscriptionSettings {\n /** Billing frequency unit. Required when `subscriptionSettings` is set; `UNDEFINED` is rejected. */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Number of frequency units between charges. For `DAY` frequency, the minimum is 7 — the shortest\n * billing cadence supported is weekly; values 1–6 with `frequency: DAY` are rejected with\n * `INVALID_ARGUMENT` (rule code `MIN_VALUE`). Default: `1`.\n *\n * Note that `freeTrialPeriod.interval` does **not** share this floor — a `DAY` trial may have\n * `interval` as low as 1.\n * @min 1\n * @max 3650\n */\n interval?: number | null;\n /**\n * Whether the subscription renews automatically. Cannot be `true` when `billingCycles` is set.\n *\n * Default: `true` when both `autoRenewal` and `billingCycles` are omitted; `false` when `billingCycles`\n * is set and `autoRenewal` is omitted.\n */\n autoRenewal?: boolean | null;\n /**\n * Number of billing cycles before the subscription stops. Cannot be set when `autoRenewal` is `true`.\n *\n * When omitted along with `autoRenewal`, the subscription renews indefinitely.\n * @min 1\n */\n billingCycles?: number | null;\n /** Free trial period before the first charge. */\n freeTrialPeriod?: FreeTrialPeriod;\n}\n\n/** Frequency unit for subscription billing and trial periods. */\nexport enum SubscriptionFrequency {\n /** Unknown frequency. */\n UNDEFINED = 'UNDEFINED',\n DAY = 'DAY',\n WEEK = 'WEEK',\n MONTH = 'MONTH',\n YEAR = 'YEAR',\n}\n\n/** @enumType */\nexport type SubscriptionFrequencyWithLiterals =\n | SubscriptionFrequency\n | 'UNDEFINED'\n | 'DAY'\n | 'WEEK'\n | 'MONTH'\n | 'YEAR';\n\n/**\n * Free trial period before the first subscription charge.\n *\n * The `frequency` enum is shared with `SubscriptionSettings.frequency` for convenience, but here it\n * describes a one-off duration unit (the length of the trial), not a recurring billing cadence. A\n * `frequency: MONTH` + `interval: 3` trial means \"a single 3-month trial,\" not \"billed every three\n * months.\"\n */\nexport interface FreeTrialPeriod {\n /**\n * Trial period frequency unit. Required when `freeTrialPeriod` is set; `UNDEFINED` should be\n * treated as a client mistake and is not a valid runtime value.\n */\n frequency?: SubscriptionFrequencyWithLiterals;\n /**\n * Length of the trial period in `frequency` units. For example, `interval: 14` with `frequency: DAY`\n * gives a 14-day trial.\n *\n * Unlike `SubscriptionSettings.interval`, this field's `DAY` floor is `1` — there is no weekly-floor\n * restriction on the trial length. Values ≤ 0 are rejected with `INVALID_ARGUMENT` (rule code\n * `MIN_VALUE`).\n * @min 1\n * @max 999\n */\n interval?: number;\n}\n\nexport interface PhysicalProperties {\n /** Whether the item requires shipping. */\n shippable?: boolean | null;\n}\n\nexport interface LineItem {\n /**\n * Name of the item, shown on the checkout page.\n * @minLength 1\n * @maxLength 255\n */\n name?: string | null;\n /**\n * Quantity of this item to charge for.\n * @min 1\n */\n quantity?: number | null;\n /**\n * Per-unit price as a decimal string in the merchant account currency. For example, `\"19.99\"`.\n * @minLength 1\n * @maxLength 50\n */\n price?: string | null;\n /**\n * Subscription configuration. When set, the line item follows a scheduled-billing model defined by\n * `subscriptionSettings` instead of a single immediate charge. The recurring charge each billing\n * cycle is `price × quantity`, and `quantity` is locked at session creation.\n *\n * At most one line item per request may set `subscriptionInfo`. Requests with two or more\n * subscription line items are rejected with `MULTIPLE_SUBSCRIPTION_ITEMS`.\n */\n subscriptionInfo?: SubscriptionInfo;\n /** Optional. Physical properties of the item, used when the item requires shipping. */\n physicalProperties?: PhysicalProperties;\n}\n\n/**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\nexport interface CustomerInfo {\n /**\n * Buyer's first name.\n * @maxLength 100\n */\n firstName?: string | null;\n /**\n * Buyer's last name.\n * @maxLength 100\n */\n lastName?: string | null;\n /**\n * Buyer's phone number.\n * @format PHONE\n */\n phone?: string | null;\n /**\n * Buyer's email address.\n * @format EMAIL\n */\n email?: string | null;\n}\n\n/** Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details. */\nexport interface Cart {\n /**\n * Line items the buyer is paying for in this checkout session.\n *\n * At most one subscription line item (an item with `subscriptionInfo` set) is allowed per request.\n * Requests with two or more subscription items are rejected. One-time items can be combined with a\n * single subscription item; in that case the buyer is charged once at checkout for the one-time items\n * and (if applicable) the first cycle of the subscription, and any subsequent cycles are billed on\n * the subscription's own schedule.\n * @maxSize 100\n */\n items?: LineItem[];\n /**\n * Buyer details used to pre-fill the checkout form. The buyer can edit any of these fields on the\n * Wix checkout page.\n */\n customerInfo?: CustomerInfo;\n}\n\n/**\n * URLs the buyer is redirected to after the checkout flow.\n *\n * The buyer is sent to one of the URLs below — `postFlowUrl` if they explicitly leave via **Continue\n * browsing**, `thankYouPageUrl` after a successful payment.\n *\n * If the buyer abandons the page implicitly (closing the tab, navigating away, network failure), no\n * callback URL is invoked and the checkout session is not resumed.\n */\nexport interface CallbackUrls {\n /**\n * URL the buyer is redirected to from the Wix checkout page when they choose to leave without\n * completing payment — both when they click **Continue browsing** and when they navigate back to\n * a cart-style page.\n * @format WEB_URL\n */\n postFlowUrl?: string | null;\n /**\n * URL the buyer is redirected to after a successful payment.\n * @format WEB_URL\n */\n thankYouPageUrl?: string | null;\n}\n\n/** Response after creating a checkout session. */\nexport interface ConstructCheckoutSessionResponse {\n /** The created checkout session. */\n checkoutSession?: CheckoutSession;\n}\n\n/** Request to register a webhook URL. */\nexport interface RegisterCheckoutSessionWebhookRequest {\n /**\n * URL to receive webhook notifications.\n * @format WEB_URL\n */\n url?: string | null;\n /**\n * Webhook event types to register. Default: `[ORDER_APPROVED]`.\n * @maxSize 10\n */\n webhookTypes?: WebhookTypeWithLiterals[];\n}\n\n/** Webhook event types to register. */\nexport enum WebhookType {\n /** Order Approved webhook (`wix.ecom.v1.order_approved`). */\n ORDER_APPROVED = 'ORDER_APPROVED',\n /**\n * Subscription Contract Canceled webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_canceled`).\n */\n SUBSCRIPTION_CANCELED = 'SUBSCRIPTION_CANCELED',\n /**\n * Subscription Contract Expired webhook\n * (`wix.ecom.subscription_contracts.v1.subscription_contract_expired`).\n */\n SUBSCRIPTION_ENDED = 'SUBSCRIPTION_ENDED',\n}\n\n/** @enumType */\nexport type WebhookTypeWithLiterals =\n | WebhookType\n | 'ORDER_APPROVED'\n | 'SUBSCRIPTION_CANCELED'\n | 'SUBSCRIPTION_ENDED';\n\n/** Response after registering a webhook. */\nexport interface RegisterCheckoutSessionWebhookResponse {\n /**\n * PEM-formatted RS256 public key used to verify the JWT signature on incoming webhook payloads.\n * @maxLength 1000\n */\n publicKey?: string | null;\n}\n\n/** @docsIgnore */\nexport type ConstructCheckoutSessionApplicationErrors =\n | {\n code?: 'MULTIPLE_SUBSCRIPTION_ITEMS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'AUTO_RENEWAL_AND_BILLING_CYCLES_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param cart - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @public\n * @documentationMaturity preview\n * @requiredField cart\n * @requiredField cart.items\n * @requiredField cart.items.name\n * @requiredField cart.items.price\n * @requiredField cart.items.quantity\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency\n * @requiredField cart.items.subscriptionInfo.subscriptionSettings.frequency\n * @requiredField options\n * @requiredField options.callbackUrls\n * @requiredField options.callbackUrls.postFlowUrl\n * @requiredField options.callbackUrls.thankYouPageUrl\n * @permissionId payments:platform:v1:checkout_session:construct_checkout_session\n * @returns Response after creating a checkout session.\n * @fqn wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession\n */\nexport async function constructCheckoutSession(\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cart: cart,\n callbackUrls: options?.callbackUrls,\n });\n\n const reqOpts =\n ambassadorWixPaymentsPlatformV1CheckoutSession.constructCheckoutSession(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n cart: '$[0]',\n callbackUrls: '$[1].callbackUrls',\n },\n singleArgumentUnchanged: false,\n },\n ['cart', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ConstructCheckoutSessionOptions {\n /** URLs the buyer is redirected to after completing or leaving the checkout flow. */\n callbackUrls: CallbackUrls;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixPaymentsPlatformV1CheckoutSessionsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/payments/platform/v1/checkout-sessions',\n destPath: '/v1/checkout-sessions',\n },\n {\n srcPath: '/payments/base44/v1/subscriptions',\n destPath: '/v1/subscriptions',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n 'manage.base44.com': [\n {\n srcPath: '/_api/checkout-sessions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_payments_checkout-sessions';\n\n/**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n */\nexport function constructCheckoutSession(\n payload: object\n): RequestOptionsFactory<any> {\n function __constructCheckoutSession({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.payments.platform.v1.checkout_session',\n method: 'POST' as any,\n methodFqn:\n 'wix.payments.platform.v1.CheckoutSessions.ConstructCheckoutSession',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPaymentsPlatformV1CheckoutSessionsUrl({\n protoPath: '/v1/checkout-sessions/construct',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __constructCheckoutSession;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Cart,\n ConstructCheckoutSessionApplicationErrors,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionResponse,\n constructCheckoutSession as universalConstructCheckoutSession,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/payments' };\n\nexport function constructCheckoutSession(\n httpClient: HttpClient\n): ConstructCheckoutSessionSignature {\n return (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ) =>\n universalConstructCheckoutSession(\n cart,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ConstructCheckoutSessionSignature {\n /**\n * Creates a Wix-hosted checkout session for the supplied line items and returns its `redirectUrl`\n * and `id`.\n *\n * Each call creates a new, independent session; the method is not idempotent, so a retry produces\n * an additional session rather than recovering an existing one.\n * @param - Items, quantities, and prices the buyer is paying for, plus optional pre-fill customer details.\n * @returns Response after creating a checkout session.\n */\n (\n cart: NonNullablePaths<\n Cart,\n | `items`\n | `items.${number}.name`\n | `items.${number}.price`\n | `items.${number}.quantity`\n | `items.${number}.subscriptionInfo.subscriptionSettings`\n | `items.${number}.subscriptionInfo.subscriptionSettings.freeTrialPeriod.frequency`\n | `items.${number}.subscriptionInfo.subscriptionSettings.frequency`,\n 7\n >,\n options: NonNullablePaths<\n ConstructCheckoutSessionOptions,\n | `callbackUrls`\n | `callbackUrls.postFlowUrl`\n | `callbackUrls.thankYouPageUrl`,\n 3\n >\n ): Promise<\n ConstructCheckoutSessionResponse & {\n __applicationErrorsType?: ConstructCheckoutSessionApplicationErrors;\n }\n >;\n}\n\nexport {\n CallbackUrls,\n Cart,\n CheckoutSession,\n ConstructCheckoutSessionOptions,\n ConstructCheckoutSessionRequest,\n ConstructCheckoutSessionResponse,\n CustomerInfo,\n FreeTrialPeriod,\n LineItem,\n PhysicalProperties,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n SubscriptionFrequency,\n SubscriptionInfo,\n SubscriptionSettings,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n","import { constructCheckoutSession as publicConstructCheckoutSession } from './payments-platform-v1-checkout-session-checkout-sessions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const constructCheckoutSession: MaybeContext<\n BuildRESTFunction<typeof publicConstructCheckoutSession> &\n typeof publicConstructCheckoutSession\n> = /*#__PURE__*/ createRESTModule(publicConstructCheckoutSession);\n\nexport {\n SubscriptionFrequency,\n WebhookType,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n CheckoutSession,\n ConstructCheckoutSessionRequest,\n SubscriptionInfo,\n SubscriptionSettings,\n FreeTrialPeriod,\n PhysicalProperties,\n LineItem,\n CustomerInfo,\n Cart,\n CallbackUrls,\n ConstructCheckoutSessionResponse,\n RegisterCheckoutSessionWebhookRequest,\n RegisterCheckoutSessionWebhookResponse,\n ConstructCheckoutSessionOptions,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\nexport {\n SubscriptionFrequencyWithLiterals,\n WebhookTypeWithLiterals,\n ConstructCheckoutSessionApplicationErrors,\n} from './payments-platform-v1-checkout-session-checkout-sessions.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,kBAAkB;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,gDAAgD;AAAA,QACnD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ADuCO,IAAK,wBAAL,kBAAKA,2BAAL;AAEL,EAAAA,uBAAA,eAAY;AACZ,EAAAA,uBAAA,SAAM;AACN,EAAAA,uBAAA,UAAO;AACP,EAAAA,uBAAA,WAAQ;AACR,EAAAA,uBAAA,UAAO;AANG,SAAAA;AAAA,GAAA;AA6KL,IAAK,cAAL,kBAAKC,iBAAL;AAEL,EAAAA,aAAA,oBAAiB;AAKjB,EAAAA,aAAA,2BAAwB;AAKxB,EAAAA,aAAA,wBAAqB;AAZX,SAAAA;AAAA,GAAA;AAqEZ,eAAsBC,0BACpB,MAWA,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,cAAc,SAAS;AAAA,EACzB,CAAC;AAED,QAAM,UAC2C;AAAA,IAC7C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ,SAAS;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AElZO,SAASC,0BACd,YACmC;AACnC,SAAO,CACL,MAWA,YAQAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvCA,SAAS,wBAAwB;AAG1B,IAAMC,4BAGK,iCAAiBA,yBAA8B;","names":["SubscriptionFrequency","WebhookType","constructCheckoutSession","constructCheckoutSession","constructCheckoutSession"]}