@tickean/checkout-js 0.2.11 → 0.2.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.
- package/README.md +17 -2
- package/dist/index.d.mts +28 -3
- package/dist/index.d.ts +28 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,13 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Framework-agnostic TypeScript client for Tickean Headless Checkout.
|
|
4
4
|
|
|
5
|
+
Current version: **0.2.12**.
|
|
6
|
+
|
|
5
7
|
## APIs
|
|
6
8
|
|
|
7
|
-
- `createTickean(options)` — low-level client
|
|
9
|
+
- `createTickean(options)` — low-level client
|
|
8
10
|
- `createCheckoutController(options)` — state machine with cart, quote debounce, OTP, purchase+payment, persistence, telemetry
|
|
11
|
+
- `tickean.exchangeRecovery({ code })` — abandon-cart recovery (`POST /v1/checkout/recovery/exchange`)
|
|
12
|
+
- `resumeCode` option on the controller — exchange + rehydrate on init
|
|
9
13
|
|
|
10
14
|
## Phases
|
|
11
15
|
|
|
12
16
|
`initializing` → `browsing` → `quoting` → `verifying_buyer` → `ready_to_purchase` → `purchasing` → `requires_action` | `processing` → `completed` | `failed` | `expired`
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
## Recovery example
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const controller = createCheckoutController({
|
|
22
|
+
publishableKey: "pk_live_...",
|
|
23
|
+
eventSlug: "mi-evento",
|
|
24
|
+
returnUrl: "https://tusitio.com/checkout/",
|
|
25
|
+
resumeCode: new URLSearchParams(location.search).get("resume") || undefined,
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
See [Reanudar sesión](../../docs/readme/18-session-resume.md) and the repository root README for monorepo build/test commands.
|
package/dist/index.d.mts
CHANGED
|
@@ -162,11 +162,36 @@ type CartItem = {
|
|
|
162
162
|
showOptionId: string;
|
|
163
163
|
amount: number;
|
|
164
164
|
};
|
|
165
|
+
type QuotePricingLine = {
|
|
166
|
+
showOptionId?: string;
|
|
167
|
+
quantity?: number;
|
|
168
|
+
baseUnitPrice?: number;
|
|
169
|
+
lineTotal?: number;
|
|
170
|
+
codeDiscountAmount?: number;
|
|
171
|
+
codeDiscountedUnits?: number;
|
|
172
|
+
};
|
|
173
|
+
type QuotePricingBreakdown = {
|
|
174
|
+
subtotalBase?: number;
|
|
175
|
+
promotionDiscountTotal?: number;
|
|
176
|
+
codeDiscountTotal?: number;
|
|
177
|
+
serviceCharge?: number;
|
|
178
|
+
total?: number;
|
|
179
|
+
lines?: QuotePricingLine[];
|
|
180
|
+
};
|
|
181
|
+
type QuoteDiscountCode = {
|
|
182
|
+
code?: string;
|
|
183
|
+
discountType?: "PERCENT" | "FIXED" | string;
|
|
184
|
+
value?: number;
|
|
185
|
+
amountApplied?: number;
|
|
186
|
+
benefitKind?: string;
|
|
187
|
+
allowedShowOptionIds?: string[];
|
|
188
|
+
applicationMode?: string;
|
|
189
|
+
};
|
|
165
190
|
type QuoteResult = {
|
|
166
191
|
valid: boolean;
|
|
167
192
|
totalPrice: number;
|
|
168
|
-
pricingBreakdown?: unknown;
|
|
169
|
-
discountCode?: unknown;
|
|
193
|
+
pricingBreakdown?: QuotePricingBreakdown | unknown;
|
|
194
|
+
discountCode?: QuoteDiscountCode | unknown;
|
|
170
195
|
message?: string;
|
|
171
196
|
unlockedShowOptionIds?: string[];
|
|
172
197
|
unlockedShowOptions?: PublicShowOption[];
|
|
@@ -614,4 +639,4 @@ declare function resolveRedirectUrl(params: {
|
|
|
614
639
|
initPoint?: string | null;
|
|
615
640
|
}): string | null;
|
|
616
641
|
|
|
617
|
-
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|
|
642
|
+
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteDiscountCode, type QuotePricingBreakdown, type QuotePricingLine, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -162,11 +162,36 @@ type CartItem = {
|
|
|
162
162
|
showOptionId: string;
|
|
163
163
|
amount: number;
|
|
164
164
|
};
|
|
165
|
+
type QuotePricingLine = {
|
|
166
|
+
showOptionId?: string;
|
|
167
|
+
quantity?: number;
|
|
168
|
+
baseUnitPrice?: number;
|
|
169
|
+
lineTotal?: number;
|
|
170
|
+
codeDiscountAmount?: number;
|
|
171
|
+
codeDiscountedUnits?: number;
|
|
172
|
+
};
|
|
173
|
+
type QuotePricingBreakdown = {
|
|
174
|
+
subtotalBase?: number;
|
|
175
|
+
promotionDiscountTotal?: number;
|
|
176
|
+
codeDiscountTotal?: number;
|
|
177
|
+
serviceCharge?: number;
|
|
178
|
+
total?: number;
|
|
179
|
+
lines?: QuotePricingLine[];
|
|
180
|
+
};
|
|
181
|
+
type QuoteDiscountCode = {
|
|
182
|
+
code?: string;
|
|
183
|
+
discountType?: "PERCENT" | "FIXED" | string;
|
|
184
|
+
value?: number;
|
|
185
|
+
amountApplied?: number;
|
|
186
|
+
benefitKind?: string;
|
|
187
|
+
allowedShowOptionIds?: string[];
|
|
188
|
+
applicationMode?: string;
|
|
189
|
+
};
|
|
165
190
|
type QuoteResult = {
|
|
166
191
|
valid: boolean;
|
|
167
192
|
totalPrice: number;
|
|
168
|
-
pricingBreakdown?: unknown;
|
|
169
|
-
discountCode?: unknown;
|
|
193
|
+
pricingBreakdown?: QuotePricingBreakdown | unknown;
|
|
194
|
+
discountCode?: QuoteDiscountCode | unknown;
|
|
170
195
|
message?: string;
|
|
171
196
|
unlockedShowOptionIds?: string[];
|
|
172
197
|
unlockedShowOptions?: PublicShowOption[];
|
|
@@ -614,4 +639,4 @@ declare function resolveRedirectUrl(params: {
|
|
|
614
639
|
initPoint?: string | null;
|
|
615
640
|
}): string | null;
|
|
616
641
|
|
|
617
|
-
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|
|
642
|
+
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteDiscountCode, type QuotePricingBreakdown, type QuotePricingLine, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|