@code-collective/booking-widget 1.0.16 → 1.0.17
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/CHANGELOG.md +86 -75
- package/README.md +508 -506
- package/dist/booking-widget.js +153 -136
- package/dist/booking-widget.min.js +5 -5
- package/dist/booking-widget.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/lib/CheckoutModal.svelte +4 -1
- package/src/lib/CheckoutPanel.svelte +22 -1
- package/src/lib/PaymentPage.svelte +13 -3
- package/src/lib/checkout-payment-flow.svelte.ts +51 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,75 +1,86 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
The version in `package.json` had drifted behind npm (the repo said 1.0.7 while `latest` was 1.0.9), so
|
|
4
|
-
1.0.8 and 1.0.9 shipped without an entry here. This file starts at the point that caused a consumer a real
|
|
5
|
-
detour.
|
|
6
|
-
|
|
7
|
-
## 1.0.16
|
|
8
|
-
|
|
9
|
-
Peach now owns payment retries. A declined card never reaches the widget or the checkout API at all - Peach
|
|
10
|
-
re-prompts inside its own embedded form and the shopper returns only once they have paid or given up - so the
|
|
11
|
-
widget no longer reports declines, no longer asks the server to go and read Peach's status, and no longer
|
|
12
|
-
renders a decline screen of its own.
|
|
13
|
-
|
|
14
|
-
- **Removed** `reportPaymentFailure()` and `resolvePayment()` from `BookingApi`/`ApiClient`. The endpoints
|
|
15
|
-
behind them (`POST /v1/checkout/cart/payment-failure`, `POST /v1/checkout/cart/resolve-payment`) are gone
|
|
16
|
-
from the checkout API. Anything calling them directly must drop the call; there is nothing to replace it
|
|
17
|
-
with, because there is no longer a client-reported outcome for the server to record.
|
|
18
|
-
- **Changed** the cart status response is now `{ cartStatus, confirmResult }`. `paymentOutcome`, `resolvedBy`
|
|
19
|
-
and `resultCode` are gone - the browser reads the cart's own status and nothing else.
|
|
20
|
-
- **Changed** a Peach SDK `error` or `expired` callback now releases the checkout through
|
|
21
|
-
`abandonPayment()`, the same call a cancel already used, so Try Again always mints a brand-new Peach
|
|
22
|
-
checkout rather than reopening one Peach has finished with.
|
|
23
|
-
- **Fixed** a cart the server's stuck-payment sweep expired is terminal in the widget. It used to keep
|
|
24
|
-
polling a cart that could never change until the poll's own 90s window ran out, and a reload landed the
|
|
25
|
-
shopper back on a card form for a cart that no longer existed.
|
|
26
|
-
- **
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- **
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The version in `package.json` had drifted behind npm (the repo said 1.0.7 while `latest` was 1.0.9), so
|
|
4
|
+
1.0.8 and 1.0.9 shipped without an entry here. This file starts at the point that caused a consumer a real
|
|
5
|
+
detour.
|
|
6
|
+
|
|
7
|
+
## 1.0.16
|
|
8
|
+
|
|
9
|
+
Peach now owns payment retries. A declined card never reaches the widget or the checkout API at all - Peach
|
|
10
|
+
re-prompts inside its own embedded form and the shopper returns only once they have paid or given up - so the
|
|
11
|
+
widget no longer reports declines, no longer asks the server to go and read Peach's status, and no longer
|
|
12
|
+
renders a decline screen of its own.
|
|
13
|
+
|
|
14
|
+
- **Removed** `reportPaymentFailure()` and `resolvePayment()` from `BookingApi`/`ApiClient`. The endpoints
|
|
15
|
+
behind them (`POST /v1/checkout/cart/payment-failure`, `POST /v1/checkout/cart/resolve-payment`) are gone
|
|
16
|
+
from the checkout API. Anything calling them directly must drop the call; there is nothing to replace it
|
|
17
|
+
with, because there is no longer a client-reported outcome for the server to record.
|
|
18
|
+
- **Changed** the cart status response is now `{ cartStatus, confirmResult }`. `paymentOutcome`, `resolvedBy`
|
|
19
|
+
and `resultCode` are gone - the browser reads the cart's own status and nothing else.
|
|
20
|
+
- **Changed** a Peach SDK `error` or `expired` callback now releases the checkout through
|
|
21
|
+
`abandonPayment()`, the same call a cancel already used, so Try Again always mints a brand-new Peach
|
|
22
|
+
checkout rather than reopening one Peach has finished with.
|
|
23
|
+
- **Fixed** a cart the server's stuck-payment sweep expired is terminal in the widget. It used to keep
|
|
24
|
+
polling a cart that could never change until the poll's own 90s window ran out, and a reload landed the
|
|
25
|
+
shopper back on a card form for a cart that no longer existed.
|
|
26
|
+
- **Fixed** a card Peach ultimately declined used to leave the shopper on the verifying spinner for its full
|
|
27
|
+
90 seconds and then on the pending screen, never offered Try Again, for a cart that could never change.
|
|
28
|
+
Peach fires its completed callback for a rejected transaction as well as a charged one; the widget now reads
|
|
29
|
+
the result code it carries and resolves straight to Payment Failed with Try Again. It deliberately does not
|
|
30
|
+
ask the server: Peach's checkout-level status answers "transaction pending" for a rejected transaction, so
|
|
31
|
+
it is only good for confirming a success. A code the widget cannot read is still treated as a possible
|
|
32
|
+
charge and polled, since showing "Payment Failed" over a charged card is the worse error.
|
|
33
|
+
- **Changed** Pay Now is accepted on a cart still awaiting confirmation, minting a new checkout over the dead
|
|
34
|
+
one. Nothing about the cart changes - that is what makes Try Again work after a decline. The new checkout
|
|
35
|
+
reuses the cart's merchant order ID, so Peach's dashboard still shows one order per basket however many
|
|
36
|
+
times the shopper retried; editing the basket is what mints a new order ID.
|
|
37
|
+
- **Unchanged** every export, custom-element attribute, `bwOptions` key and `bw:*` event name.
|
|
38
|
+
|
|
39
|
+
## 1.0.13, 1.0.14, 1.0.15
|
|
40
|
+
|
|
41
|
+
Published without entries here. 1.0.13 and 1.0.14 carried a CSS regression - the checkout modal's own styles
|
|
42
|
+
(cart card, pay bar, buttons) were silently missing from the built widget after a CSS split - and **1.0.15
|
|
43
|
+
fixes it**. Anyone pinned to 1.0.13 or 1.0.14 should upgrade.
|
|
44
|
+
|
|
45
|
+
## 1.0.12
|
|
46
|
+
|
|
47
|
+
Published from the branch that carries this work, which 1.0.10 was not. 1.0.11 was prepared but never
|
|
48
|
+
published - the release script bumps patch before publishing, so the version that went out is one ahead of
|
|
49
|
+
the one the branch was prepared as. The contents are identical either way.
|
|
50
|
+
|
|
51
|
+
## 1.0.10
|
|
52
|
+
|
|
53
|
+
Published from a checkout that did not contain this work - `npm run release` was run from the main repo
|
|
54
|
+
while the branch lived in a worktree - so it carries none of the entries below. `createBookingHost`,
|
|
55
|
+
`BookingProvider`, `CartExpiryGuard`, `portal` and `setPeachSdk` are all absent from its `src/lib/index.ts`,
|
|
56
|
+
which is the entry the `svelte` export condition points at and therefore the one a Svelte consumer compiles.
|
|
57
|
+
Nothing to roll back; it is 1.0.9's code under a new number. **Publish from a checkout that has the branch,
|
|
58
|
+
and check the entry exports before shipping** - `npm pack` the tarball and grep `package/src/lib/index.ts`.
|
|
59
|
+
|
|
60
|
+
See `.changeset/` for the individual entries. In summary:
|
|
61
|
+
|
|
62
|
+
- **Added** `createBookingHost()`, the shared host layer both builds now wire through, and
|
|
63
|
+
`BookingProvider` so components need no `api`/`cartManager` props.
|
|
64
|
+
- **Added** `mode="modal"` on `Checkout`, portalled to `document.body`.
|
|
65
|
+
- **Added** exports: `CartExpiryGuard`, `onWidgetMessage`, `postMessage`, the `WidgetMessage` union,
|
|
66
|
+
`portal`, `setBookingDefaults`.
|
|
67
|
+
- **Changed** add-to-cart now opens checkout on every build by default (`autoOpenCheckout`).
|
|
68
|
+
- **Changed** each `bw:*` event reaches `window` once per thing that happened. They were arriving twice,
|
|
69
|
+
and `bw:close` four times per dismissal. Anything counting `bw:order-confirmed` was double-counting.
|
|
70
|
+
- **Changed** each `bw-*` element dispatches its own events rather than all firing on the first element of
|
|
71
|
+
that tag.
|
|
72
|
+
- **Fixed** building a host no longer throws `window is not defined` during a server render.
|
|
73
|
+
- **Unchanged** `ApiClient`, `SessionManager` and `CartManager` are still exported; the custom-element
|
|
74
|
+
attributes, `bwOptions` and the `bw:*` event names are all as they were.
|
|
75
|
+
|
|
76
|
+
## 1.0.9
|
|
77
|
+
|
|
78
|
+
- **Removed** `FakeApiClient` and the `useFakeApi` mount option, along with `src/lib/fake-api.ts`. This was
|
|
79
|
+
a breaking change shipped in a patch release with no note: a consumer importing `FakeApiClient` gets a
|
|
80
|
+
build error, because a missing named export is a hard failure in a bundler, not a runtime `undefined`.
|
|
81
|
+
It had been the offline development path for consumers with no checkout API configured.
|
|
82
|
+
|
|
83
|
+
**Decision: removed for good.** It is not coming back, and no later version reinstates it. A consumer
|
|
84
|
+
that wants to run without a checkout API should render its own fallback rather than a fake catalogue.
|
|
85
|
+
Where a stand-in client is genuinely needed - a test double, a demo page - pass one to
|
|
86
|
+
`createBookingHost({ api })`, which takes any `BookingApi` implementation.
|