@kiva/kv-shop 1.7.7 → 1.8.0

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.
@@ -140,7 +140,8 @@ async function executeOneTimeCheckout({
140
140
  apollo,
141
141
  braintree,
142
142
  emailAddress,
143
- emailOptIn
143
+ emailOptIn,
144
+ valetInviter
144
145
  }) {
145
146
  await validatePreCheckout({
146
147
  apollo,
@@ -177,7 +178,11 @@ async function executeOneTimeCheckout({
177
178
  }
178
179
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
179
180
  await trackSuccess(apollo, checkoutId, paymentType);
180
- await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
181
+ let redirectUrl = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
182
+ if (valetInviter) {
183
+ redirectUrl += `&valet_inviter=${valetInviter}`;
184
+ }
185
+ await redirectTo(redirectUrl);
181
186
  }
182
187
 
183
188
  export {
package/dist/index.cjs CHANGED
@@ -758,7 +758,8 @@ async function executeOneTimeCheckout({
758
758
  apollo,
759
759
  braintree,
760
760
  emailAddress,
761
- emailOptIn
761
+ emailOptIn,
762
+ valetInviter
762
763
  }) {
763
764
  await validatePreCheckout({
764
765
  apollo,
@@ -795,7 +796,11 @@ async function executeOneTimeCheckout({
795
796
  }
796
797
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
797
798
  await trackSuccess(apollo, checkoutId, paymentType);
798
- await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
799
+ let redirectUrl = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
800
+ if (valetInviter) {
801
+ redirectUrl += `&valet_inviter=${valetInviter}`;
802
+ }
803
+ await redirectTo(redirectUrl);
799
804
  }
800
805
 
801
806
  // 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-L5EXMDDV.js";
27
+ } from "./chunk-ZBQCRZHQ.js";
28
28
  import {
29
29
  getCheckoutTrackingData,
30
30
  getFTDStatus,
@@ -571,7 +571,8 @@ async function executeOneTimeCheckout({
571
571
  apollo,
572
572
  braintree,
573
573
  emailAddress,
574
- emailOptIn
574
+ emailOptIn,
575
+ valetInviter
575
576
  }) {
576
577
  await validatePreCheckout({
577
578
  apollo,
@@ -608,7 +609,11 @@ async function executeOneTimeCheckout({
608
609
  }
609
610
  const checkoutId = result.data?.checkoutStatus?.receipt?.checkoutId;
610
611
  await trackSuccess(apollo, checkoutId, paymentType);
611
- await redirectTo(`/checkout/post-purchase?kiva_transaction_id=${checkoutId}`);
612
+ let redirectUrl = `/checkout/post-purchase?kiva_transaction_id=${checkoutId}`;
613
+ if (valetInviter) {
614
+ redirectUrl += `&valet_inviter=${valetInviter}`;
615
+ }
616
+ await redirectTo(redirectUrl);
612
617
  }
613
618
  // Annotate the CommonJS export names for ESM import in node:
614
619
  0 && (module.exports = {
@@ -8,7 +8,8 @@ interface OneTimeCheckoutOptions {
8
8
  braintree?: DropInWrapper;
9
9
  emailAddress?: string;
10
10
  emailOptIn?: boolean;
11
+ valetInviter?: string;
11
12
  }
12
- declare function executeOneTimeCheckout({ apollo, braintree, emailAddress, emailOptIn, }: OneTimeCheckoutOptions): Promise<void>;
13
+ declare function executeOneTimeCheckout({ apollo, braintree, emailAddress, emailOptIn, valetInviter, }: OneTimeCheckoutOptions): Promise<void>;
13
14
 
14
15
  export { OneTimeCheckoutOptions, executeOneTimeCheckout };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  executeOneTimeCheckout
3
- } from "./chunk-L5EXMDDV.js";
3
+ } from "./chunk-ZBQCRZHQ.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.7.7",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -54,5 +54,5 @@
54
54
  "optional": true
55
55
  }
56
56
  },
57
- "gitHead": "a1d537c8b354bbba06204c6500440183420eebcb"
57
+ "gitHead": "3cbe53dde5a302b1b8906aced1da39c07980ce14"
58
58
  }