@kiva/kv-shop 1.6.4 → 1.7.1

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.
@@ -24,6 +24,15 @@ import {
24
24
  import { gql } from "@apollo/client/core";
25
25
  import { trackTransaction } from "@kiva/kv-analytics";
26
26
  import numeral from "numeral";
27
+
28
+ // src/util/redirect.ts
29
+ function redirectTo(href) {
30
+ return new Promise(() => {
31
+ window.location.href = href;
32
+ });
33
+ }
34
+
35
+ // src/oneTimeCheckout.ts
27
36
  async function creditAmountNeeded(apollo) {
28
37
  const data = await callShopQuery(apollo, {
29
38
  query: gql`
@@ -168,7 +177,7 @@ async function executeOneTimeCheckout({
168
177
  }
169
178
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
170
179
  await trackSuccess(apollo, checkoutId, paymentType);
171
- window.location.href = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
180
+ await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
172
181
  }
173
182
 
174
183
  export {
package/dist/index.cjs CHANGED
@@ -498,6 +498,13 @@ async function validatePreCheckout({
498
498
  }
499
499
  }
500
500
 
501
+ // src/util/redirect.ts
502
+ function redirectTo(href) {
503
+ return new Promise(() => {
504
+ window.location.href = href;
505
+ });
506
+ }
507
+
501
508
  // src/receipt.ts
502
509
  var import_core7 = require("@apollo/client/core");
503
510
  async function getFTDStatus(apollo) {
@@ -788,7 +795,7 @@ async function executeOneTimeCheckout({
788
795
  }
789
796
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
790
797
  await trackSuccess(apollo, checkoutId, paymentType);
791
- window.location.href = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
798
+ await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
792
799
  }
793
800
 
794
801
  // src/subscriptionCheckout.ts
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-FCAOCO7O.js";
25
25
  import {
26
26
  executeOneTimeCheckout
27
- } from "./chunk-IQRID7QX.js";
27
+ } from "./chunk-L5EXMDDV.js";
28
28
  import {
29
29
  getCheckoutTrackingData,
30
30
  getFTDStatus,
@@ -311,6 +311,13 @@ async function validatePreCheckout({
311
311
  }
312
312
  }
313
313
 
314
+ // src/util/redirect.ts
315
+ function redirectTo(href) {
316
+ return new Promise(() => {
317
+ window.location.href = href;
318
+ });
319
+ }
320
+
314
321
  // src/receipt.ts
315
322
  var import_core4 = require("@apollo/client/core");
316
323
  async function getFTDStatus(apollo) {
@@ -601,7 +608,7 @@ async function executeOneTimeCheckout({
601
608
  }
602
609
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
603
610
  await trackSuccess(apollo, checkoutId, paymentType);
604
- window.location.href = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
611
+ await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
605
612
  }
606
613
  // Annotate the CommonJS export names for ESM import in node:
607
614
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  executeOneTimeCheckout
3
- } from "./chunk-IQRID7QX.js";
3
+ } from "./chunk-L5EXMDDV.js";
4
4
  import "./chunk-2NBRXSIM.js";
5
5
  import "./chunk-JBQ2KNMP.js";
6
6
  import "./chunk-CBJJUUVR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-shop",
3
- "version": "1.6.4",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@apollo/client": "^3.7.14",
41
41
  "@kiva/kv-analytics": "^1.3.0",
42
- "@kiva/kv-components": "^3.48.2",
42
+ "@kiva/kv-components": "^3.48.3",
43
43
  "@types/braintree-web-drop-in": "^1.34.2",
44
44
  "braintree-web-drop-in": "^1.37.0",
45
45
  "numeral": "^2.0.6",
@@ -54,5 +54,5 @@
54
54
  "optional": true
55
55
  }
56
56
  },
57
- "gitHead": "992d943a0e3a39d8bb33162c1e059d295266c933"
57
+ "gitHead": "c2f834e03d69c4df0edfa0abbd9cefc5d193ea48"
58
58
  }