@wix/himalaya-cli 0.1659.0 → 0.1661.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/sdk/iap/src/attendance-classifier.d.ts +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery-contract.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +19 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +33 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +4 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +13 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs.d.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans.d.ts +4 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/shared.d.ts +3 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/order-refs.d.ts +8 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +622 -197
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +52 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +500 -119
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{c04dd5fc5ad48e6b19678d4313159302e9a513ada94bfe515d8dfd5a54d46f5d.bin → fcafca348b6b973cfc2eadc938ddec3c515c641874cbca1667a43b22e1bf7a39.bin} +1 -1
- package/dist/browser-plane/sw.js +1 -1
- package/dist/cli.mjs +203 -56
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/himi-json-output.md +26 -1
- package/guides/qa-builds.md +27 -4
- package/guides/sdk-reference.json +82 -12
- package/guides/skill.md +2 -2
- package/guides/web-page-sdk-reference.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/conference/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/salon-spa/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/wholesale-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
- package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
|
@@ -32,6 +32,8 @@ export declare function attendanceCheckoutRoute(item: BookingAttendance | Ticket
|
|
|
32
32
|
export declare function bookingAttendanceOf(raw: unknown): BookingAttendance;
|
|
33
33
|
/** Combines event delivery and ticket-definition pricing metadata for conservative route classification. */
|
|
34
34
|
export declare function ticketAttendanceOf(event: unknown, definition: unknown): TicketAttendance;
|
|
35
|
-
/** Reads the buyer-visible
|
|
35
|
+
/** Reads the buyer-visible ticket projection; hidden/off-sale inclusions and unknown pricing stay unresolved.
|
|
36
|
+
* Accepts both the v1 checkout row (`state`, `pricing.fixedPrice.amount`) and the v3 available
|
|
37
|
+
* ticket-definition row (`hidden`, `pricingMethod.fixedPrice.value`) that `queryAvailableTickets` returns. */
|
|
36
38
|
export declare function availableTicketAttendanceOf(event: unknown, ticket: unknown): TicketAttendance;
|
|
37
39
|
export {};
|
|
@@ -64,6 +64,9 @@ export interface DeliveryBackend {
|
|
|
64
64
|
getMemberContext(session: SessionSnapshot): Promise<ContextResult<MemberContext>>;
|
|
65
65
|
/** Must be idempotent per store/environment/transaction id; delivery is at-least-once. */
|
|
66
66
|
submitProof(session: SessionSnapshot, transaction: AppleTransaction): Promise<SubmitProofResult>;
|
|
67
|
+
/** The member closed the store sheet for this sale: nothing was bought. Optional, best effort:
|
|
68
|
+
* the coordinator never waits on its outcome, and a sale nobody pays expires anyway. */
|
|
69
|
+
abandonPurchase?(session: SessionSnapshot, catalogRef: string): Promise<void>;
|
|
67
70
|
}
|
|
68
71
|
/** The three managed verbs; `appleManagedStore` in index.ts is the production binding. */
|
|
69
72
|
export interface TransactionStore {
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts
CHANGED
|
@@ -76,6 +76,13 @@ export interface PaywallConfig {
|
|
|
76
76
|
* declares no IAP config.
|
|
77
77
|
*/
|
|
78
78
|
export declare function getPaywallConfig(): Promise<PaywallConfig>;
|
|
79
|
+
/**
|
|
80
|
+
* The App Store storefront the signed-in Apple account buys in: StoreKit's
|
|
81
|
+
* `Storefront.current.countryCode`, ISO 3166-1 alpha-3 such as `USA`. wix-iap bills
|
|
82
|
+
* a Pricing Plans order in this country. `null` where the store has no storefront
|
|
83
|
+
* (Android, the web) or cannot say; the server then falls back to the member's address.
|
|
84
|
+
*/
|
|
85
|
+
export declare function storefrontCountryCode(): Promise<string | null>;
|
|
79
86
|
/**
|
|
80
87
|
* Look up store metadata (localized title/price/etc.) for the given product ids.
|
|
81
88
|
* Ids must be pre-registered in App Store Connect / Play Console — they cannot be
|
|
@@ -61,6 +61,23 @@ export declare const PRICING_PLAN_APPLE_SALES_ENABLED = true;
|
|
|
61
61
|
* Videos order adapter refuses every sale until this is on.
|
|
62
62
|
*/
|
|
63
63
|
export declare const VIDEOS_APPLE_SALES_ENABLED = false;
|
|
64
|
+
/**
|
|
65
|
+
* Which verticals order through wix-iap StartItemPayment (catalyst-server #24878 Plans, #24880 Online
|
|
66
|
+
* Programs, #24881 Bookings, #24882 Events) instead of the device's own checkout and StartPayment. The
|
|
67
|
+
* server places the order as the member, charges it with appleIAP and names the App Store product. Each
|
|
68
|
+
* OFF: that vertical keeps its client checkout. Turn one on only once production wix-iap and Serve's
|
|
69
|
+
* generated client carry its fields; each flips on its own.
|
|
70
|
+
*/
|
|
71
|
+
export declare const PRICING_PLAN_ITEM_PAYMENT_ENABLED = false;
|
|
72
|
+
export declare const ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED = false;
|
|
73
|
+
export declare const BOOKINGS_ITEM_PAYMENT_ENABLED = false;
|
|
74
|
+
export declare const EVENTS_ITEM_PAYMENT_ENABLED = false;
|
|
75
|
+
/**
|
|
76
|
+
* CancelPayment (catalyst-server #24894, not deployed) when the member closes the Apple sheet: it cancels
|
|
77
|
+
* the pending Payment and releases the ticket reservation or booking it held. OFF: nothing is sent, and the
|
|
78
|
+
* Payment expires on its own in about an hour.
|
|
79
|
+
*/
|
|
80
|
+
export declare const CANCEL_PAYMENT_ENABLED = false;
|
|
64
81
|
/**
|
|
65
82
|
* The one definition `himi store iap connect` writes mappings by and the mapping source reads them by,
|
|
66
83
|
* keyed by catalog kind. wix-iap StartPayment maps the cashier order's single item id, and Online
|
|
@@ -123,7 +140,7 @@ export interface WixIapPayment {
|
|
|
123
140
|
}
|
|
124
141
|
export type WixIapOperation = "startPayment" | "startItemPayment" | "completePayment" | "cancelPayment" | "getPayment";
|
|
125
142
|
export type StartPaymentErrorCode = "NOT_PENDING" | "WRONG_PAYMENT_METHOD" | "NOT_ORDER_BUYER" | "UNSUPPORTED_ORDER" | "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED" | "APP_NOT_CONFIGURED" | "SUBSCRIPTION_NOT_IN_APP" | "ALREADY_SUBSCRIBED";
|
|
126
|
-
export type StartItemPaymentErrorCode = "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED" | "ITEM_NOT_AVAILABLE" | "SITE_NOT_ACCEPTING_PAYMENTS" | "UNSUPPORTED_ORDER" | "CATALOG_NOT_SUPPORTED" | "VERTICAL_ACCESS_DENIED" | "EVENT_CHECKOUT_NOT_ECOM" | "ALREADY_SUBSCRIBED" | "SUBSCRIPTION_NOT_IN_APP" | "BILLING_COUNTRY_REQUIRED" | "APP_NOT_CONFIGURED" | "NOT_BOOKING_OWNER" | "BOOKING_PAYMENT_PENDING";
|
|
143
|
+
export type StartItemPaymentErrorCode = "PRODUCT_NOT_AVAILABLE" | "ALREADY_OWNED" | "ITEM_NOT_AVAILABLE" | "SITE_NOT_ACCEPTING_PAYMENTS" | "UNSUPPORTED_ORDER" | "CATALOG_NOT_SUPPORTED" | "VERTICAL_ACCESS_DENIED" | "EVENT_CHECKOUT_NOT_ECOM" | "ALREADY_SUBSCRIBED" | "SUBSCRIPTION_NOT_IN_APP" | "BILLING_COUNTRY_REQUIRED" | "APP_NOT_CONFIGURED" | "NOT_BOOKING_OWNER" | "BOOKING_PAYMENT_PENDING" | "MEMBER_DETAILS_REQUIRED";
|
|
127
144
|
export type CompletePaymentErrorCode = "INVALID_PURCHASE" | "OWNED_BY_ANOTHER_CUSTOMER" | "PURCHASE_REVOKED" | "NOT_PURCHASED" | "ZERO_PRICE" | "NO_MATCHING_PAYMENT" | "PAYMENT_NOT_PENDING" | "APP_NOT_CONFIGURED";
|
|
128
145
|
export type GetPaymentErrorCode = "NOT_FOUND";
|
|
129
146
|
export type CancelPaymentErrorCode = "NOT_PENDING" | "APP_NOT_CONFIGURED" | "NOT_FOUND";
|
|
@@ -188,6 +205,7 @@ export type StartItemPaymentResult = {
|
|
|
188
205
|
appAccountToken: string;
|
|
189
206
|
ecomOrderId?: string;
|
|
190
207
|
joinApplicationId?: string;
|
|
208
|
+
eventsOrderNumber?: string;
|
|
191
209
|
} | WixIapFailure<StartItemPaymentErrorCode> | StartItemPaymentOutcomeUnknown;
|
|
192
210
|
/** `matched`: the server verified the proof and paid the payment whose token the Apple transaction
|
|
193
211
|
* carries. Its status may still be `approving`. */
|
|
@@ -45,6 +45,8 @@ export declare function decodeStarted(raw: unknown, expected: PaymentExpectation
|
|
|
45
45
|
export interface StartedItemPayment extends StartedPayment {
|
|
46
46
|
ecomOrderId?: string;
|
|
47
47
|
joinApplicationId?: string;
|
|
48
|
+
/** A ticket of a classic Events checkout (catalyst-server #24882): its Events order number. */
|
|
49
|
+
eventsOrderNumber?: string;
|
|
48
50
|
}
|
|
49
51
|
/** As StartPayment's answer, plus the member's eCom order or, for Online Programs, join application.
|
|
50
52
|
* The Payment must name the requested
|
|
@@ -16,7 +16,7 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
16
16
|
readonly haptic: readonly ["play", "sequence", "vibrate"];
|
|
17
17
|
readonly health: readonly ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"];
|
|
18
18
|
readonly himi_apps: readonly ["canOpen", "current", "hostInfo", "open"];
|
|
19
|
-
readonly iap: readonly ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"];
|
|
19
|
+
readonly iap: readonly ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"];
|
|
20
20
|
readonly keyboard: readonly ["dismiss"];
|
|
21
21
|
readonly legacy_import: readonly ["ack", "read"];
|
|
22
22
|
readonly live_activity: readonly ["end", "start", "update"];
|
|
@@ -111,6 +111,8 @@ export type OpeningResolution = "released" | "held" | "unrelated" | "unavailable
|
|
|
111
111
|
export interface PlacedItem {
|
|
112
112
|
ecomOrderId?: string;
|
|
113
113
|
joinApplicationId?: string;
|
|
114
|
+
/** A ticket of a classic Events checkout: no eCom order, only the event's order number. */
|
|
115
|
+
eventsOrderNumber?: string;
|
|
114
116
|
}
|
|
115
117
|
/** An item wix-iap orders itself (StartItemPayment): the item as its catalog reference, and how the
|
|
116
118
|
* adapter finds what that call placed. */
|
|
@@ -138,8 +140,8 @@ export interface IapVerticalOrderAdapter extends IapAdapterBase {
|
|
|
138
140
|
/** Opens, or reuses the vertical's own open, order for the signed-in member. */
|
|
139
141
|
/** Repeatable adapters call beforeCreate immediately before their first inventory write,
|
|
140
142
|
* after read-only checks, and abort without writing if it returns false. They call afterCreate
|
|
141
|
-
* with the ids of each inventory write as soon as it answers
|
|
142
|
-
openOrder(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) =>
|
|
143
|
+
* with the ids of each inventory write as soon as it answers; on false they answer `unavailable`. */
|
|
144
|
+
openOrder(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) => boolean): Promise<OrderAttempt>;
|
|
143
145
|
/** Settles an earlier attempt's guard before a new sale of the same item. `settled`: the attempt
|
|
144
146
|
* that wrote it has had time to finish, so what it created may be undone; before then it may be
|
|
145
147
|
* another screen's sale still in flight. `claim` must answer true immediately before anything
|
|
@@ -158,13 +160,26 @@ export interface IapVerticalOrderAdapter extends IapAdapterBase {
|
|
|
158
160
|
}
|
|
159
161
|
/** A vertical whose order wix-iap places and charges server-side (StartItemPayment): the device
|
|
160
162
|
* never opens, charges or reopens one. */
|
|
163
|
+
/** What `itemPayment` answers when the item cannot be ordered: nothing was sent to wix-iap. */
|
|
164
|
+
export type ItemPaymentRefusal = Extract<OrderAttempt, {
|
|
165
|
+
status: "refused" | "unavailable" | "sessionChanged";
|
|
166
|
+
}>;
|
|
161
167
|
export interface IapItemPaymentAdapter extends IapAdapterBase {
|
|
162
|
-
/** The catalog item to order, for an item `eligibility` accepted.
|
|
163
|
-
|
|
168
|
+
/** The catalog item to order, for an item `eligibility` accepted. A vertical that must read or
|
|
169
|
+
* make something first (a plan's pricing variant, the member's booking) does it here, through
|
|
170
|
+
* the session-bound bridge, before anything is ordered. */
|
|
171
|
+
itemPayment(item: IapOrderItem, bridge: SessionBoundBridge, beforeCreate?: (guard: OpeningGuard) => boolean, afterCreate?: (guard: OpeningGuard) => boolean): ItemPayment | ItemPaymentRefusal | Promise<ItemPayment | ItemPaymentRefusal>;
|
|
164
172
|
openOrder?: never;
|
|
165
173
|
reopenOrder?: never;
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
/** Each sale is its own attempt (a ticket, a booking): the item carries an `attemptId`. */
|
|
175
|
+
repeatable?: boolean;
|
|
176
|
+
/** A repeatable adapter whose `itemPayment` makes something first (the member's booking) guards it
|
|
177
|
+
* as an order adapter does: `beforeCreate` before that write, `afterCreate` with what it made, and
|
|
178
|
+
* `resolveOpening` settles one a later attempt finds unpaid. */
|
|
179
|
+
resolveOpening?: IapVerticalOrderAdapter["resolveOpening"];
|
|
180
|
+
/** StartItemPayment answers a re-tap with the same pending Payment (Online Programs), so a closed
|
|
181
|
+
* sheet's CancelPayment could cancel the sale being paid: none is sent. */
|
|
182
|
+
reusesPayment?: boolean;
|
|
168
183
|
}
|
|
169
184
|
/** The only per-vertical code. */
|
|
170
185
|
export type IapOrderAdapter = IapVerticalOrderAdapter | IapItemPaymentAdapter;
|
|
@@ -198,13 +213,22 @@ export interface OrderRef {
|
|
|
198
213
|
appAccountToken?: string;
|
|
199
214
|
/** For `openingOrder`: when anything its write created has been released by Wix. */
|
|
200
215
|
releaseAt?: number;
|
|
216
|
+
/** For `openingOrder`: the attempt that owns the guard. Ownership is checked by it, never by
|
|
217
|
+
* `updatedAt`, which two workers can write in the same millisecond. Absent on guards stored before it. */
|
|
218
|
+
guardToken?: string;
|
|
201
219
|
updatedAt: number;
|
|
202
220
|
}
|
|
221
|
+
/** `replaced`: the key no longer holds the expected guard, so nothing was written. */
|
|
222
|
+
export type GuardWrite = "written" | "replaced" | "unavailable";
|
|
203
223
|
export interface OrderRefPartition {
|
|
204
224
|
refs(): readonly OrderRef[];
|
|
205
225
|
/** False when the write could not be verified as durable; the caller must not proceed. */
|
|
206
226
|
put(ref: OrderRef): boolean;
|
|
207
227
|
remove(key: string): boolean;
|
|
228
|
+
/** Writes `next` only while the key still holds `expected`'s creation guard (the same token). */
|
|
229
|
+
replaceGuard(expected: OrderRef, next: OrderRef): GuardWrite;
|
|
230
|
+
/** Removes the key only while it still holds `expected`'s creation guard. */
|
|
231
|
+
removeGuard(expected: OrderRef): GuardWrite;
|
|
208
232
|
}
|
|
209
233
|
export interface OrderRefStore {
|
|
210
234
|
/** Null when this partition cannot be stored durably: no storage bridge, unreadable or
|
|
@@ -217,7 +241,7 @@ export interface OrderRefStore {
|
|
|
217
241
|
siteId: string;
|
|
218
242
|
}): boolean | null;
|
|
219
243
|
}
|
|
220
|
-
export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "sitePaymentUnavailable" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged" | "outcomeUnknown";
|
|
244
|
+
export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "sitePaymentUnavailable" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged" | "outcomeUnknown" | "memberDetailsRequired" | "alreadySubscribed" | "bookingNotOwned";
|
|
221
245
|
/** Progress of a payment this device handed to wix-iap, tracked from its durable reference. */
|
|
222
246
|
export type PaymentAccess = "processing" | "granted" | "accessUnknown" | "needsSupport";
|
|
223
247
|
export interface PaymentProgress {
|
|
@@ -254,6 +278,8 @@ export interface AppleIapCheckoutDependencies {
|
|
|
254
278
|
/** The screen's catalog pricing: the route and the App Store product a sale must match. */
|
|
255
279
|
pricing: Pick<IapCatalogPricing, "view" | "appleProduct">;
|
|
256
280
|
store?: TransactionStore;
|
|
281
|
+
/** StoreKit's storefront country for StartItemPayment; defaults to `@himalaya/iap`'s native read. */
|
|
282
|
+
storeCountry?: () => Promise<string | null>;
|
|
257
283
|
refs?: OrderRefStore;
|
|
258
284
|
bridge?: WixBridge;
|
|
259
285
|
jitter?: (baseDelayMs: number) => number;
|
|
@@ -94,6 +94,10 @@ export interface IapPurchaseCopy {
|
|
|
94
94
|
retry: string;
|
|
95
95
|
/** Optional for existing SDK consumers; the app supplies a localized recovery message. */
|
|
96
96
|
sitePaymentUnavailable?: string;
|
|
97
|
+
/** Optional: the order needs the member's first name, last name and email on their profile. */
|
|
98
|
+
memberDetailsRequired?: string;
|
|
99
|
+
/** Optional: the member already holds a subscription in this app. */
|
|
100
|
+
alreadySubscribed?: string;
|
|
97
101
|
priceChanged: string;
|
|
98
102
|
support: string;
|
|
99
103
|
}
|
|
@@ -29,6 +29,11 @@ export interface WixOrderBackendDependencies {
|
|
|
29
29
|
/** Whether Apple may already be charging for this product: an unfinished transaction, or an Ask
|
|
30
30
|
* to Buy request awaiting approval. Asked inside the purchase job, after any reconcile. */
|
|
31
31
|
productBusy?(productId: string): boolean;
|
|
32
|
+
/** StoreKit's storefront country (alpha-3), the billing country of a Pricing Plans order; null
|
|
33
|
+
* when the store has none. Read before every StartItemPayment. */
|
|
34
|
+
storeCountry?(): Promise<string | null>;
|
|
35
|
+
/** Whether a closed Apple sheet sends CancelPayment; defaults to `CANCEL_PAYMENT_ENABLED` (off). */
|
|
36
|
+
cancelPaymentEnabled?: boolean;
|
|
32
37
|
report(event: OrderEvent): void;
|
|
33
38
|
}
|
|
34
39
|
export declare function createWixOrderBackend(deps: WixOrderBackendDependencies): DeliveryBackend;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IapOrderAdapter } from "../apple-iap-contract.js";
|
|
2
|
+
export declare function attendanceClientOrdersWith(options: {
|
|
3
|
+
bookingsEnabled: boolean;
|
|
4
|
+
eventsEnabled: boolean;
|
|
5
|
+
now?: () => number;
|
|
6
|
+
}): {
|
|
7
|
+
bookingOrders: IapOrderAdapter;
|
|
8
|
+
eventTicketOrders: IapOrderAdapter;
|
|
9
|
+
};
|
|
10
|
+
export declare const bookingClientOrders: IapOrderAdapter, eventTicketClientOrders: IapOrderAdapter;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IapItemPaymentAdapter } from "../apple-iap-contract.js";
|
|
2
2
|
export declare function attendanceOrdersWith(options: {
|
|
3
3
|
bookingsEnabled: boolean;
|
|
4
4
|
eventsEnabled: boolean;
|
|
5
|
-
now?: () => number;
|
|
6
5
|
}): {
|
|
7
|
-
bookingOrders:
|
|
8
|
-
eventTicketOrders:
|
|
6
|
+
bookingOrders: IapItemPaymentAdapter;
|
|
7
|
+
eventTicketOrders: IapItemPaymentAdapter;
|
|
9
8
|
};
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const bookingItemPayments: IapItemPaymentAdapter, eventTicketItemPayments: IapItemPaymentAdapter;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { IapOrderAdapter } from "../apple-iap-contract.js";
|
|
2
|
+
import { onlineProgramItemPayments } from "./online-programs.js";
|
|
3
|
+
import { onlineProgramClientOrders } from "./online-programs-orders.js";
|
|
4
|
+
import { pricingPlanItemPayments } from "./pricing-plans.js";
|
|
5
|
+
import { pricingPlanClientOrders } from "./pricing-plans-orders.js";
|
|
6
|
+
import { bookingItemPayments, eventTicketItemPayments } from "./attendance.js";
|
|
7
|
+
import { bookingClientOrders, eventTicketClientOrders } from "./attendance-orders.js";
|
|
8
|
+
export { onlineProgramItemPayments, onlineProgramClientOrders, pricingPlanItemPayments, pricingPlanClientOrders };
|
|
9
|
+
export { bookingItemPayments, eventTicketItemPayments, bookingClientOrders, eventTicketClientOrders };
|
|
3
10
|
export { storesProductOrders, classifyCart } from "./stores.js";
|
|
4
|
-
export { bookingOrders, eventTicketOrders } from "./attendance.js";
|
|
5
11
|
export { wixVideoOrders } from "./videos.js";
|
|
12
|
+
export declare const onlineProgramOrders: IapOrderAdapter;
|
|
13
|
+
export declare const pricingPlanOrders: IapOrderAdapter;
|
|
14
|
+
export declare const bookingOrders: IapOrderAdapter;
|
|
15
|
+
export declare const eventTicketOrders: IapOrderAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
1
|
+
import type { IapItemPaymentAdapter } from "../apple-iap-contract.js";
|
|
2
|
+
export declare const onlineProgramItemPayments: IapItemPaymentAdapter;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
1
|
+
import type { AccessRead, IapItemPaymentAdapter, SessionBoundBridge } from "../apple-iap-contract.js";
|
|
2
|
+
export declare const pricingPlanItemPayments: IapItemPaymentAdapter;
|
|
3
|
+
/** The member's live orders of the plan, paged: one ACTIVE order is access; none at all is no access. */
|
|
4
|
+
export declare function planAccess(planId: string, bridge: SessionBoundBridge): Promise<AccessRead>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessRead, BridgeOutcome, BridgeRefusal, IapEligibility, IapOrderItem, OrderAttempt } from "../apple-iap-contract.js";
|
|
1
|
+
import type { AccessRead, BridgeOutcome, BridgeRefusal, IapEligibility, IapOrderItem, OrderAttempt, SessionBoundBridge } from "../apple-iap-contract.js";
|
|
2
2
|
/** One unit of one item of the adapter's own kind. */
|
|
3
3
|
export declare function singleUnitOf(kind: string, item: IapOrderItem): IapEligibility;
|
|
4
4
|
/** A refusal an order step got: retryable when the vertical is down, final when it named one. */
|
|
@@ -17,3 +17,5 @@ export declare const UNSUPPORTED: IapEligibility;
|
|
|
17
17
|
export declare const ORDER_REFUSED: OrderAttempt;
|
|
18
18
|
export declare const ORDER_CLOSED: OrderAttempt;
|
|
19
19
|
export declare const GRANTED: OrderAttempt;
|
|
20
|
+
/** The payment status of an eCom order wix-iap placed (StartItemPayment): PAID is access. */
|
|
21
|
+
export declare function ecomOrderAccess(orderId: string | undefined, bridge: SessionBoundBridge): Promise<AccessRead>;
|
|
@@ -13,17 +13,21 @@ export declare const ITEM_START_HOLD_MS = 3600000;
|
|
|
13
13
|
/** Drops every hold older than its stage's hold time, whatever its key (an item, or a `payment:`
|
|
14
14
|
* with no local order), so holds never accumulate and lock the member out. A held proof still
|
|
15
15
|
* unfinished renews its hold on every retry, so only one Apple no longer delivers expires. A
|
|
16
|
-
* creation guard goes at its own `releaseAt
|
|
16
|
+
* creation guard goes at its own `releaseAt`, and only while it is still the guard that expired,
|
|
17
|
+
* never a fresh one another worker stored under the key since. Returns the keys it removed. */
|
|
17
18
|
export declare function pruneExpiredHolds(partition: OrderRefPartition, now: number): string[];
|
|
18
19
|
/** How long (5 minutes) a creation guard may belong to a sale still running in another screen's
|
|
19
20
|
* worker, which shares these references but not that sale's coordinator: longer than any one
|
|
20
21
|
* openOrder takes. Until then nothing it may have created is undone. A literal, as above. */
|
|
21
22
|
export declare const OPENING_SETTLE_MS = 300000;
|
|
22
23
|
/** Asks the guard's adapter to settle it. Before undoing anything the adapter claims the guard
|
|
23
|
-
* (
|
|
24
|
-
* is dropped only while it is still the stored guard: a slow answer never removes what
|
|
25
|
-
* worker wrote under the key since. A guard changed meanwhile is judged again as it now is. */
|
|
24
|
+
* (gives it a new token), so the sale that wrote it, should it still be running, is no longer
|
|
25
|
+
* charged. It is dropped only while it is still the stored guard: a slow answer never removes what
|
|
26
|
+
* another worker wrote under the key since. A guard changed meanwhile is judged again as it now is. */
|
|
26
27
|
export declare function settleOpening(partition: OrderRefPartition, adapter: IapOrderAdapter, guard: OrderRef, item: IapOrderItem | undefined, bridge: SessionBoundBridge, now: number): Promise<OpeningResolution | "storageUnavailable">;
|
|
28
|
+
export declare function isStoredGuard(partition: OrderRefPartition, guard: OrderRef): boolean;
|
|
29
|
+
/** Unique per creation attempt, across the workers sharing these references. */
|
|
30
|
+
export declare function newGuardToken(): string;
|
|
27
31
|
/** References one member keeps at once. When full, the oldest reference from before Apple's sheet
|
|
28
32
|
* is evicted; a partition full of handed-over payments refuses new sales instead. */
|
|
29
33
|
export declare const MAX_ORDER_REFS = 16;
|
|
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
31
31
|
"haptic": ["play", "sequence", "vibrate"],
|
|
32
32
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
33
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
|
-
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
|
|
34
|
+
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
35
35
|
"keyboard": ["dismiss"],
|
|
36
36
|
"legacy_import": ["ack", "read"],
|
|
37
37
|
"live_activity": ["end", "start", "update"],
|
|
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
31
31
|
"haptic": ["play", "sequence", "vibrate"],
|
|
32
32
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
33
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
|
-
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
|
|
34
|
+
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
35
35
|
"keyboard": ["dismiss"],
|
|
36
36
|
"legacy_import": ["ack", "read"],
|
|
37
37
|
"live_activity": ["end", "start", "update"],
|
|
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
31
31
|
"haptic": ["play", "sequence", "vibrate"],
|
|
32
32
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
33
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
|
-
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
|
|
34
|
+
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
35
35
|
"keyboard": ["dismiss"],
|
|
36
36
|
"legacy_import": ["ack", "read"],
|
|
37
37
|
"live_activity": ["end", "start", "update"],
|
|
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
31
31
|
"haptic": ["play", "sequence", "vibrate"],
|
|
32
32
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
33
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
|
-
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
|
|
34
|
+
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
35
35
|
"keyboard": ["dismiss"],
|
|
36
36
|
"legacy_import": ["ack", "read"],
|
|
37
37
|
"live_activity": ["end", "start", "update"],
|