@wix/himalaya-cli 0.1571.0 → 0.1573.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/checkout/src/index.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/one-app-page.d.ts +61 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +34 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +28 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +573 -73
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +24 -1
- package/dist/cli.mjs +466 -90
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/index.json +7 -0
- package/guides/map-one-app-coverage.js +117 -0
- package/guides/one-app-to-himi-app.md +141 -7
- package/guides/recipe-one-app-coverage-mapping.md +74 -0
- package/guides/sdk-reference.json +34 -4
- package/guides/webview-page-sdk.md +68 -3
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/beauty-salon/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/beauty-salon-owner/dev/index.ts +2 -3
- package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/branded-lite/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +28 -11
- package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/community-club/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/community-club/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/community-club-owner/dev/index.ts +2 -3
- package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/events-meetups/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/events-meetups-owner/dev/index.ts +2 -3
- package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/gym-fitness/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/gym-fitness-owner/dev/index.ts +2 -3
- package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/nonprofit-cause/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/nonprofit-cause-owner/dev/index.ts +2 -3
- package/templates/owner-lite/dev/index.ts +2 -3
- package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/podcast-creator/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/podcast-creator-owner/dev/index.ts +2 -3
- package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/portfolio-creative/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/portfolio-creative-owner/dev/index.ts +2 -3
- package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/restaurant/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/restaurant/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/restaurant-owner/dev/index.ts +2 -3
- package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/retail-store/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/retail-store-owner/dev/index.ts +2 -3
- package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/yoga-studio/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +28 -11
- package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/yoga-studio-owner/dev/index.ts +2 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites, offlineWritesEnabled } from "../_shared/online-actions.js";
|
|
2
3
|
// Tier-5 bundle: himi-booking — availability and member booking.
|
|
3
4
|
import { defineService as registerService, navigate } from "@himalaya/state";
|
|
@@ -9,7 +10,7 @@ import { dispatch } from "@himalaya/dispatch";
|
|
|
9
10
|
import { bookSchedule, bookSlot, getService, queryServiceAvailability, registerToWaitlist, type WixBookingSlotFull, type WixSelectedPaymentOption, type WixService } from "@himalaya/wix-bookings";
|
|
10
11
|
import { createCheckout, createOrder } from "@himalaya/wix-ecom";
|
|
11
12
|
import { createRedirectSession, type WixSlot } from "@himalaya/wix-redirects";
|
|
12
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
13
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
13
14
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
14
15
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
15
16
|
import { displayName, getMyData, type WixMyData } from "@himalaya/wix-users";
|
|
@@ -1587,10 +1588,12 @@ async function bookSelectedIn(s: S): Promise<S> {
|
|
|
1587
1588
|
? copyParam("time.coursePaymentCancelled", "Payment cancelled — your course booking wasn't confirmed. Try again.")
|
|
1588
1589
|
: copyParam("time.paymentCancelled", "Payment cancelled — your booking wasn't confirmed. Pick a time to try again.") });
|
|
1589
1590
|
}
|
|
1591
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1590
1592
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1591
1593
|
? copyParam("time.coursePaymentFailed", "Payment couldn't be completed. Try again.")
|
|
1592
1594
|
: copyParam("time.paymentFailed", "Payment couldn't be completed. Pick another time or try again.") });
|
|
1593
|
-
} catch {
|
|
1595
|
+
} catch (error) {
|
|
1596
|
+
if (isPaymentSetupFailure(error)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1594
1597
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1595
1598
|
? copyParam("time.courseCheckoutFailed", "Checkout could not start. Try again.")
|
|
1596
1599
|
: copyParam("time.checkoutFailed", "Checkout could not start. Pick another time or try again.") });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
3
|
import { defineService as registerState } from "@himalaya/state";
|
|
3
4
|
import { getStoreProduct } from "../_shared/himi-store.js";
|
|
@@ -7,7 +8,7 @@ import { withIapPresentation } from "../_shared/iap-presentation.js";
|
|
|
7
8
|
import { type IapCommerce, classifyCart } from "@himalaya/iap-checkout";
|
|
8
9
|
import { addCouponToCurrentCart, calculateCurrentCart, createCheckoutFromCurrentCart, getCurrentCart, removeCouponFromCurrentCart, removeLineItemsFromCurrentCart, updateLineItemsQuantity, type WixCartDetail, type WixCartLineItemDetail } from "@himalaya/wix-ecom";
|
|
9
10
|
import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
10
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
11
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
11
12
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
12
13
|
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
13
14
|
|
|
@@ -574,8 +575,10 @@ const svc = defineService<State, {
|
|
|
574
575
|
// only confirmed once it lands, so the cart must survive a bail-out.
|
|
575
576
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutOpenedMessage", "Checkout opened.") });
|
|
576
577
|
}
|
|
578
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
577
579
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
578
|
-
} catch {
|
|
580
|
+
} catch (error) {
|
|
581
|
+
if (isPaymentSetupFailure(error)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
579
582
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
580
583
|
}
|
|
581
584
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { offlineWriteMessage, offlineWritesEnabled, withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
3
|
import { connectivity } from "@himalaya/state";
|
|
3
4
|
import { defineService as registerService } from "../_shared/collection-service.js";
|
|
@@ -6,7 +7,7 @@ import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
|
6
7
|
import { open as openUrl } from "@himalaya/open-url";
|
|
7
8
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
8
9
|
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
9
|
-
import { activePlanIds, entitlement, payCashierOrder } from "@himalaya/checkout";
|
|
10
|
+
import { activePlanIds, entitlement, isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
10
11
|
import { hostSessionFromGlobal, iapPriceFields, type IapCatalogItem } from "@himalaya/iap";
|
|
11
12
|
import { createIapCommerce, pricingPlanOrders } from "@himalaya/iap-checkout";
|
|
12
13
|
import { iapPriceCopy, iapPurchaseCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-worker.js";
|
|
@@ -290,7 +291,9 @@ async function regularJoinMessage(row: PlanRow, reference: { kind: string; id: s
|
|
|
290
291
|
if (pay.kind === "cancelled") {
|
|
291
292
|
return copyParam("plans.joinCancelledMessage", "Payment cancelled — you haven't joined.");
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
+
if (isPaymentSetupFailure(pay)) return paymentSetupMessage("plans");
|
|
295
|
+
} catch (error) {
|
|
296
|
+
if (isPaymentSetupFailure(error)) return paymentSetupMessage("plans");
|
|
294
297
|
}
|
|
295
298
|
return copyTemplate("plans.joinOnSiteMessage", "Memberships are purchased on the website — visit the site to join {name}.", { name: row.name });
|
|
296
299
|
}
|
|
@@ -52829,8 +52829,7 @@ const SCREENS = runtimeSetting({
|
|
|
52829
52829
|
"params": {
|
|
52830
52830
|
"screenId": "himi_owner_lite_search",
|
|
52831
52831
|
"title": "Search records",
|
|
52832
|
-
"subtitle": "Across your business areas"
|
|
52833
|
-
"search": "drawer"
|
|
52832
|
+
"subtitle": "Across your business areas"
|
|
52834
52833
|
}
|
|
52835
52834
|
},
|
|
52836
52835
|
"pressFeedback": "scale",
|
|
@@ -54349,7 +54348,7 @@ const SCREENS = runtimeSetting({
|
|
|
54349
54348
|
"actionId": "tier5.himiOwnerLiteSearch.search"
|
|
54350
54349
|
},
|
|
54351
54350
|
"debounceMs": 200,
|
|
54352
|
-
"
|
|
54351
|
+
"loadingPath": "$service:himiOwnerLiteSearch.anyLoading"
|
|
54353
54352
|
}
|
|
54354
54353
|
}
|
|
54355
54354
|
},
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// SDK; this only supplies the copy and the hydration reset.
|
|
5
5
|
import { hostSessionFromGlobal, type IapPriceCopy } from "@himalaya/iap";
|
|
6
6
|
import type { IapCommerce, IapPurchaseCopy, IapRestoreResult } from "@himalaya/iap-checkout";
|
|
7
|
+
import { paymentSetupMessage } from "./payment-setup.js";
|
|
7
8
|
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
8
9
|
|
|
9
10
|
/** Price labels from the screen's copy pack (`<prefix>.priceLoadingText`, …). */
|
|
@@ -25,6 +26,7 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
|
|
|
25
26
|
awaitingApproval: copyParam(`${prefix}.purchaseAwaitingApprovalText`, "Waiting for approval"),
|
|
26
27
|
unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
|
|
27
28
|
signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
|
|
29
|
+
sitePaymentUnavailable: paymentSetupMessage(prefix),
|
|
28
30
|
retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
|
|
29
31
|
priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
|
|
30
32
|
support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { copyParam } from "./himi-copy.js";
|
|
2
|
+
|
|
3
|
+
/** No provider or country guess: Wix only established that online payment is unavailable. */
|
|
4
|
+
export function paymentSetupMessage(prefix: string): string {
|
|
5
|
+
return copyParam(`${prefix}.paymentSetupUnavailable`, "This site is not accepting online payments. Go back or contact the business for other payment options.");
|
|
6
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites, offlineWritesEnabled } from "../_shared/online-actions.js";
|
|
2
3
|
// Tier-5 bundle: himi-booking — availability and member booking.
|
|
3
4
|
import { defineService as registerService, navigate } from "@himalaya/state";
|
|
@@ -9,7 +10,7 @@ import { dispatch } from "@himalaya/dispatch";
|
|
|
9
10
|
import { bookSchedule, bookSlot, getService, queryServiceAvailability, registerToWaitlist, type WixBookingSlotFull, type WixSelectedPaymentOption, type WixService } from "@himalaya/wix-bookings";
|
|
10
11
|
import { createCheckout, createOrder } from "@himalaya/wix-ecom";
|
|
11
12
|
import { createRedirectSession, type WixSlot } from "@himalaya/wix-redirects";
|
|
12
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
13
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
13
14
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
14
15
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
15
16
|
import { displayName, getMyData, type WixMyData } from "@himalaya/wix-users";
|
|
@@ -1587,10 +1588,12 @@ async function bookSelectedIn(s: S): Promise<S> {
|
|
|
1587
1588
|
? copyParam("time.coursePaymentCancelled", "Payment cancelled — your course booking wasn't confirmed. Try again.")
|
|
1588
1589
|
: copyParam("time.paymentCancelled", "Payment cancelled — your booking wasn't confirmed. Pick a time to try again.") });
|
|
1589
1590
|
}
|
|
1591
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1590
1592
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1591
1593
|
? copyParam("time.coursePaymentFailed", "Payment couldn't be completed. Try again.")
|
|
1592
1594
|
: copyParam("time.paymentFailed", "Payment couldn't be completed. Pick another time or try again.") });
|
|
1593
|
-
} catch {
|
|
1595
|
+
} catch (error) {
|
|
1596
|
+
if (isPaymentSetupFailure(error)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1594
1597
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1595
1598
|
? copyParam("time.courseCheckoutFailed", "Checkout could not start. Try again.")
|
|
1596
1599
|
: copyParam("time.checkoutFailed", "Checkout could not start. Pick another time or try again.") });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
3
|
import { defineService as registerState } from "@himalaya/state";
|
|
3
4
|
import { getStoreProduct } from "../_shared/himi-store.js";
|
|
@@ -7,7 +8,7 @@ import { withIapPresentation } from "../_shared/iap-presentation.js";
|
|
|
7
8
|
import { type IapCommerce, classifyCart } from "@himalaya/iap-checkout";
|
|
8
9
|
import { addCouponToCurrentCart, calculateCurrentCart, createCheckoutFromCurrentCart, getCurrentCart, removeCouponFromCurrentCart, removeLineItemsFromCurrentCart, updateLineItemsQuantity, type WixCartDetail, type WixCartLineItemDetail } from "@himalaya/wix-ecom";
|
|
9
10
|
import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
10
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
11
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
11
12
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
12
13
|
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
13
14
|
|
|
@@ -574,8 +575,10 @@ const svc = defineService<State, {
|
|
|
574
575
|
// only confirmed once it lands, so the cart must survive a bail-out.
|
|
575
576
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutOpenedMessage", "Checkout opened.") });
|
|
576
577
|
}
|
|
578
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
577
579
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
578
|
-
} catch {
|
|
580
|
+
} catch (error) {
|
|
581
|
+
if (isPaymentSetupFailure(error)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
579
582
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
580
583
|
}
|
|
581
584
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { offlineWriteMessage, offlineWritesEnabled, withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
3
|
import { connectivity } from "@himalaya/state";
|
|
3
4
|
import { defineService as registerService } from "../_shared/collection-service.js";
|
|
@@ -6,7 +7,7 @@ import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
|
6
7
|
import { open as openUrl } from "@himalaya/open-url";
|
|
7
8
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
8
9
|
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
9
|
-
import { activePlanIds, entitlement, payCashierOrder } from "@himalaya/checkout";
|
|
10
|
+
import { activePlanIds, entitlement, isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
10
11
|
import { hostSessionFromGlobal, iapPriceFields, type IapCatalogItem } from "@himalaya/iap";
|
|
11
12
|
import { createIapCommerce, pricingPlanOrders } from "@himalaya/iap-checkout";
|
|
12
13
|
import { iapPriceCopy, iapPurchaseCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-worker.js";
|
|
@@ -290,7 +291,9 @@ async function regularJoinMessage(row: PlanRow, reference: { kind: string; id: s
|
|
|
290
291
|
if (pay.kind === "cancelled") {
|
|
291
292
|
return copyParam("plans.joinCancelledMessage", "Payment cancelled — you haven't joined.");
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
+
if (isPaymentSetupFailure(pay)) return paymentSetupMessage("plans");
|
|
295
|
+
} catch (error) {
|
|
296
|
+
if (isPaymentSetupFailure(error)) return paymentSetupMessage("plans");
|
|
294
297
|
}
|
|
295
298
|
return copyTemplate("plans.joinOnSiteMessage", "Memberships are purchased on the website — visit the site to join {name}.", { name: row.name });
|
|
296
299
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { dispatch } from "@himalaya/dispatch";
|
|
2
3
|
import { memberAccess, assertMemberAccess } from "../_shared/member-access.js";
|
|
3
4
|
import { offlineWriteMessage, withOnlineWrites } from "../_shared/online-actions.js";
|
|
@@ -42,7 +43,7 @@ import { getMyMember } from "@himalaya/wix-members";
|
|
|
42
43
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
43
44
|
import { cleanTitle, initials } from "../_shared/himi-text.js";
|
|
44
45
|
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
45
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
46
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
46
47
|
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
47
48
|
import { iapPriceFields, onlineProgramItem, type IapCatalogItem, type IapPollDirective, type IapPriceFields } from "@himalaya/iap";
|
|
48
49
|
import { createIapCommerce, onlineProgramOrders, type IapPurchaseFields } from "@himalaya/iap-checkout";
|
|
@@ -251,9 +252,11 @@ async function enrollmentMessage(id: string, name: string, guards: CommerceGuard
|
|
|
251
252
|
: copyTemplate("program.joinedMessage", "You're enrolled in {name}.", { name });
|
|
252
253
|
if (pay.kind === "handoff") return "";
|
|
253
254
|
if (pay.kind === "cancelled") return copyParam("program.joinCancelledMessage", "Payment cancelled — you haven't enrolled.");
|
|
254
|
-
|
|
255
|
+
if (isPaymentSetupFailure(pay)) return paymentSetupMessage("program");
|
|
256
|
+
} catch (error) {
|
|
255
257
|
if (!connectivity().online) return offlineWriteMessage;
|
|
256
258
|
if (preparationWithdrawn) return blocked();
|
|
259
|
+
if (isPaymentSetupFailure(error)) return paymentSetupMessage("program");
|
|
257
260
|
// fall through to the site-directing message
|
|
258
261
|
}
|
|
259
262
|
return copyTemplate("program.joinOnSiteMessage", "Enrolment happens on the website — visit the site to join {name}.", { name });
|
|
@@ -112,13 +112,10 @@ function programFields(p: WixProgram): Omit<ProgramRow, "priceLine"> {
|
|
|
112
112
|
initial: initials(name),
|
|
113
113
|
hasImage: !!image,
|
|
114
114
|
noImage: !image,
|
|
115
|
-
// The
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
// liveSeedRoute({ prefix: "himi_program_" }) already seeds and `currentInputId`
|
|
120
|
-
// resolves through its prefix path.
|
|
121
|
-
detailScreenId: `himi_program_${id}`,
|
|
115
|
+
// The canonical route is baked even offline. Hosts pass the row's `id` as
|
|
116
|
+
// worker input (WS-C); suffixed routes only exist for the preview seed's
|
|
117
|
+
// first 50 records and cannot open a complete live catalog in production.
|
|
118
|
+
detailScreenId: "himi_program",
|
|
122
119
|
};
|
|
123
120
|
}
|
|
124
121
|
|
|
@@ -157,9 +154,29 @@ function errored(state: State): State {
|
|
|
157
154
|
};
|
|
158
155
|
}
|
|
159
156
|
|
|
160
|
-
async function fetchPrograms(): Promise<WixProgram[]> {
|
|
161
|
-
const
|
|
162
|
-
|
|
157
|
+
async function fetchPrograms(isCurrent: () => boolean): Promise<WixProgram[] | undefined> {
|
|
158
|
+
const programs = new Map<string, WixProgram>();
|
|
159
|
+
const seen = new Set<string>();
|
|
160
|
+
let cursor = "";
|
|
161
|
+
do {
|
|
162
|
+
// Wix cursors carry the initial sort/filter. Repeating either on a continuation
|
|
163
|
+
// is rejected with INVALID_CURSOR, even when their values have not changed.
|
|
164
|
+
const response = await queryPrograms(cursor
|
|
165
|
+
? { cursorPaging: { limit: 50, cursor } }
|
|
166
|
+
: { cursorPaging: { limit: 50 }, sort: [{ fieldName: "createdDate", order: "DESC" }] });
|
|
167
|
+
if (!isCurrent()) return undefined;
|
|
168
|
+
for (const program of response.programs ?? []) {
|
|
169
|
+
if (program.id && !isDraft(program)) programs.set(program.id, program);
|
|
170
|
+
}
|
|
171
|
+
const paging = response.pagingMetadata;
|
|
172
|
+
const next = paging?.hasNext === false ? "" : paging?.cursors?.next ?? "";
|
|
173
|
+
if ((paging?.hasNext && !next) || (next && seen.has(next))) {
|
|
174
|
+
throw new Error("Invalid program catalog cursor");
|
|
175
|
+
}
|
|
176
|
+
if (next) seen.add(next);
|
|
177
|
+
cursor = next;
|
|
178
|
+
} while (cursor);
|
|
179
|
+
return [...programs.values()];
|
|
163
180
|
}
|
|
164
181
|
|
|
165
182
|
// ── Content and App Store prices ─────
|
|
@@ -180,7 +197,7 @@ let loadSeq = 0;
|
|
|
180
197
|
async function load(_state: State, arg?: unknown): Promise<undefined> {
|
|
181
198
|
stashCopy(arg);
|
|
182
199
|
const seq = ++loadSeq;
|
|
183
|
-
const programs = await fetchPrograms().catch(() => undefined);
|
|
200
|
+
const programs = await fetchPrograms(() => seq === loadSeq).catch(() => undefined);
|
|
184
201
|
if (seq !== loadSeq) return undefined;
|
|
185
202
|
content = programs ? { status: "ready", programs: programs.map(programContent) } : { ...content, status: "error" };
|
|
186
203
|
void svc.pricingPublish();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
// Tier-5 bundle: himi-events — event detail.
|
|
2
3
|
import { calendarDay, formatClock, formatCurrency, formatWeekdayDateTime, formatWeekdayMonthDay, formatTimeZoneLabel } from "../_shared/engine-intl.js";
|
|
3
4
|
import { defineService as registerService } from "@himalaya/state";
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
type WixEvent,
|
|
19
20
|
} from "@himalaya/wix-events";
|
|
20
21
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
21
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
22
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
22
23
|
import { get, upsert, type DbEntity } from "@himalaya/local-db";
|
|
23
24
|
import {
|
|
24
25
|
currentInputId,
|
|
@@ -986,16 +987,18 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
986
987
|
if (pay.kind === "paid") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.ticketIssued", "You're in — your ticket is confirmed.") };
|
|
987
988
|
else if (pay.kind === "handoff") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") };
|
|
988
989
|
else if (pay.kind === "cancelled") result = { ...s, snackbarMessage: detailCopy("event.ticketCancelled", "Payment cancelled — no ticket was issued.") };
|
|
990
|
+
else if (isPaymentSetupFailure(pay)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
989
991
|
else throw new Error("Payment could not be completed");
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
}
|
|
993
|
-
} catch {
|
|
995
|
+
} catch (error) {
|
|
996
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
994
997
|
try {
|
|
995
998
|
// A public event page is not pinned to this selection or price. Only
|
|
996
999
|
// continue in hosted checkout when a reservation already holds it.
|
|
997
1000
|
const params = reservationId ? { reservationId } : undefined;
|
|
998
|
-
if (params) {
|
|
1001
|
+
if (params && !result) {
|
|
999
1002
|
const redirect = await createRedirectSession({ eventsCheckout: params });
|
|
1000
1003
|
const url = redirect.redirectSession?.fullUrl;
|
|
1001
1004
|
if (url) {
|
|
@@ -1003,7 +1006,9 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
1003
1006
|
result = { ...s, ticketSheetOpen: false, snackbarMessage: opened.opened ? detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") : detailCopy("event.registrationOpenFailed", "Could not open the registration page.") };
|
|
1004
1007
|
}
|
|
1005
1008
|
}
|
|
1006
|
-
} catch {
|
|
1009
|
+
} catch (error) {
|
|
1010
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
1011
|
+
}
|
|
1007
1012
|
if (!result) result = { ...s, snackbarMessage: detailCopy("event.purchaseUnavailable", "Purchasing is temporarily unavailable.") };
|
|
1008
1013
|
} finally { ticketCheckoutInFlight = false; }
|
|
1009
1014
|
return derive(result!);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// SDK; this only supplies the copy and the hydration reset.
|
|
5
5
|
import { hostSessionFromGlobal, type IapPriceCopy } from "@himalaya/iap";
|
|
6
6
|
import type { IapCommerce, IapPurchaseCopy, IapRestoreResult } from "@himalaya/iap-checkout";
|
|
7
|
+
import { paymentSetupMessage } from "./payment-setup.js";
|
|
7
8
|
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
8
9
|
|
|
9
10
|
/** Price labels from the screen's copy pack (`<prefix>.priceLoadingText`, …). */
|
|
@@ -25,6 +26,7 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
|
|
|
25
26
|
awaitingApproval: copyParam(`${prefix}.purchaseAwaitingApprovalText`, "Waiting for approval"),
|
|
26
27
|
unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
|
|
27
28
|
signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
|
|
29
|
+
sitePaymentUnavailable: paymentSetupMessage(prefix),
|
|
28
30
|
retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
|
|
29
31
|
priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
|
|
30
32
|
support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { copyParam } from "./himi-copy.js";
|
|
2
|
+
|
|
3
|
+
/** No provider or country guess: Wix only established that online payment is unavailable. */
|
|
4
|
+
export function paymentSetupMessage(prefix: string): string {
|
|
5
|
+
return copyParam(`${prefix}.paymentSetupUnavailable`, "This site is not accepting online payments. Go back or contact the business for other payment options.");
|
|
6
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
// Tier-5 bundle: himi-events — event detail.
|
|
2
3
|
import { calendarDay, formatClock, formatCurrency, formatWeekdayDateTime, formatWeekdayMonthDay, formatTimeZoneLabel } from "../_shared/engine-intl.js";
|
|
3
4
|
import { defineService as registerService } from "@himalaya/state";
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
type WixEvent,
|
|
19
20
|
} from "@himalaya/wix-events";
|
|
20
21
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
21
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
22
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
22
23
|
import { get, upsert, type DbEntity } from "@himalaya/local-db";
|
|
23
24
|
import {
|
|
24
25
|
currentInputId,
|
|
@@ -986,16 +987,18 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
986
987
|
if (pay.kind === "paid") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.ticketIssued", "You're in — your ticket is confirmed.") };
|
|
987
988
|
else if (pay.kind === "handoff") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") };
|
|
988
989
|
else if (pay.kind === "cancelled") result = { ...s, snackbarMessage: detailCopy("event.ticketCancelled", "Payment cancelled — no ticket was issued.") };
|
|
990
|
+
else if (isPaymentSetupFailure(pay)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
989
991
|
else throw new Error("Payment could not be completed");
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
}
|
|
993
|
-
} catch {
|
|
995
|
+
} catch (error) {
|
|
996
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
994
997
|
try {
|
|
995
998
|
// A public event page is not pinned to this selection or price. Only
|
|
996
999
|
// continue in hosted checkout when a reservation already holds it.
|
|
997
1000
|
const params = reservationId ? { reservationId } : undefined;
|
|
998
|
-
if (params) {
|
|
1001
|
+
if (params && !result) {
|
|
999
1002
|
const redirect = await createRedirectSession({ eventsCheckout: params });
|
|
1000
1003
|
const url = redirect.redirectSession?.fullUrl;
|
|
1001
1004
|
if (url) {
|
|
@@ -1003,7 +1006,9 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
1003
1006
|
result = { ...s, ticketSheetOpen: false, snackbarMessage: opened.opened ? detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") : detailCopy("event.registrationOpenFailed", "Could not open the registration page.") };
|
|
1004
1007
|
}
|
|
1005
1008
|
}
|
|
1006
|
-
} catch {
|
|
1009
|
+
} catch (error) {
|
|
1010
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
1011
|
+
}
|
|
1007
1012
|
if (!result) result = { ...s, snackbarMessage: detailCopy("event.purchaseUnavailable", "Purchasing is temporarily unavailable.") };
|
|
1008
1013
|
} finally { ticketCheckoutInFlight = false; }
|
|
1009
1014
|
return derive(result!);
|
|
@@ -52829,8 +52829,7 @@ const SCREENS = runtimeSetting({
|
|
|
52829
52829
|
"params": {
|
|
52830
52830
|
"screenId": "himi_owner_lite_search",
|
|
52831
52831
|
"title": "Search records",
|
|
52832
|
-
"subtitle": "Across your business areas"
|
|
52833
|
-
"search": "drawer"
|
|
52832
|
+
"subtitle": "Across your business areas"
|
|
52834
52833
|
}
|
|
52835
52834
|
},
|
|
52836
52835
|
"pressFeedback": "scale",
|
|
@@ -54349,7 +54348,7 @@ const SCREENS = runtimeSetting({
|
|
|
54349
54348
|
"actionId": "tier5.himiOwnerLiteSearch.search"
|
|
54350
54349
|
},
|
|
54351
54350
|
"debounceMs": 200,
|
|
54352
|
-
"
|
|
54351
|
+
"loadingPath": "$service:himiOwnerLiteSearch.anyLoading"
|
|
54353
54352
|
}
|
|
54354
54353
|
}
|
|
54355
54354
|
},
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// SDK; this only supplies the copy and the hydration reset.
|
|
5
5
|
import { hostSessionFromGlobal, type IapPriceCopy } from "@himalaya/iap";
|
|
6
6
|
import type { IapCommerce, IapPurchaseCopy, IapRestoreResult } from "@himalaya/iap-checkout";
|
|
7
|
+
import { paymentSetupMessage } from "./payment-setup.js";
|
|
7
8
|
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
8
9
|
|
|
9
10
|
/** Price labels from the screen's copy pack (`<prefix>.priceLoadingText`, …). */
|
|
@@ -25,6 +26,7 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
|
|
|
25
26
|
awaitingApproval: copyParam(`${prefix}.purchaseAwaitingApprovalText`, "Waiting for approval"),
|
|
26
27
|
unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
|
|
27
28
|
signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
|
|
29
|
+
sitePaymentUnavailable: paymentSetupMessage(prefix),
|
|
28
30
|
retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
|
|
29
31
|
priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
|
|
30
32
|
support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { copyParam } from "./himi-copy.js";
|
|
2
|
+
|
|
3
|
+
/** No provider or country guess: Wix only established that online payment is unavailable. */
|
|
4
|
+
export function paymentSetupMessage(prefix: string): string {
|
|
5
|
+
return copyParam(`${prefix}.paymentSetupUnavailable`, "This site is not accepting online payments. Go back or contact the business for other payment options.");
|
|
6
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
// Tier-5 bundle: himi-events — event detail.
|
|
2
3
|
import { calendarDay, formatClock, formatCurrency, formatWeekdayDateTime, formatWeekdayMonthDay, formatTimeZoneLabel } from "../_shared/engine-intl.js";
|
|
3
4
|
import { defineService as registerService } from "@himalaya/state";
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
type WixEvent,
|
|
19
20
|
} from "@himalaya/wix-events";
|
|
20
21
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
21
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
22
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
22
23
|
import { get, upsert, type DbEntity } from "@himalaya/local-db";
|
|
23
24
|
import {
|
|
24
25
|
currentInputId,
|
|
@@ -986,16 +987,18 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
986
987
|
if (pay.kind === "paid") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.ticketIssued", "You're in — your ticket is confirmed.") };
|
|
987
988
|
else if (pay.kind === "handoff") result = { ...s, ticketSheetOpen: false, snackbarMessage: detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") };
|
|
988
989
|
else if (pay.kind === "cancelled") result = { ...s, snackbarMessage: detailCopy("event.ticketCancelled", "Payment cancelled — no ticket was issued.") };
|
|
990
|
+
else if (isPaymentSetupFailure(pay)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
989
991
|
else throw new Error("Payment could not be completed");
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
}
|
|
993
|
-
} catch {
|
|
995
|
+
} catch (error) {
|
|
996
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
994
997
|
try {
|
|
995
998
|
// A public event page is not pinned to this selection or price. Only
|
|
996
999
|
// continue in hosted checkout when a reservation already holds it.
|
|
997
1000
|
const params = reservationId ? { reservationId } : undefined;
|
|
998
|
-
if (params) {
|
|
1001
|
+
if (params && !result) {
|
|
999
1002
|
const redirect = await createRedirectSession({ eventsCheckout: params });
|
|
1000
1003
|
const url = redirect.redirectSession?.fullUrl;
|
|
1001
1004
|
if (url) {
|
|
@@ -1003,7 +1006,9 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
|
|
|
1003
1006
|
result = { ...s, ticketSheetOpen: false, snackbarMessage: opened.opened ? detailCopy("event.checkoutOpened", "Complete checkout in the browser to get your tickets.") : detailCopy("event.registrationOpenFailed", "Could not open the registration page.") };
|
|
1004
1007
|
}
|
|
1005
1008
|
}
|
|
1006
|
-
} catch {
|
|
1009
|
+
} catch (error) {
|
|
1010
|
+
if (isPaymentSetupFailure(error)) result = { ...s, snackbarMessage: paymentSetupMessage("event") };
|
|
1011
|
+
}
|
|
1007
1012
|
if (!result) result = { ...s, snackbarMessage: detailCopy("event.purchaseUnavailable", "Purchasing is temporarily unavailable.") };
|
|
1008
1013
|
} finally { ticketCheckoutInFlight = false; }
|
|
1009
1014
|
return derive(result!);
|
|
@@ -52446,8 +52446,7 @@ const SCREENS = runtimeSetting({
|
|
|
52446
52446
|
"params": {
|
|
52447
52447
|
"screenId": "himi_owner_lite_search",
|
|
52448
52448
|
"title": "Search records",
|
|
52449
|
-
"subtitle": "Across your business areas"
|
|
52450
|
-
"search": "drawer"
|
|
52449
|
+
"subtitle": "Across your business areas"
|
|
52451
52450
|
}
|
|
52452
52451
|
},
|
|
52453
52452
|
"pressFeedback": "scale",
|
|
@@ -53966,7 +53965,7 @@ const SCREENS = runtimeSetting({
|
|
|
53966
53965
|
"actionId": "tier5.himiOwnerLiteSearch.search"
|
|
53967
53966
|
},
|
|
53968
53967
|
"debounceMs": 200,
|
|
53969
|
-
"
|
|
53968
|
+
"loadingPath": "$service:himiOwnerLiteSearch.anyLoading"
|
|
53970
53969
|
}
|
|
53971
53970
|
}
|
|
53972
53971
|
},
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// SDK; this only supplies the copy and the hydration reset.
|
|
5
5
|
import { hostSessionFromGlobal, type IapPriceCopy } from "@himalaya/iap";
|
|
6
6
|
import type { IapCommerce, IapPurchaseCopy, IapRestoreResult } from "@himalaya/iap-checkout";
|
|
7
|
+
import { paymentSetupMessage } from "./payment-setup.js";
|
|
7
8
|
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
8
9
|
|
|
9
10
|
/** Price labels from the screen's copy pack (`<prefix>.priceLoadingText`, …). */
|
|
@@ -25,6 +26,7 @@ export function iapPurchaseCopy(prefix: string): IapPurchaseCopy {
|
|
|
25
26
|
awaitingApproval: copyParam(`${prefix}.purchaseAwaitingApprovalText`, "Waiting for approval"),
|
|
26
27
|
unavailable: copyParam(`${prefix}.purchaseTemporarilyUnavailableText`, "Purchasing is temporarily unavailable."),
|
|
27
28
|
signInRequired: copyParam(`${prefix}.purchaseSignInText`, "Sign in to buy."),
|
|
29
|
+
sitePaymentUnavailable: paymentSetupMessage(prefix),
|
|
28
30
|
retry: copyParam(`${prefix}.purchaseRetryText`, "Something went wrong. Try again."),
|
|
29
31
|
priceChanged: copyParam(`${prefix}.purchasePriceChangedText`, "The price changed. Check it and try again."),
|
|
30
32
|
support: copyParam(`${prefix}.purchaseSupportText`, "We couldn't finish this purchase. Contact support."),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { copyParam } from "./himi-copy.js";
|
|
2
|
+
|
|
3
|
+
/** No provider or country guess: Wix only established that online payment is unavailable. */
|
|
4
|
+
export function paymentSetupMessage(prefix: string): string {
|
|
5
|
+
return copyParam(`${prefix}.paymentSetupUnavailable`, "This site is not accepting online payments. Go back or contact the business for other payment options.");
|
|
6
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites, offlineWritesEnabled } from "../_shared/online-actions.js";
|
|
2
3
|
// Tier-5 bundle: himi-booking — availability and member booking.
|
|
3
4
|
import { defineService as registerService, navigate } from "@himalaya/state";
|
|
@@ -9,7 +10,7 @@ import { dispatch } from "@himalaya/dispatch";
|
|
|
9
10
|
import { bookSchedule, bookSlot, getService, queryServiceAvailability, registerToWaitlist, type WixBookingSlotFull, type WixSelectedPaymentOption, type WixService } from "@himalaya/wix-bookings";
|
|
10
11
|
import { createCheckout, createOrder } from "@himalaya/wix-ecom";
|
|
11
12
|
import { createRedirectSession, type WixSlot } from "@himalaya/wix-redirects";
|
|
12
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
13
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
13
14
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
14
15
|
import { session as wixPlatformSession } from "@himalaya/wix-platform";
|
|
15
16
|
import { displayName, getMyData, type WixMyData } from "@himalaya/wix-users";
|
|
@@ -1587,10 +1588,12 @@ async function bookSelectedIn(s: S): Promise<S> {
|
|
|
1587
1588
|
? copyParam("time.coursePaymentCancelled", "Payment cancelled — your course booking wasn't confirmed. Try again.")
|
|
1588
1589
|
: copyParam("time.paymentCancelled", "Payment cancelled — your booking wasn't confirmed. Pick a time to try again.") });
|
|
1589
1590
|
}
|
|
1591
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1590
1592
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1591
1593
|
? copyParam("time.coursePaymentFailed", "Payment couldn't be completed. Try again.")
|
|
1592
1594
|
: copyParam("time.paymentFailed", "Payment couldn't be completed. Pick another time or try again.") });
|
|
1593
|
-
} catch {
|
|
1595
|
+
} catch (error) {
|
|
1596
|
+
if (isPaymentSetupFailure(error)) return derive({ ...s, bookingInFlight: false, message: paymentSetupMessage("time") });
|
|
1594
1597
|
return derive({ ...s, bookingInFlight: false, message: s.isCourse
|
|
1595
1598
|
? copyParam("time.courseCheckoutFailed", "Checkout could not start. Try again.")
|
|
1596
1599
|
: copyParam("time.checkoutFailed", "Checkout could not start. Pick another time or try again.") });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
1
2
|
import { withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
3
|
import { defineService as registerState } from "@himalaya/state";
|
|
3
4
|
import { getStoreProduct } from "../_shared/himi-store.js";
|
|
@@ -7,7 +8,7 @@ import { withIapPresentation } from "../_shared/iap-presentation.js";
|
|
|
7
8
|
import { type IapCommerce, classifyCart } from "@himalaya/iap-checkout";
|
|
8
9
|
import { addCouponToCurrentCart, calculateCurrentCart, createCheckoutFromCurrentCart, getCurrentCart, removeCouponFromCurrentCart, removeLineItemsFromCurrentCart, updateLineItemsQuantity, type WixCartDetail, type WixCartLineItemDetail } from "@himalaya/wix-ecom";
|
|
9
10
|
import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
10
|
-
import { payCashierOrder } from "@himalaya/checkout";
|
|
11
|
+
import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
|
|
11
12
|
import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
|
|
12
13
|
import { formatCurrency } from "../_shared/engine-intl.js";
|
|
13
14
|
|
|
@@ -574,8 +575,10 @@ const svc = defineService<State, {
|
|
|
574
575
|
// only confirmed once it lands, so the cart must survive a bail-out.
|
|
575
576
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutOpenedMessage", "Checkout opened.") });
|
|
576
577
|
}
|
|
578
|
+
if (isPaymentSetupFailure(pay)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
577
579
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
578
|
-
} catch {
|
|
580
|
+
} catch (error) {
|
|
581
|
+
if (isPaymentSetupFailure(error)) return derive({ ...state, checkoutHint: paymentSetupMessage("cart") });
|
|
579
582
|
return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
|
|
580
583
|
}
|
|
581
584
|
},
|