@shoppexio/storefront 1.0.25 → 1.0.27
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/modules/cart.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EAEX,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAkJlB,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,mBAAmB,IAAI,cAAc,GAAG,IAAI,CAE3D;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,MAAM,GAAE,cAAyB,GAChC,MAAM,GAAG,IAAI,CASf;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAkCD,wBAAgB,OAAO,IAAI,QAAQ,EAAE,CAGpC;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,QAAQ,EAAc,GAC3B,MAAM,CAQR;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAED,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAU,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,IAAI,CAmEN;AA4DD,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAU,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,IAAI,CAkDN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE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B,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAQ3D;AA+CD,8EAA8E;AAC9E,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,IAAI,CAEnD;AAED,iDAAiD;AACjD,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAED,wBAAsB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,gDAqCjE;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAWrD"}
|
|
@@ -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
|
|
32
|
-
*
|
|
33
|
-
* on the domain. A write landing in that gap is billed without ever
|
|
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
|
|
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,sEA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