@shoppexio/storefront 1.0.25 → 1.0.26

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.
@@ -28,16 +28,23 @@ export interface CheckoutOptions {
28
28
  *
29
29
  * PAYMENT PATH. A caller that writes the cart and reads it back before
30
30
  * checking out (Buy Now, which replaces the cart, is the sharp case) verifies
31
- * a cart it read at one moment, while this function reads storage again on
32
- * its way into the request — and localStorage is shared with every other tab
33
- * on the domain. A write landing in that gap is billed without ever having
34
- * passed the caller's verification.
31
+ * a cart it read at one moment, while these functions read storage again on
32
+ * their way into the request — and localStorage is shared with every other
33
+ * tab on the domain. A write landing in that gap is billed without ever
34
+ * having passed the caller's verification.
35
35
  *
36
36
  * The caller cannot close that itself: any check it makes is one more read
37
37
  * BEFORE this one. Pinning the expected bytes moves the comparison to the
38
- * only place it can be conclusive — against the exact cart this call is about
38
+ * only place it can be conclusive — against the exact cart the call is about
39
39
  * to POST. A mismatch refuses before anything is created or sent.
40
40
  *
41
+ * Honoured identically by BOTH invoice-creating entry points, `checkout()`
42
+ * and `buildCheckoutUrl()` — they hit the same endpoint and create the same
43
+ * invoice, so a pin that held on one and not the other would be a promise
44
+ * the caller could not rely on. Only the refusal shape differs, following
45
+ * each function's own success shape: `checkout()` returns
46
+ * `{ success: false }`, `buildCheckoutUrl()` throws.
47
+ *
41
48
  * Optional and additive: omitted, nothing changes, and the server is not
42
49
  * involved either way.
43
50
  */
@@ -73,6 +80,18 @@ export declare function checkout(couponOrOptions?: string | CheckoutOptions, opt
73
80
  /**
74
81
  * Build checkout URL by creating invoice first.
75
82
  * Returns the checkout URL for the created invoice.
83
+ *
84
+ * PAYMENT PATH. "Build a URL" names what this returns, not a lighter way to
85
+ * price a cart: it POSTs the same invoice-creating endpoint as `checkout()` and
86
+ * bills whatever storage holds when it reads. It therefore honours
87
+ * `CheckoutOptions.expectedCart` on exactly the same terms — a pinned cart that
88
+ * moved is refused, not invoiced.
89
+ *
90
+ * A refusal throws, like every other refusal on this function: the success
91
+ * shape is a URL string, so there is no in-band value that a caller could
92
+ * mistake for one. The thrown message is the buyer-facing copy, identical to
93
+ * the sentence `checkout()` returns, and callers that already handle the
94
+ * `Cart is empty` throw handle this one unchanged.
76
95
  */
77
96
  export declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<string>;
78
97
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/modules/checkout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA2TD,wBAAsB,QAAQ,CAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,eAAe,EAC1C,OAAO,CAAC,EAAE,eAAe,GACxB,OA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