@semics-tech/emdash-events 1.0.0-rc.11 → 1.0.0-rc.13
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/index.mjs +6 -1
- package/dist/manifest.json +6 -1
- package/dist/ts/astro/lib/call.d.ts +2 -0
- package/dist/ts/astro/lib/call.js +2 -0
- package/dist/ts/astro/lib/page.d.ts +1 -1
- package/dist/ts/astro/lib/page.js +1 -0
- package/dist/ts/integration/index.d.ts +9 -0
- package/dist/ts/integration/index.js +11 -0
- package/emdash-plugin.jsonc +5 -0
- package/package.json +1 -1
- package/src/astro/BookingPage.astro +11 -2
- package/src/astro/BookingStatus.astro +5 -0
- package/src/astro/BookingWidget.astro +24 -0
- package/src/astro/checkout-endpoint.ts +21 -3
- package/src/astro/lib/call.ts +4 -0
- package/src/astro/lib/checkout-form.ts +44 -1
- package/src/astro/lib/page.ts +1 -0
- package/src/astro/lib/widget.ts +15 -5
- package/src/astro/virtual.d.ts +23 -1
- package/src/i18n/ar.ts +8 -0
- package/src/i18n/en.ts +8 -0
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/** @type {import("emdash").PluginDescriptor} */
|
|
8
8
|
const descriptor = Object.freeze({
|
|
9
9
|
"id": "semics-events",
|
|
10
|
-
"version": "1.0.0-rc.
|
|
10
|
+
"version": "1.0.0-rc.13",
|
|
11
11
|
"format": "standard",
|
|
12
12
|
"entrypoint": "@semics-tech/emdash-events/sandbox",
|
|
13
13
|
"capabilities": [
|
|
@@ -364,6 +364,11 @@ const descriptor = Object.freeze({
|
|
|
364
364
|
"description": "Used by Events Pro only, for paid tickets; the Free edition ignores it. Stored encrypted.",
|
|
365
365
|
"type": "secret"
|
|
366
366
|
},
|
|
367
|
+
"vouchersPairing": {
|
|
368
|
+
"label": "Vouchers pairing string (Pro)",
|
|
369
|
+
"description": "Used by Events Pro only, for gift vouchers; the Free edition ignores it. Stored encrypted.",
|
|
370
|
+
"type": "secret"
|
|
371
|
+
},
|
|
367
372
|
"retentionDays": {
|
|
368
373
|
"label": "Keep booking data (days)",
|
|
369
374
|
"description": "Personal data of past events is erased after this many days.",
|
package/dist/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "semics-events",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.13",
|
|
4
4
|
"declaredAccess": {
|
|
5
5
|
"content": {
|
|
6
6
|
"read": {}
|
|
@@ -345,6 +345,11 @@
|
|
|
345
345
|
"description": "Used by Events Pro only, for paid tickets; the Free edition ignores it. Stored encrypted.",
|
|
346
346
|
"type": "secret"
|
|
347
347
|
},
|
|
348
|
+
"vouchersPairing": {
|
|
349
|
+
"label": "Vouchers pairing string (Pro)",
|
|
350
|
+
"description": "Used by Events Pro only, for gift vouchers; the Free edition ignores it. Stored encrypted.",
|
|
351
|
+
"type": "secret"
|
|
352
|
+
},
|
|
348
353
|
"retentionDays": {
|
|
349
354
|
"label": "Keep booking data (days)",
|
|
350
355
|
"description": "Personal data of past events is erased after this many days.",
|
|
@@ -34,6 +34,8 @@ export interface PublicRouteError {
|
|
|
34
34
|
message: string;
|
|
35
35
|
/** Input validation issues, when the route reported them (`BAD_REQUEST`). */
|
|
36
36
|
issues?: PublicRouteIssue[];
|
|
37
|
+
/** Any other top-level fields of the route's refusal, e.g. Vouchers' `lookups` (T166). */
|
|
38
|
+
details?: Record<string, unknown>;
|
|
37
39
|
}
|
|
38
40
|
export type PublicRouteResult<T> = {
|
|
39
41
|
ok: true;
|
|
@@ -100,10 +100,12 @@ function refusal(data) {
|
|
|
100
100
|
const body = data;
|
|
101
101
|
if (body.ok !== false || typeof body.error?.code !== "string")
|
|
102
102
|
return undefined;
|
|
103
|
+
const { ok: _ok, error: _error, issues: _issues, ...details } = body;
|
|
103
104
|
return {
|
|
104
105
|
code: body.error.code,
|
|
105
106
|
message: typeof body.error.message === "string" ? body.error.message : "Request failed",
|
|
106
107
|
...(Array.isArray(body.issues) ? { issues: body.issues } : {}),
|
|
108
|
+
...(Object.keys(details).length > 0 ? { details } : {}),
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
111
|
function toResult(envelope, via) {
|
|
@@ -39,6 +39,6 @@ export declare function eventPageHref(slug: string | null | undefined, eventPath
|
|
|
39
39
|
* rule for `main`'s sections, which outranks a component's own box (`.semics-payment`, `.semics-attendee-list`) so
|
|
40
40
|
* every card has the same edges, width and look (T158).
|
|
41
41
|
*/
|
|
42
|
-
export declare const PAGE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{color-scheme:light;-webkit-text-size-adjust:100%}\nbody.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;\n--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}\n.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}\n.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}\n.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}\n.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}\n:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}\n:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}\n:where(.semics-page) h2{font-size:1.25rem}\n:where(.semics-page) h3{font-size:1.0625rem}\n:where(.semics-page) p{margin:0 0 .75rem}\n:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}\n:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}\n:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}\n:where(.semics-page) [role=\"alert\"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}\n:where(.semics-page) :is(input:not([type=\"checkbox\"],[type=\"radio\"],[type=\"hidden\"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}\n:where(.semics-page) label{display:block}\n:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}\n:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}\n:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}\n.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}\n.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}\n.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}\n.semics-page-organiser p{margin:0}\n.semics-page-organiser address{font-style:normal}\n@media print{\n@page{margin:15mm}\nbody.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}\n.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}\n.semics-page-main{max-inline-size:none;padding:0}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}\n.semics-ticket-pass{break-inside:avoid}\n.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}\n}\n";
|
|
42
|
+
export declare const PAGE_CSS = "*,*::before,*::after{box-sizing:border-box}\nhtml{color-scheme:light;-webkit-text-size-adjust:100%}\nbody.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg, #f5f4f0);color:var(--events-fg, #1a1a1a);font-family:var(--events-font, system-ui, sans-serif);font-size:1.0625rem;line-height:1.55;overflow-wrap:anywhere;\n--esign-fg:var(--events-fg, #1a1a1a);--esign-muted:var(--events-muted, #4a4a4a);--esign-bg:var(--events-bg, #ffffff);--esign-border:var(--events-border, #6b6b6b);--esign-accent:var(--events-accent, #0b57d0);--esign-accent-fg:var(--events-accent-fg, #ffffff);--esign-error:var(--events-error, #b3261e);--esign-radius:var(--events-radius, 6px);--esign-font:var(--events-font, system-ui, sans-serif)}\n.semics-page-brand{max-inline-size:40rem;margin-inline:auto;padding:1.25rem 1rem 0;font-family:var(--events-heading-font, inherit);font-weight:600}\n.semics-page-brand a{color:var(--events-heading-fg, inherit);text-decoration:none}\n.semics-page-brand img{display:block;block-size:2.5rem;inline-size:auto;max-inline-size:100%}\n.semics-page-main{max-inline-size:40rem;margin-inline:auto;padding:1.5rem 1rem 2rem}\n:where(.semics-page) :is(h1,h2,h3){margin:0 0 .75rem;font-family:var(--events-heading-font, inherit);color:var(--events-heading-fg, inherit);line-height:1.2}\n:where(.semics-page) h1{margin-block-end:1.25rem;font-size:clamp(1.75rem,1.5rem + 1.5vw,2.25rem)}\n:where(.semics-page) h2{font-size:1.25rem}\n:where(.semics-page) h3{font-size:1.0625rem}\n:where(.semics-page) p{margin:0 0 .75rem}\n:where(.semics-page) a{color:var(--events-accent, #0b57d0);text-underline-offset:.2em}\n:where(.semics-page) :focus-visible{outline:3px solid var(--events-accent, #0b57d0);outline-offset:2px}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){margin-block:0 1.25rem;padding:clamp(1.25rem,.9rem + 1.8vw,1.75rem);background:var(--events-bg, #ffffff);border:1px solid color-mix(in srgb,var(--events-border, #6b6b6b) 30%,transparent);border-radius:calc(var(--events-radius, 6px) + 6px);box-shadow:0 1px 2px rgb(0 0 0 / .04),0 6px 24px rgb(0 0 0 / .05);max-inline-size:none}\n:where(.semics-page-main > section,.semics-page-main > form,.semics-page-main > .semics-ceremony) > :last-child{margin-block-end:0}\n:where(.semics-page) [role=\"alert\"]{padding:.75rem 1rem;border:1px solid var(--events-error, #b3261e);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-error, #b3261e)}\n:where(.semics-page) :is(input:not([type=\"checkbox\"],[type=\"radio\"],[type=\"hidden\"]),select,textarea){font:inherit;inline-size:100%;min-block-size:2.75rem;padding:.5rem .75rem;border:1px solid var(--events-border, #6b6b6b);border-radius:var(--events-radius, 6px);background:var(--events-bg, #ffffff);color:var(--events-fg, #1a1a1a)}\n:where(.semics-page) label{display:block}\n:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}\n:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}\n:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}\n:where(.semics-page) a.semics-page-button{display:inline-block;font-weight:600;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);text-decoration:none}\n.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}\n.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}\n.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}\n.semics-page-organiser p{margin:0}\n.semics-page-organiser address{font-style:normal}\n@media print{\n@page{margin:15mm}\nbody.semics-page{min-block-size:0;background:#ffffff;color:#000000;font-size:11pt}\n.semics-page-brand,.semics-page-actions,.semics-page-main form,.semics-page-main button,.semics-page-main details,.semics-add-to-calendar,[data-semics-payment-live]{display:none !important}\n.semics-page-main{max-inline-size:none;padding:0}\n.semics-page-main > :is(section,form:not([hidden]),.semics-ceremony){box-shadow:none;border-color:#999999;break-inside:avoid}\n.semics-ticket-pass{break-inside:avoid}\n.semics-page-organiser{max-inline-size:none;padding:1rem 0 0;color:#000000}\n}\n";
|
|
43
43
|
/** The stylesheet for a page: the defaults, then the site's theme. Exact: the signing page hashes this text. */
|
|
44
44
|
export declare function pageCss(page?: PageOptions): string;
|
|
@@ -98,6 +98,7 @@ body.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg,
|
|
|
98
98
|
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}
|
|
99
99
|
:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}
|
|
100
100
|
:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}
|
|
101
|
+
:where(.semics-page) a.semics-page-button{display:inline-block;font-weight:600;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);text-decoration:none}
|
|
101
102
|
.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}
|
|
102
103
|
.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}
|
|
103
104
|
.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PageOptions } from "../astro/lib/page.ts";
|
|
2
|
+
export { PAGE_CSS, pageCss } from "../astro/lib/page.ts";
|
|
2
3
|
export type { PageOptions };
|
|
3
4
|
export interface EventsIntegrationOptions {
|
|
4
5
|
/**
|
|
@@ -19,6 +20,14 @@ export interface EventsIntegrationOptions {
|
|
|
19
20
|
reconcile?: string;
|
|
20
21
|
/** How the plugin's own pages look on this site: theme, stylesheet, brand, event page path (`PageOptions`). */
|
|
21
22
|
page?: PageOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Gift vouchers (T166): the Vouchers core's plugin id and a module exporting `holdVoucher(ctx, input, ids)`
|
|
25
|
+
* (the suite passes its own). The checkout then holds a typed "Gift voucher code" between reserve and continue.
|
|
26
|
+
*/
|
|
27
|
+
vouchers?: {
|
|
28
|
+
pluginId: string;
|
|
29
|
+
module: string;
|
|
30
|
+
};
|
|
22
31
|
}
|
|
23
32
|
/** The slice of Astro's integration API this needs (so the package takes no `astro` dependency). */
|
|
24
33
|
interface SetupArgs {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { EVENTS_PLUGIN_ID } from "../astro/lib/call.js";
|
|
2
2
|
import { checkPageOptions } from "../astro/lib/page.js";
|
|
3
|
+
// The page sheet itself, so the suite can hand e-sign's pages the same look (T169).
|
|
4
|
+
export { PAGE_CSS, pageCss } from "../astro/lib/page.js";
|
|
3
5
|
const VIRTUAL = "virtual:semics-events/config";
|
|
4
6
|
const RESOLVED = `\0${VIRTUAL}`;
|
|
5
7
|
/**
|
|
@@ -20,6 +22,15 @@ export function eventsIntegration(options = {}) {
|
|
|
20
22
|
options.reconcile
|
|
21
23
|
? `export { reconcileBooking as reconcile } from ${JSON.stringify(options.reconcile)};`
|
|
22
24
|
: "export const reconcile = null;",
|
|
25
|
+
// Only with vouchers: a site without them gets exactly the config it had (pages read these by namespace).
|
|
26
|
+
...(options.vouchers
|
|
27
|
+
? [
|
|
28
|
+
`export const vouchersPluginId = ${JSON.stringify(options.vouchers.pluginId)};`,
|
|
29
|
+
`export { holdVoucher } from ${JSON.stringify(options.vouchers.module)};`,
|
|
30
|
+
// T168: the module's dry run, run before reserving.
|
|
31
|
+
`export { checkVoucher } from ${JSON.stringify(options.vouchers.module)};`,
|
|
32
|
+
]
|
|
33
|
+
: []),
|
|
23
34
|
].join("\n");
|
|
24
35
|
return {
|
|
25
36
|
name: "semics-events",
|
package/emdash-plugin.jsonc
CHANGED
|
@@ -189,6 +189,11 @@
|
|
|
189
189
|
"label": "Stripe webhook signing secret (Pro)",
|
|
190
190
|
"description": "Used by Events Pro only, for paid tickets; the Free edition ignores it. Stored encrypted."
|
|
191
191
|
},
|
|
192
|
+
"vouchersPairing": {
|
|
193
|
+
"type": "secret",
|
|
194
|
+
"label": "Vouchers pairing string (Pro)",
|
|
195
|
+
"description": "Used by Events Pro only, for gift vouchers; the Free edition ignores it. Stored encrypted."
|
|
196
|
+
},
|
|
192
197
|
"retentionDays": {
|
|
193
198
|
"type": "number",
|
|
194
199
|
"label": "Keep booking data (days)",
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// `src/client/receipt.ts` clears the fragment and posts the receipt here, which forwards it to the
|
|
9
9
|
// core's `signatures/receipt` (no access token needed: the receipt is HMAC-signed) and redirects to
|
|
10
10
|
// `?ref=&waiver=<outcome>`.
|
|
11
|
-
import
|
|
11
|
+
import * as config from "virtual:semics-events/config";
|
|
12
12
|
|
|
13
13
|
import { type MessageKey, pickLocale, translator } from "../i18n/index";
|
|
14
14
|
import AddToCalendar from "./AddToCalendar.astro";
|
|
@@ -39,6 +39,10 @@ import TicketPass from "./TicketPass.astro";
|
|
|
39
39
|
|
|
40
40
|
export const prerender = false;
|
|
41
41
|
|
|
42
|
+
const { esignPluginId, page, pluginId, reconcile } = config;
|
|
43
|
+
// Gift vouchers (T166): exported only when the site wires Vouchers, so read through the namespace.
|
|
44
|
+
const vouchersPluginId = (config as Partial<typeof config>).vouchersPluginId;
|
|
45
|
+
|
|
42
46
|
Astro.response.headers.set("Referrer-Policy", "no-referrer");
|
|
43
47
|
Astro.response.headers.set("Cache-Control", "private, no-store");
|
|
44
48
|
|
|
@@ -144,7 +148,12 @@ if (ref && token) {
|
|
|
144
148
|
// closed the tab or signed by email has a receipt this page forwards, then it shows the booking afresh.
|
|
145
149
|
// An ended booking's open envelopes are voided the same way (Pro's void intents, T152).
|
|
146
150
|
if (reconcileWanted(booking) && reconcile && esignPluginId) {
|
|
147
|
-
const done = await reconcile(ctx, {
|
|
151
|
+
const done = await reconcile(ctx, {
|
|
152
|
+
booking,
|
|
153
|
+
pluginId,
|
|
154
|
+
esignPluginId,
|
|
155
|
+
...(vouchersPluginId ? { vouchersPluginId } : {}),
|
|
156
|
+
});
|
|
148
157
|
if (done.forwarded > 0) {
|
|
149
158
|
const fresh = await callPublicRoute<BookingView>(ctx, {
|
|
150
159
|
method: "POST",
|
|
@@ -89,6 +89,11 @@ const names = showAttendees && new Set(named).size > 1 ? named : [];
|
|
|
89
89
|
<ul>{names.map((name) => <li>{name}</li>)}</ul>
|
|
90
90
|
</div>
|
|
91
91
|
)}
|
|
92
|
+
{(booking.totals.voucherMinor ?? 0) > 0 && (
|
|
93
|
+
<p class="semics-booking-voucher" data-testid="booking-voucher">
|
|
94
|
+
{t("booking.voucher")} <span>−{formatMoney(booking.totals.voucherMinor ?? 0, booking.totals.currency, locale)}</span>
|
|
95
|
+
</p>
|
|
96
|
+
)}
|
|
92
97
|
<p class="semics-booking-total">{t("booking.total")} <strong>{formatMoney(booking.totals.totalMinor, booking.totals.currency, locale)}</strong></p>
|
|
93
98
|
</div>
|
|
94
99
|
{
|
|
@@ -61,6 +61,9 @@ const id = anchorId(eventId);
|
|
|
61
61
|
// Promo codes are Events Pro's (T078): the field shows only when the core says it takes them. An
|
|
62
62
|
// applied code lives in an HttpOnly cookie (`/_events/promo`), never the URL, and is checked again here.
|
|
63
63
|
const takesCodes = data?.promoCodes === true;
|
|
64
|
+
// Gift vouchers (T166): only Events Pro paired with Vouchers says so. The code goes with the order; the
|
|
65
|
+
// checkout holds it with Vouchers between reserve and continue, and never puts it in a URL.
|
|
66
|
+
const takesVouchers = data?.vouchers === true;
|
|
64
67
|
let promo: PromoView | null = Astro.props.promo ?? null;
|
|
65
68
|
if (takesCodes && Astro.props.promo === undefined) {
|
|
66
69
|
let code = "";
|
|
@@ -301,6 +304,27 @@ const when = (iso: string) => {
|
|
|
301
304
|
</div>
|
|
302
305
|
)}
|
|
303
306
|
|
|
307
|
+
{takesVouchers && (
|
|
308
|
+
<div class="semics-field semics-voucher">
|
|
309
|
+
<label for={`${id}-voucher`}>{t("widget.voucher.label")}</label>
|
|
310
|
+
<input
|
|
311
|
+
id={`${id}-voucher`}
|
|
312
|
+
name="voucherCode"
|
|
313
|
+
type="text"
|
|
314
|
+
autocomplete="off"
|
|
315
|
+
autocapitalize="characters"
|
|
316
|
+
spellcheck="false"
|
|
317
|
+
maxlength="64"
|
|
318
|
+
data-field="voucher"
|
|
319
|
+
aria-invalid={invalid("voucher")}
|
|
320
|
+
aria-describedby={errId("voucher")}
|
|
321
|
+
/>
|
|
322
|
+
<p class="semics-field-error" id={errId("voucher")} data-error-for="voucher" data-message={fieldText("voucher")}>
|
|
323
|
+
{bad("voucher") ? fieldText("voucher") : ""}
|
|
324
|
+
</p>
|
|
325
|
+
</div>
|
|
326
|
+
)}
|
|
327
|
+
|
|
304
328
|
<fieldset class="semics-tickets" data-field="tickets" aria-invalid={invalid("tickets")} aria-describedby={errId("tickets")}>
|
|
305
329
|
<legend>{t("widget.tickets")}</legend>
|
|
306
330
|
{ticketTypes.map((type) => {
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
// Injected at `/_events/checkout` by the integration. A plain form post (no JavaScript needed).
|
|
2
2
|
// Cross-site posts get a 403 before anything runs (`isCrossSiteRequest`, T057).
|
|
3
|
-
|
|
3
|
+
// With `eventsIntegration({ vouchers })` a typed gift voucher code is held through the suite's hook (T166).
|
|
4
|
+
import * as config from "virtual:semics-events/config";
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type CheckoutEndpointContext,
|
|
8
|
+
handleCheckoutRequest,
|
|
9
|
+
type VoucherCheckHook,
|
|
10
|
+
type VoucherHook,
|
|
11
|
+
} from "./lib/checkout-form";
|
|
6
12
|
|
|
7
13
|
export const prerender = false;
|
|
8
14
|
|
|
15
|
+
const { pluginId, vouchersPluginId, holdVoucher, checkVoucher } = config as Partial<typeof config> & {
|
|
16
|
+
pluginId: string;
|
|
17
|
+
};
|
|
18
|
+
const voucher: VoucherHook | undefined =
|
|
19
|
+
holdVoucher && vouchersPluginId
|
|
20
|
+
? (ctx, input) => holdVoucher(ctx, input, { eventsPluginId: pluginId, vouchersPluginId })
|
|
21
|
+
: undefined;
|
|
22
|
+
|
|
23
|
+
// T168: the code is checked before reserving, so a refused one leaves no booking (and no "cancelled" email).
|
|
24
|
+
const check: VoucherCheckHook | undefined =
|
|
25
|
+
checkVoucher && vouchersPluginId ? (ctx, input) => checkVoucher(ctx, input, { vouchersPluginId }) : undefined;
|
|
26
|
+
|
|
9
27
|
export function POST(ctx: CheckoutEndpointContext): Promise<Response> {
|
|
10
|
-
return handleCheckoutRequest(ctx, { pluginId });
|
|
28
|
+
return handleCheckoutRequest(ctx, { pluginId, ...(voucher ? { voucher } : {}), ...(check ? { check } : {}) });
|
|
11
29
|
}
|
package/src/astro/lib/call.ts
CHANGED
|
@@ -41,6 +41,8 @@ export interface PublicRouteError {
|
|
|
41
41
|
message: string;
|
|
42
42
|
/** Input validation issues, when the route reported them (`BAD_REQUEST`). */
|
|
43
43
|
issues?: PublicRouteIssue[];
|
|
44
|
+
/** Any other top-level fields of the route's refusal, e.g. Vouchers' `lookups` (T166). */
|
|
45
|
+
details?: Record<string, unknown>;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export type PublicRouteResult<T> =
|
|
@@ -162,10 +164,12 @@ function refusal(data: unknown): PublicRouteError | undefined {
|
|
|
162
164
|
if (!data || typeof data !== "object") return undefined;
|
|
163
165
|
const body = data as { ok?: unknown; error?: { code?: unknown; message?: unknown }; issues?: unknown };
|
|
164
166
|
if (body.ok !== false || typeof body.error?.code !== "string") return undefined;
|
|
167
|
+
const { ok: _ok, error: _error, issues: _issues, ...details } = body as Record<string, unknown>;
|
|
165
168
|
return {
|
|
166
169
|
code: body.error.code,
|
|
167
170
|
message: typeof body.error.message === "string" ? body.error.message : "Request failed",
|
|
168
171
|
...(Array.isArray(body.issues) ? { issues: body.issues as PublicRouteIssue[] } : {}),
|
|
172
|
+
...(Object.keys(details).length > 0 ? { details } : {}),
|
|
169
173
|
};
|
|
170
174
|
}
|
|
171
175
|
|
|
@@ -11,13 +11,35 @@ import {
|
|
|
11
11
|
widgetErrorLocation,
|
|
12
12
|
} from "./widget";
|
|
13
13
|
|
|
14
|
+
/** What the suite's voucher hook answers (T166): a signed `voucher-hold/1` token, or the refusal's code. */
|
|
15
|
+
export type VoucherHoldResult = { ok: true; hold: string } | { ok: false; code: string };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Holds a gift voucher for a booking just reserved (T166, voucher/1 §8.1): the suite's `holdVoucher`, given
|
|
19
|
+
* through `eventsIntegration({ vouchers })`. Events never talks to Vouchers itself.
|
|
20
|
+
*/
|
|
21
|
+
export type VoucherHook = (
|
|
22
|
+
ctx: PublicRouteContext,
|
|
23
|
+
input: { code: string; bookingRef: string; accessToken: string },
|
|
24
|
+
) => Promise<VoucherHoldResult>;
|
|
25
|
+
|
|
14
26
|
export interface CheckoutFormOptions {
|
|
15
27
|
/** The core's plugin id. Defaults to the slug; registry installs pass their `r_…` id. */
|
|
16
28
|
pluginId?: string;
|
|
17
29
|
/** Injected for tests: makes the idempotency key when the form carries none. */
|
|
18
30
|
newKey?: () => string;
|
|
31
|
+
/** The gift voucher hold (T166); without it a typed voucher code is refused (`VOUCHER_UNAVAILABLE`). */
|
|
32
|
+
voucher?: VoucherHook;
|
|
33
|
+
/** The suite's dry run of that hold before reserving (T168); without it the hold alone decides. */
|
|
34
|
+
check?: VoucherCheckHook;
|
|
19
35
|
}
|
|
20
36
|
|
|
37
|
+
/** Checks a typed gift voucher code before anything is reserved (T168): the suite's `checkVoucher`. */
|
|
38
|
+
export type VoucherCheckHook = (
|
|
39
|
+
ctx: PublicRouteContext,
|
|
40
|
+
input: { code: string; eventId: string; ticketTypeIds: string[] },
|
|
41
|
+
) => Promise<{ ok: true } | { ok: false; code: string }>;
|
|
42
|
+
|
|
21
43
|
export interface CheckoutRedirect {
|
|
22
44
|
location: string;
|
|
23
45
|
/** The booking's access token, for an HttpOnly cookie scoped to `/booking`. Never in a URL. */
|
|
@@ -178,6 +200,16 @@ export async function handleCheckoutForm(
|
|
|
178
200
|
});
|
|
179
201
|
if (invalid.length > 0) return refuse("BAD_REQUEST", invalid);
|
|
180
202
|
|
|
203
|
+
// A gift voucher (T166) is held between reserve and continue; without the suite's hook it cannot be.
|
|
204
|
+
const voucherCode = text(form, "voucherCode");
|
|
205
|
+
if (voucherCode && !options.voucher) return refuse("VOUCHER_UNAVAILABLE", ["voucher"]);
|
|
206
|
+
// T168: a code the suite's check refuses never reserves, so no booking is held, cancelled and emailed.
|
|
207
|
+
if (voucherCode && options.check) {
|
|
208
|
+
const ticketTypeIds = lines.map((l) => l.ticketTypeId);
|
|
209
|
+
const checked = await options.check(ctx, { code: voucherCode, eventId, ticketTypeIds });
|
|
210
|
+
if (!checked.ok) return refuse(checked.code, ["voucher"]);
|
|
211
|
+
}
|
|
212
|
+
|
|
181
213
|
const turnstileToken = text(form, "cf-turnstile-response");
|
|
182
214
|
// Only a typed code is sent: Free's reserve refuses unknown keys, and only Pro offers the field.
|
|
183
215
|
const promoCode = text(form, "promoCode");
|
|
@@ -210,11 +242,22 @@ export async function handleCheckoutForm(
|
|
|
210
242
|
// A resubmit of a booking that is already confirmed gets no new token: this browser has its cookie.
|
|
211
243
|
if (!accessToken) return { location: done };
|
|
212
244
|
const cookie = { name: bookingCookieName(bookingRef), value: accessToken };
|
|
245
|
+
let voucherHold: string | undefined;
|
|
246
|
+
if (voucherCode && options.voucher) {
|
|
247
|
+
const held = await options.voucher(ctx, { code: voucherCode, bookingRef, accessToken });
|
|
248
|
+
if (!held.ok) {
|
|
249
|
+
// Nothing paid yet: release the places so the corrected order can have them.
|
|
250
|
+
const body = { bookingRef, accessToken };
|
|
251
|
+
await callPublicRoute(ctx, { method: "POST", path: "public/booking/cancel", pluginId, body });
|
|
252
|
+
return refuse(held.code, ["voucher"]);
|
|
253
|
+
}
|
|
254
|
+
voucherHold = held.hold;
|
|
255
|
+
}
|
|
213
256
|
const next = await callPublicRoute<{ next?: { type?: string; url?: string } }>(ctx, {
|
|
214
257
|
method: "POST",
|
|
215
258
|
path: "public/checkout/continue",
|
|
216
259
|
pluginId,
|
|
217
|
-
body: { bookingRef, accessToken },
|
|
260
|
+
body: { bookingRef, accessToken, ...(voucherHold ? { voucherHold } : {}) },
|
|
218
261
|
});
|
|
219
262
|
if (!next.ok) return fail(next.error.code, bookingRef, cookie);
|
|
220
263
|
|
package/src/astro/lib/page.ts
CHANGED
|
@@ -118,6 +118,7 @@ body.semics-page{margin:0;min-block-size:100vh;background:var(--events-page-bg,
|
|
|
118
118
|
:where(.semics-page) fieldset{min-inline-size:0;margin:0 0 1rem;padding:0;border:0}
|
|
119
119
|
:where(.semics-page) legend{padding:0;margin-block-end:.5rem;font-weight:600}
|
|
120
120
|
:where(.semics-page) button{font:inherit;font-weight:600;min-block-size:2.75rem;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);cursor:pointer}
|
|
121
|
+
:where(.semics-page) a.semics-page-button{display:inline-block;font-weight:600;padding:.625rem 1.25rem;border:1px solid var(--events-accent, #0b57d0);border-radius:var(--events-radius, 6px);background:var(--events-accent, #0b57d0);color:var(--events-accent-fg, #ffffff);text-decoration:none}
|
|
121
122
|
.semics-page-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem;margin-block:0 1.25rem}
|
|
122
123
|
.semics-page-actions .semics-print{background:transparent;color:var(--events-accent, #0b57d0)}
|
|
123
124
|
.semics-page-organiser{max-inline-size:40rem;margin-inline:auto;padding:0 1rem 3rem;color:var(--events-muted, #4a4a4a);font-size:.9375rem}
|
package/src/astro/lib/widget.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface PublicEvent {
|
|
|
42
42
|
waiverAfter?: boolean;
|
|
43
43
|
/** True when the core takes promo codes (Events Pro, T078): the widget then shows a code field. */
|
|
44
44
|
promoCodes?: boolean;
|
|
45
|
+
/** True when Events Pro is paired with Vouchers (T166): the widget then shows a "Gift voucher code" field. */
|
|
46
|
+
vouchers?: boolean;
|
|
45
47
|
/** True when a sold-out event takes a waitlist (T081): the widget then shows a "Join the waitlist" form. */
|
|
46
48
|
waitlist?: boolean;
|
|
47
49
|
/** Custom attendee questions (Events Pro, T080): the buyer answers them once per booking. */
|
|
@@ -53,8 +55,8 @@ export interface PublicEvent {
|
|
|
53
55
|
* lines carry only ids (UUIDs for types made in the editor). A hidden type is not listed there.
|
|
54
56
|
*/
|
|
55
57
|
/** Whether the booking page hands the booking to the suite's reconciliation: lookups, or void intents (T152). */
|
|
56
|
-
export const reconcileWanted = (b: Pick<BookingView, "waiver"> | undefined): boolean =>
|
|
57
|
-
Boolean(b?.waiver?.lookups || b?.waiver?.voids);
|
|
58
|
+
export const reconcileWanted = (b: Pick<BookingView, "waiver" | "voucher"> | undefined): boolean =>
|
|
59
|
+
Boolean(b?.waiver?.lookups || b?.waiver?.voids || b?.voucher?.settle);
|
|
58
60
|
|
|
59
61
|
export function ticketNames(event: Pick<PublicEvent, "ticketTypes"> | undefined): Record<string, string> {
|
|
60
62
|
return Object.fromEntries((event?.ticketTypes ?? []).map((t) => [t.id, t.name]));
|
|
@@ -76,7 +78,10 @@ export interface BookingView {
|
|
|
76
78
|
status: string;
|
|
77
79
|
eventId?: string;
|
|
78
80
|
lines: Array<{ ticketTypeId: string; qty: number }>;
|
|
79
|
-
|
|
81
|
+
/** `voucherMinor`: what a gift voucher paid (Events Pro, T166), already taken off `totalMinor`. */
|
|
82
|
+
totals: { totalMinor: number; currency: string; voucherMinor?: number };
|
|
83
|
+
/** Events Pro (T166): the voucher hold's signed outcome, which the suite passes to Vouchers. */
|
|
84
|
+
voucher?: { settle?: string | null };
|
|
80
85
|
holdExpiresAt?: string;
|
|
81
86
|
/** The event's public info: the booked session (`startsAt`, in `timezone`) and `venue` lead the page (T157); `slug` for "Book again". */
|
|
82
87
|
event?: { title?: string; startsAt?: string; timezone?: string | null; venue?: string | null; slug?: string | null };
|
|
@@ -110,13 +115,13 @@ export interface BookingView {
|
|
|
110
115
|
|
|
111
116
|
/** A custom question's field is `q:<question id>` (T080). */
|
|
112
117
|
export type QuestionField = `q:${string}`;
|
|
113
|
-
export type WidgetField = "occurrence" | "promo" | "tickets" | "name" | "email" | QuestionField;
|
|
118
|
+
export type WidgetField = "occurrence" | "promo" | "voucher" | "tickets" | "name" | "email" | QuestionField;
|
|
114
119
|
|
|
115
120
|
/** Question ids safe in HTML ids, field names and the widget's error URL. */
|
|
116
121
|
export const QUESTION_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
117
122
|
|
|
118
123
|
/** In form order: the first one is where focus goes. */
|
|
119
|
-
export const WIDGET_FIELDS = ["occurrence", "promo", "tickets", "name", "email"] as const;
|
|
124
|
+
export const WIDGET_FIELDS = ["occurrence", "promo", "voucher", "tickets", "name", "email"] as const;
|
|
120
125
|
|
|
121
126
|
export const WIDGET_PARAMS = { error: "booking_error", fields: "booking_fields", event: "booking_event" } as const;
|
|
122
127
|
|
|
@@ -135,6 +140,11 @@ const ERROR_CODES = [
|
|
|
135
140
|
"PROMO_EXHAUSTED",
|
|
136
141
|
"PROMO_ORDER_TOO_LARGE",
|
|
137
142
|
"PROMO_UNAVAILABLE",
|
|
143
|
+
"VOUCHER_INVALID",
|
|
144
|
+
"VOUCHER_NO_BALANCE",
|
|
145
|
+
"VOUCHER_WRONG_ACTIVITY",
|
|
146
|
+
"VOUCHER_CURRENCY",
|
|
147
|
+
"VOUCHER_UNAVAILABLE",
|
|
138
148
|
"INTERNAL",
|
|
139
149
|
] as const;
|
|
140
150
|
|
package/src/astro/virtual.d.ts
CHANGED
|
@@ -12,7 +12,29 @@ declare module "virtual:semics-events/config" {
|
|
|
12
12
|
export const reconcile:
|
|
13
13
|
| ((
|
|
14
14
|
ctx: import("./lib/call").PublicRouteContext,
|
|
15
|
-
input: {
|
|
15
|
+
input: {
|
|
16
|
+
booking: import("./lib/widget").BookingView;
|
|
17
|
+
pluginId: string;
|
|
18
|
+
esignPluginId: string;
|
|
19
|
+
vouchersPluginId?: string;
|
|
20
|
+
},
|
|
16
21
|
) => Promise<{ forwarded: number }>)
|
|
17
22
|
| null;
|
|
23
|
+
/** Gift vouchers (T166): only exported with `eventsIntegration({ vouchers })`; read through a namespace import. */
|
|
24
|
+
export const vouchersPluginId: string | undefined;
|
|
25
|
+
export const holdVoucher:
|
|
26
|
+
| ((
|
|
27
|
+
ctx: import("./lib/call").PublicRouteContext,
|
|
28
|
+
input: { code: string; bookingRef: string; accessToken: string },
|
|
29
|
+
ids: { eventsPluginId: string; vouchersPluginId: string },
|
|
30
|
+
) => Promise<import("./lib/checkout-form").VoucherHoldResult>)
|
|
31
|
+
| undefined;
|
|
32
|
+
/** T168: the suite's check of a code before reserving; exported with `holdVoucher`. */
|
|
33
|
+
export const checkVoucher:
|
|
34
|
+
| ((
|
|
35
|
+
ctx: import("./lib/call").PublicRouteContext,
|
|
36
|
+
input: { code: string; eventId: string; ticketTypeIds: string[] },
|
|
37
|
+
ids: { vouchersPluginId: string },
|
|
38
|
+
) => Promise<{ ok: true } | { ok: false; code: string }>)
|
|
39
|
+
| undefined;
|
|
18
40
|
}
|
package/src/i18n/ar.ts
CHANGED
|
@@ -33,6 +33,7 @@ export const ar: Messages = {
|
|
|
33
33
|
"widget.promo.label": "رمز الخصم",
|
|
34
34
|
"widget.promo.apply": "تطبيق الرمز",
|
|
35
35
|
"widget.promo.update": "تحديث الرمز",
|
|
36
|
+
"widget.voucher.label": "رمز قسيمة الهدية",
|
|
36
37
|
"widget.tickets": "التذاكر",
|
|
37
38
|
"widget.soldOut": "نفدت التذاكر",
|
|
38
39
|
"widget.name": "اسمك",
|
|
@@ -44,6 +45,7 @@ export const ar: Messages = {
|
|
|
44
45
|
"widget.book": "احجز",
|
|
45
46
|
"widget.field.occurrence": "اختر تاريخًا.",
|
|
46
47
|
"widget.field.promo": "تحقق من الرمز، أو اترك الحقل فارغًا.",
|
|
48
|
+
"widget.field.voucher": "تحقق من الرمز، أو اترك الحقل فارغًا.",
|
|
47
49
|
"widget.field.tickets": "اختر تذكرة واحدة على الأقل.",
|
|
48
50
|
"widget.field.name": "أدخل اسمك.",
|
|
49
51
|
"widget.field.email": "أدخل بريدًا إلكترونيًا صحيحًا.",
|
|
@@ -59,6 +61,11 @@ export const ar: Messages = {
|
|
|
59
61
|
"widget.error.PROMO_ORDER_TOO_LARGE":
|
|
60
62
|
"لا يمكن استخدام هذا الرمز لطلب بهذا الحجم. اطلب أنواعًا أقل من التذاكر في المرة الواحدة.",
|
|
61
63
|
"widget.error.PROMO_UNAVAILABLE": "لا يمكن استخدام هذا الرمز الآن. احذفه للحجز من دونه.",
|
|
64
|
+
"widget.error.VOUCHER_INVALID": "رمز قسيمة الهدية هذا غير صالح.",
|
|
65
|
+
"widget.error.VOUCHER_NO_BALANCE": "لم يتبقَّ رصيد في قسيمة الهدية هذه.",
|
|
66
|
+
"widget.error.VOUCHER_WRONG_ACTIVITY": "قسيمة الهدية هذه مخصصة لنشاط آخر.",
|
|
67
|
+
"widget.error.VOUCHER_CURRENCY": "قسيمة الهدية هذه بعملة مختلفة.",
|
|
68
|
+
"widget.error.VOUCHER_UNAVAILABLE": "لا يمكن استخدام قسائم الهدايا الآن. احذف الرمز للحجز بدونه.",
|
|
62
69
|
"widget.error.INTERNAL": "حدث خطأ ما. يُرجى المحاولة مرة أخرى.",
|
|
63
70
|
|
|
64
71
|
"waitlist.heading": "انضم إلى قائمة الانتظار",
|
|
@@ -110,6 +117,7 @@ export const ar: Messages = {
|
|
|
110
117
|
"booking.bookAgain": "احجز مرة أخرى",
|
|
111
118
|
"booking.decideBy": "سيوافق المنظّم على طلبك أو يرفضه بحلول {time}، وسنراسلك بالبريد الإلكتروني.",
|
|
112
119
|
"booking.line": "{qty} × {name}",
|
|
120
|
+
"booking.voucher": "قسيمة هدية",
|
|
113
121
|
"booking.total": "المجموع",
|
|
114
122
|
"booking.cancelUntil": "يمكنك الإلغاء حتى {time}.",
|
|
115
123
|
"booking.cancel": "إلغاء الحجز",
|
package/src/i18n/en.ts
CHANGED
|
@@ -34,6 +34,7 @@ export const en = {
|
|
|
34
34
|
"widget.promo.label": "Promo code",
|
|
35
35
|
"widget.promo.apply": "Apply code",
|
|
36
36
|
"widget.promo.update": "Update code",
|
|
37
|
+
"widget.voucher.label": "Gift voucher code",
|
|
37
38
|
"widget.tickets": "Tickets",
|
|
38
39
|
"widget.soldOut": "Sold out",
|
|
39
40
|
"widget.name": "Your name",
|
|
@@ -45,6 +46,7 @@ export const en = {
|
|
|
45
46
|
"widget.book": "Book",
|
|
46
47
|
"widget.field.occurrence": "Choose a date.",
|
|
47
48
|
"widget.field.promo": "Check the code, or leave it empty.",
|
|
49
|
+
"widget.field.voucher": "Check the code, or leave it empty.",
|
|
48
50
|
"widget.field.tickets": "Choose at least one ticket.",
|
|
49
51
|
"widget.field.name": "Enter your name.",
|
|
50
52
|
"widget.field.email": "Enter a valid email address.",
|
|
@@ -60,6 +62,11 @@ export const en = {
|
|
|
60
62
|
"widget.error.PROMO_ORDER_TOO_LARGE":
|
|
61
63
|
"That code can't be used on an order this large. Order fewer ticket types at once.",
|
|
62
64
|
"widget.error.PROMO_UNAVAILABLE": "That code can't be used right now. Remove it to book without it.",
|
|
65
|
+
"widget.error.VOUCHER_INVALID": "That gift voucher code is not valid.",
|
|
66
|
+
"widget.error.VOUCHER_NO_BALANCE": "That gift voucher has nothing left to spend.",
|
|
67
|
+
"widget.error.VOUCHER_WRONG_ACTIVITY": "That gift voucher is for a different activity.",
|
|
68
|
+
"widget.error.VOUCHER_CURRENCY": "That gift voucher is in a different currency.",
|
|
69
|
+
"widget.error.VOUCHER_UNAVAILABLE": "Gift vouchers can't be used right now. Remove the code to book without it.",
|
|
63
70
|
"widget.error.INTERNAL": "Something went wrong. Please try again.",
|
|
64
71
|
|
|
65
72
|
"waitlist.heading": "Join the waitlist",
|
|
@@ -112,6 +119,7 @@ export const en = {
|
|
|
112
119
|
"booking.signAgain": "If there is a waiver, you will sign it again when you book.",
|
|
113
120
|
"booking.bookAgain": "Book again",
|
|
114
121
|
"booking.line": "{qty} × {name}",
|
|
122
|
+
"booking.voucher": "Gift voucher",
|
|
115
123
|
"booking.total": "Total",
|
|
116
124
|
"booking.cancelUntil": "You can cancel until {time}.",
|
|
117
125
|
"booking.cancel": "Cancel booking",
|