@designcrowd/library.brand-page 5.16.14-stripe-1 → 5.16.15

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.
Files changed (66) hide show
  1. package/lib/src/{CreatedOnBrandCrowd-de-de-BBJMpNEy.js → CreatedOnBrandCrowd-de-de-BleBfKpn.js} +1 -1
  2. package/lib/src/{CreatedOnBrandCrowd-en-us-fqV3lr6P.js → CreatedOnBrandCrowd-en-us-CQVeaaO_.js} +1 -1
  3. package/lib/src/{CreatedOnBrandCrowd-es-es-DRvty-zh.js → CreatedOnBrandCrowd-es-es-BDQv3Rna.js} +1 -1
  4. package/lib/src/{CreatedOnBrandCrowd-fr-fr-Cf3P5_ts.js → CreatedOnBrandCrowd-fr-ca-Cun9kWNn.js} +1 -1
  5. package/lib/src/{CreatedOnBrandCrowd-fr-ca-Cf3P5_ts.js → CreatedOnBrandCrowd-fr-fr-Cun9kWNn.js} +1 -1
  6. package/lib/src/{CreatedOnBrandCrowd-pt-pt-CJWFnxCL.js → CreatedOnBrandCrowd-pt-br-BYKPykPZ.js} +1 -1
  7. package/lib/src/{CreatedOnBrandCrowd-pt-br-CJWFnxCL.js → CreatedOnBrandCrowd-pt-pt-BYKPykPZ.js} +1 -1
  8. package/lib/src/{CreatedOnDcom-de-de-C5XI0Qwc.js → CreatedOnDcom-de-de-OpJW2Nsf.js} +1 -1
  9. package/lib/src/{CreatedOnDcom-en-us-EbzZsGhT.js → CreatedOnDcom-en-us-Dc-r7UZE.js} +1 -1
  10. package/lib/src/{CreatedOnDcom-es-es-BfzZaAs2.js → CreatedOnDcom-es-es-DzI3GAb8.js} +1 -1
  11. package/lib/src/{CreatedOnDcom-fr-ca-CJHorNXI.js → CreatedOnDcom-fr-ca-CjHDpTvo.js} +1 -1
  12. package/lib/src/{CreatedOnDcom-fr-fr-BhHMV4U9.js → CreatedOnDcom-fr-fr-Mz-PmO5h.js} +1 -1
  13. package/lib/src/{CreatedOnDcom-pt-br-Kvbp1M5V.js → CreatedOnDcom-pt-br-Dv9FCjbb.js} +1 -1
  14. package/lib/src/{CreatedOnDcom-pt-pt-DUqPbQGh.js → CreatedOnDcom-pt-pt-BJKrhwA7.js} +1 -1
  15. package/lib/src/brand-page/clients/brand-page.client.d.ts +3 -13
  16. package/lib/src/brand-page/clients/brand-page.client.js +27 -26
  17. package/lib/src/brand-page/components/payment/Payment.mixin.d.ts +1 -2
  18. package/lib/src/brand-page/components/payment/Payment.mixin.js +1 -10
  19. package/lib/src/brand-page/components/payment/RequestPaymentStripe.mixin.d.ts +1 -9
  20. package/lib/src/brand-page/components/payment/RequestPaymentStripe.mixin.js +4 -20
  21. package/lib/src/brand-page/models/payment.model.d.ts +1 -8
  22. package/lib/src/brand-page-maker/components/action-bar/ActionBar.mixin.d.ts +1 -1
  23. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.d.ts +2 -1
  24. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.js +1 -0
  25. package/lib/src/brand-page-maker/components/brand-page-maker/BrandPageMakerTemplateSettings.mixin.d.ts +1 -1
  26. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.js +1 -0
  27. package/lib/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-payment.js +1 -1
  28. package/lib/src/brand-page-maker/components/brandpage-maker-page/BrandPageMakerPage.mixin.d.ts +1 -1
  29. package/lib/src/brand-page-maker/components/brandpage-settings/ReplaceImageSettingsForBrandPageSettings.mixin.d.ts +1 -1
  30. package/lib/src/brand-page-maker/components/seo-settings/SeoPageSettings.mixin.d.ts +1 -1
  31. package/lib/src/brand-page-maker/components/seo-settings/UrlSettings.mixin.d.ts +1 -1
  32. package/lib/src/brand-page-maker/components/social-share/SocialShare.mixin.d.ts +1 -1
  33. package/lib/src/brand-page-maker/components/template-preview/TemplatePreview.mixin.d.ts +1 -1
  34. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.d.ts +3 -1
  35. package/lib/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.js +3 -1
  36. package/lib/src/clients/design-template-client.d.ts +1 -1
  37. package/lib/src/clients/design-template-client.js +4 -2
  38. package/lib/src/composables/useSnapshot.js +1 -1
  39. package/lib/src/css/library.brand-page-brandCrowd.min.css +20 -20
  40. package/lib/src/css/library.brand-page-brandPage.min.css +20 -20
  41. package/lib/src/css/library.brand-page-designCom.min.css +20 -20
  42. package/lib/src/css/library.brand-page-preview.min.css +20 -20
  43. package/lib/src/index.mjs +1 -1
  44. package/lib/src/{lib-sWI0YOvN.js → lib-2QkUgrBA.js} +12295 -12317
  45. package/lib/src/shared/content-settings/components/content-settings/ContentSettings.mixin.d.ts +1 -1
  46. package/lib/src/shared/content-settings/components/content-settings/ReplaceImageSettingsForContent.mixin.d.ts +1 -1
  47. package/lib/src/shared/content-settings/components/content-settings-item/ContentSettingsItemField.mixin.d.ts +1 -1
  48. package/lib/src/shared/logo-settings/components/LogoSettings.mixin.d.ts +1 -1
  49. package/lib/src/shared/page-settings/components/page-settings/PageSettings.mixin.d.ts +1 -1
  50. package/lib/src/shared/page-settings/components/page-settings-section-styles/PageSettingsSectionStyles.mixin.d.ts +1 -1
  51. package/lib/src/shared/publish-brand-page-with-state/PublishBrandPageModalWithState.mixin.d.ts +1 -1
  52. package/lib/src/shared/style-settings/components/StyleSettings.mixin.d.ts +1 -1
  53. package/package.json +1 -1
  54. package/src/brand-page/clients/brand-page.client.ts +51 -52
  55. package/src/brand-page/components/payment/Payment.mixin.ts +6 -13
  56. package/src/brand-page/components/payment/Payment.vue +0 -1
  57. package/src/brand-page/components/payment/RequestPaymentStripe.mixin.ts +6 -27
  58. package/src/brand-page/components/shop/PaymentModal.vue +2 -3
  59. package/src/brand-page/models/payment.model.ts +1 -10
  60. package/src/brand-page-maker/components/brand-page-maker/BrandPageMaker.mixin.ts +2 -0
  61. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-examples.ts +1 -0
  62. package/src/brand-page-maker/components/brand-page-maker/__fixtures__/brand-page-payment.ts +1 -1
  63. package/src/brand-page-maker/stores/brandpage-maker/brandpage-maker-store.ts +5 -0
  64. package/src/clients/design-template-client.ts +5 -1
  65. package/src/composables/useSnapshot.ts +1 -1
  66. package/src/shared/content-settings/components/generate-ai-modal/GenerateAiModal.vue +8 -11
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "275",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "251",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "250",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "237",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as e, openBlock as l, createStaticVNode as a } from "vue";
2
- import { _ as t } from "./lib-sWI0YOvN.js";
2
+ import { _ as t } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, h = {
4
4
  width: "263",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-sWI0YOvN.js";
2
+ import { _ as e } from "./lib-2QkUgrBA.js";
3
3
  const M = {}, Z = {
4
4
  width: "242",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-sWI0YOvN.js";
2
+ import { _ as e } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, M = {
4
4
  width: "231",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-sWI0YOvN.js";
2
+ import { _ as e } from "./lib-2QkUgrBA.js";
3
3
  const M = {}, Z = {
4
4
  width: "230",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-sWI0YOvN.js";
2
+ import { _ as e } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as e } from "./lib-sWI0YOvN.js";
2
+ import { _ as e } from "./lib-2QkUgrBA.js";
3
3
  const i = {}, l = {
4
4
  width: "216",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-sWI0YOvN.js";
2
+ import { _ as M } from "./lib-2QkUgrBA.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,5 +1,5 @@
1
1
  import { createElementBlock as H, openBlock as V, createStaticVNode as t } from "vue";
2
- import { _ as M } from "./lib-sWI0YOvN.js";
2
+ import { _ as M } from "./lib-2QkUgrBA.js";
3
3
  const Z = {}, e = {
4
4
  width: "232",
5
5
  height: "36",
@@ -1,4 +1,4 @@
1
- import type { CreateCartResult, CreateStripePaymentIntentResponse } from '../models';
1
+ import type { CreateCartResult } from '../models';
2
2
  export interface FormResult {
3
3
  success: boolean;
4
4
  errMessage?: string;
@@ -18,19 +18,9 @@ export interface CartForShopRequest {
18
18
  declare const _default: {
19
19
  addMailSubscriber: (brandPageToken: string, email: string, name?: string | undefined) => Promise<FormResult>;
20
20
  submitContactForm: (brandPageToken: string, contentBlockId: string, values: ContactFormField[]) => Promise<FormResult>;
21
+ createBrandPageCart: (paymentOptionIds: string[], customerRequestDetails?: string | undefined, customerMessage?: string | undefined, customAmount?: number | undefined) => Promise<CreateCartResult<unknown> | null>;
22
+ createBrandPageCartForShop: (productDetails: CartForShopRequest[], paymentConfigId: string, customerRequestDetails?: string | undefined, customerMessage?: string | undefined, customAmount?: number | undefined) => Promise<CreateCartResult<unknown> | null>;
21
23
  getPaymentConfigStatusByPaymentConfigId: (paymentConfigId: string) => Promise<string>;
22
24
  getStoreProductsByBrandPageToken: (brandPageToken: string) => Promise<string>;
23
- createBrandPageCart: (request: {
24
- productIds?: string[] | undefined;
25
- productDetails?: CartForShopRequest[] | undefined;
26
- paymentConfigId?: string | undefined;
27
- customAmount?: number | undefined;
28
- }) => Promise<CreateCartResult<unknown> | null>;
29
- createStripePaymentIntent: (request: {
30
- cartId: string[];
31
- customerEmail: string;
32
- customerRequestDetails?: string | undefined;
33
- customerMessage?: string | undefined;
34
- }) => Promise<CreateStripePaymentIntentResponse | null>;
35
25
  };
36
26
  export default _default;
@@ -52,67 +52,68 @@ const submitContactForm = async (brandPageToken, contentBlockId, values) => {
52
52
  };
53
53
  }
54
54
  };
55
- const getPaymentConfigStatusByPaymentConfigId = async (paymentConfigId) => {
55
+ const createBrandPageCart = async (paymentOptionIds, customerRequestDetails, customerMessage, customAmount) => {
56
56
  const csrfToken = csrfUtil.getCsrfTokenFromMetaHeader();
57
- const response = await axios.get(`/api/payment-configs/${paymentConfigId}/status`, {
57
+ const response = await axios.post(`/api/carts`, {
58
+ productIds: paymentOptionIds,
59
+ customerRequestDetails,
60
+ customerMessage,
61
+ customAmount,
62
+ }, {
58
63
  headers: {
59
64
  'Content-Type': 'application/json',
60
65
  [constants.HEADER_CSRF_TOKEN]: csrfToken,
61
66
  },
62
67
  });
68
+ if (response.status !== 200) {
69
+ return null;
70
+ }
63
71
  return response.data;
64
72
  };
65
- const getStoreProductsByBrandPageToken = async (brandPageToken) => {
73
+ const createBrandPageCartForShop = async (productDetails, paymentConfigId, customerRequestDetails, customerMessage, customAmount) => {
66
74
  const csrfToken = csrfUtil.getCsrfTokenFromMetaHeader();
67
- const response = await axios.get(`/api/brand-pages/${brandPageToken}/shopProducts`, {
75
+ const response = await axios.post(`/api/cart/shopProducts`, {
76
+ productDetails: productDetails,
77
+ paymentConfigId,
78
+ customerRequestDetails,
79
+ customerMessage,
80
+ customAmount,
81
+ }, {
68
82
  headers: {
69
83
  'Content-Type': 'application/json',
70
84
  [constants.HEADER_CSRF_TOKEN]: csrfToken,
71
85
  },
72
86
  });
87
+ if (response.status !== 200) {
88
+ return null;
89
+ }
73
90
  return response.data;
74
91
  };
75
- const createBrandPageCart = async (request) => {
92
+ const getPaymentConfigStatusByPaymentConfigId = async (paymentConfigId) => {
76
93
  const csrfToken = csrfUtil.getCsrfTokenFromMetaHeader();
77
- const response = await axios.post(`/api/cart/createCart`, {
78
- productIds: request.productIds,
79
- productDetails: request.productDetails,
80
- paymentConfigId: request.paymentConfigId,
81
- customAmount: request.customAmount,
82
- }, {
94
+ const response = await axios.get(`/api/payment-configs/${paymentConfigId}/status`, {
83
95
  headers: {
84
96
  'Content-Type': 'application/json',
85
97
  [constants.HEADER_CSRF_TOKEN]: csrfToken,
86
98
  },
87
99
  });
88
- if (response.status !== 200) {
89
- return null;
90
- }
91
100
  return response.data;
92
101
  };
93
- const createStripePaymentIntent = async (request) => {
102
+ const getStoreProductsByBrandPageToken = async (brandPageToken) => {
94
103
  const csrfToken = csrfUtil.getCsrfTokenFromMetaHeader();
95
- const response = await axios.post(`/api/stripe/createPaymentIntent`, {
96
- cartId: request.cartId,
97
- customerEmail: request.customerEmail,
98
- customerRequestDetails: request.customerRequestDetails,
99
- customerMessage: request.customerMessage,
100
- }, {
104
+ const response = await axios.get(`/api/brand-pages/${brandPageToken}/shopProducts`, {
101
105
  headers: {
102
106
  'Content-Type': 'application/json',
103
107
  [constants.HEADER_CSRF_TOKEN]: csrfToken,
104
108
  },
105
109
  });
106
- if (response.status !== 200) {
107
- return null;
108
- }
109
110
  return response.data;
110
111
  };
111
112
  export default {
112
113
  addMailSubscriber,
113
114
  submitContactForm,
115
+ createBrandPageCart,
116
+ createBrandPageCartForShop,
114
117
  getPaymentConfigStatusByPaymentConfigId,
115
118
  getStoreProductsByBrandPageToken,
116
- createBrandPageCart,
117
- createStripePaymentIntent,
118
119
  };
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { BrandPageContext, CheckoutInformation, CreateCartResult, PaymentConfig, PaymentOption } from '../../models';
2
+ import type { BrandPageContext, CreateCartResult, PaymentConfig, PaymentOption } from '../../models';
3
3
  import type { RequestPaymentViewModel, SupportMeViewModel } from '../../view-models';
4
4
  export declare const paymentState: {
5
5
  readonly CreatingCart: "creating-cart";
@@ -62,7 +62,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
62
62
  showCollapseToggle(): boolean;
63
63
  successMessage(): string;
64
64
  productName(): string | undefined;
65
- checkoutInformation(): CheckoutInformation;
66
65
  }, {
67
66
  checkRequestPaymentConfig(): Promise<void>;
68
67
  createCart(): Promise<void>;
@@ -115,12 +115,6 @@ export default defineComponent({
115
115
  PAYMENT_OPTIONS_LENGTH: this.selectedPaymentOptions.length,
116
116
  });
117
117
  },
118
- checkoutInformation() {
119
- return {
120
- customerMessage: this.paymentRequestDetails.customerMessage,
121
- customerRequestDetails: this.paymentRequestDetails.customerRequestDetails,
122
- };
123
- },
124
118
  },
125
119
  watch: {
126
120
  async viewModel() {
@@ -163,10 +157,7 @@ export default defineComponent({
163
157
  }
164
158
  try {
165
159
  this.state = paymentState.CreatingCart;
166
- const cartResult = await brandPageClient.createBrandPageCart({
167
- productIds: this.selectedPaymentOptions.map((o) => o.id),
168
- customAmount: this.paymentRequestDetails.customAmount,
169
- });
160
+ const cartResult = await brandPageClient.createBrandPageCart(this.selectedPaymentOptions.map((o) => o.id), this.paymentRequestDetails.customerRequestDetails, this.paymentRequestDetails.customerMessage, this.paymentRequestDetails.customAmount);
170
161
  if (!cartResult) {
171
162
  console.error('Unable to create cart result');
172
163
  this.state = paymentState.PaymentOptionSelection;
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { BrandPagePaymentConfig, ButtonStyles, CheckoutInformation, CreateCartResult, StripePaymentIntent } from '../../models';
2
+ import type { BrandPagePaymentConfig, ButtonStyles, CreateCartResult, StripePaymentIntent } from '../../models';
3
3
  declare global {
4
4
  interface Window {
5
5
  Stripe?: stripe.StripeStatic;
@@ -28,10 +28,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
28
28
  type: PropType<CreateCartResult<StripePaymentIntent>>;
29
29
  required: true;
30
30
  };
31
- checkoutInformation: {
32
- type: PropType<CheckoutInformation>;
33
- required: true;
34
- };
35
31
  buttonStyles: {
36
32
  type: PropType<ButtonStyles>;
37
33
  required: true;
@@ -75,10 +71,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
75
71
  type: PropType<CreateCartResult<StripePaymentIntent>>;
76
72
  required: true;
77
73
  };
78
- checkoutInformation: {
79
- type: PropType<CheckoutInformation>;
80
- required: true;
81
- };
82
74
  buttonStyles: {
83
75
  type: PropType<ButtonStyles>;
84
76
  required: true;
@@ -3,7 +3,6 @@ import validator from 'validator';
3
3
  import { debug, debugError } from '../../../utils/debug.util';
4
4
  import * as constants from '../../constants';
5
5
  import { requestPaymentStripeTr } from '../../../composables/useTranslate';
6
- import brandPageClient from '../../clients/brand-page.client';
7
6
  const INVALID_EMAIL_MESSAGE = () => requestPaymentStripeTr('invalidEmailMessage');
8
7
  const STRIPE_SCRIPT_URL = 'https://js.stripe.com/v3/';
9
8
  const SCRIPT_TAG_NAME = 'SCRIPT';
@@ -16,10 +15,6 @@ export default defineComponent({
16
15
  type: Object,
17
16
  required: true,
18
17
  },
19
- checkoutInformation: {
20
- type: Object,
21
- required: true,
22
- },
23
18
  buttonStyles: {
24
19
  type: Object,
25
20
  required: true,
@@ -64,7 +59,7 @@ export default defineComponent({
64
59
  },
65
60
  computed: {
66
61
  amount() {
67
- return centsToDollars(this.cart.totalAmount).toFixed(2) || '';
62
+ return (centsToDollars(this.cart.paymentProviderDetails.amount).toFixed(2) || '');
68
63
  },
69
64
  currencyCode() {
70
65
  return this.paymentConfig?.defaultCurrency || '';
@@ -202,28 +197,17 @@ export default defineComponent({
202
197
  if (!this.cardNumberElement ||
203
198
  !this.isSubmitButtonEnabled ||
204
199
  !this.stripe ||
205
- !this.stripePublishableKey ||
206
- !this.emailAddress) {
200
+ !this.stripePublishableKey) {
207
201
  debugError('onSubmitPaymentClick: invalid operation');
208
202
  return;
209
203
  }
210
204
  this.isBusy = true;
211
205
  try {
212
- const paymentIntentResponse = await brandPageClient.createStripePaymentIntent({
213
- cartId: this.cart.cartId,
214
- customerEmail: this.emailAddress,
215
- customerRequestDetails: this.checkoutInformation.customerRequestDetails,
216
- customerMessage: this.checkoutInformation.customerMessage,
217
- });
218
- if (!paymentIntentResponse) {
219
- this.submitError =
220
- 'Unable to create payment intent. Please try again.';
221
- return;
222
- }
223
- const confirmCardPaymentResult = await this.stripe.confirmCardPayment(paymentIntentResponse.paymentIntent.client_secret, {
206
+ const confirmCardPaymentResult = await this.stripe.confirmCardPayment(this.cart.paymentProviderDetails.client_secret, {
224
207
  payment_method: {
225
208
  card: this.cardNumberElement,
226
209
  },
210
+ receipt_email: this.emailAddress,
227
211
  });
228
212
  if (confirmCardPaymentResult.error) {
229
213
  debugError(confirmCardPaymentResult.error);
@@ -11,9 +11,9 @@ export interface StripePaymentIntent {
11
11
  export declare const isStripePaymentIntent: (value: any) => value is StripePaymentIntent;
12
12
  export interface CreateCartResult<T> {
13
13
  cartId: string;
14
+ paymentProviderDetails: T;
14
15
  paymentProviderName: string;
15
16
  paymentProviderExternalId: string;
16
- totalAmount: number;
17
17
  }
18
18
  export interface Currency {
19
19
  id: string;
@@ -133,11 +133,4 @@ export interface SupportMeContent extends Content {
133
133
  buttonTextStyle: TextStyleDeclaration;
134
134
  itemTextStyle: TextStyleDeclaration;
135
135
  }
136
- export interface CreateStripePaymentIntentResponse {
137
- paymentIntent: StripePaymentIntent;
138
- }
139
- export interface CheckoutInformation {
140
- customerMessage?: string;
141
- customerRequestDetails?: string;
142
- }
143
136
  export {};
@@ -115,7 +115,7 @@ declare const _default: import("vue").DefineComponent<{}, {
115
115
  setBrandPageType({ brandPageType }: {
116
116
  brandPageType: "default" | "brandSite" | "brandContact";
117
117
  }): void;
118
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
118
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
119
119
  initialisePages({ pages, sections, }: {
120
120
  pages: import("../../../brand-page").PageModel[];
121
121
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -22,6 +22,7 @@ export interface BrandPageMakerViewModel {
22
22
  isPersonalisationEnabled?: boolean;
23
23
  brandPageType?: BrandPageType;
24
24
  businessName?: string;
25
+ industry?: string;
25
26
  }
26
27
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
27
28
  viewModel: {
@@ -157,7 +158,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
157
158
  setBrandPageType({ brandPageType }: {
158
159
  brandPageType: "default" | "brandSite" | "brandContact";
159
160
  }): void;
160
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
161
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
161
162
  initialisePages({ pages, sections, }: {
162
163
  pages: import("../../../brand-page").PageModel[];
163
164
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -149,6 +149,7 @@ export default defineComponent({
149
149
  isPersonalisationEnabled: this.viewModel.isPersonalisationEnabled || false,
150
150
  brandPageType: this.viewModel.brandPageType,
151
151
  businessName: this.viewModel.businessName,
152
+ industry: this.viewModel.industry,
152
153
  logoVariationImageUrls: this.viewModel.logoVariationImageUrls,
153
154
  shopConfigData,
154
155
  });
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{}, {
102
102
  setBrandPageType({ brandPageType }: {
103
103
  brandPageType: "default" | "brandSite" | "brandContact";
104
104
  }): void;
105
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
105
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
106
106
  initialisePages({ pages, sections, }: {
107
107
  pages: import("../../../lib").PageModel[];
108
108
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -2039,6 +2039,7 @@ export const INITIALISE_PAYLOAD = Object.freeze({
2039
2039
  personalisationData: undefined,
2040
2040
  isPersonalisationEnabled: false,
2041
2041
  businessName: '',
2042
+ industry: '',
2042
2043
  logoImage: { ...EMPTY_LOGO_IMAGE_MODEL },
2043
2044
  shopConfigData: '',
2044
2045
  });
@@ -51,9 +51,9 @@ const stripePaymentIntent = {
51
51
  };
52
52
  export const brandPageCreateCartResult = {
53
53
  cartId: faker.datatype.uuid(),
54
+ paymentProviderDetails: stripePaymentIntent,
54
55
  paymentProviderExternalId: faker.datatype.uuid(),
55
56
  paymentProviderName: 'Stripe',
56
- totalAmount: 0,
57
57
  };
58
58
  export const requestPaymentPaymentOptions = [
59
59
  {
@@ -609,7 +609,7 @@ declare const _default: import("vue").DefineComponent<{}, {
609
609
  setBrandPageType({ brandPageType }: {
610
610
  brandPageType: "default" | "brandSite" | "brandContact";
611
611
  }): void;
612
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
612
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
613
613
  initialisePages({ pages, sections, }: {
614
614
  pages: import("../../../brand-page").PageModel[];
615
615
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -109,7 +109,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
109
109
  setBrandPageType({ brandPageType }: {
110
110
  brandPageType: "default" | "brandSite" | "brandContact";
111
111
  }): void;
112
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
112
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
113
113
  initialisePages({ pages, sections, }: {
114
114
  pages: import("../../../brand-page").PageModel[];
115
115
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -346,7 +346,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
346
346
  setBrandPageType({ brandPageType }: {
347
347
  brandPageType: "default" | "brandSite" | "brandContact";
348
348
  }): void;
349
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
349
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
350
350
  initialisePages({ pages, sections, }: {
351
351
  pages: import("../../../brand-page").PageModel[];
352
352
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -345,7 +345,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
345
345
  setBrandPageType({ brandPageType }: {
346
346
  brandPageType: "default" | "brandSite" | "brandContact";
347
347
  }): void;
348
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
348
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
349
349
  initialisePages({ pages, sections, }: {
350
350
  pages: import("../../../brand-page").PageModel[];
351
351
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -119,7 +119,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
119
119
  setBrandPageType({ brandPageType }: {
120
120
  brandPageType: "default" | "brandSite" | "brandContact";
121
121
  }): void;
122
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
122
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
123
123
  initialisePages({ pages, sections, }: {
124
124
  pages: import("../../../brand-page").PageModel[];
125
125
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -400,7 +400,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
400
400
  setBrandPageType({ brandPageType }: {
401
401
  brandPageType: "default" | "brandSite" | "brandContact";
402
402
  }): void;
403
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
403
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: import("../../stores").InitialisePayload): Promise<void>;
404
404
  initialisePages({ pages, sections, }: {
405
405
  pages: import("../../../brand-page").PageModel[];
406
406
  sections: import("../../../shared/page-settings/store").PageSettingsStateSections;
@@ -24,6 +24,7 @@ export interface InitialisePayload {
24
24
  personalisationData?: UserPersonalisationContent[];
25
25
  isPersonalisationEnabled: boolean;
26
26
  businessName: string | undefined;
27
+ industry: string | undefined;
27
28
  logoVariationImageUrls: string[];
28
29
  shopConfigData: string | ShopConfigData;
29
30
  isServerRenderOverride?: boolean;
@@ -52,6 +53,7 @@ export interface BrandPageMakerState {
52
53
  ogTitle: string | undefined;
53
54
  ogDescription: string | undefined;
54
55
  businessName: string | undefined;
56
+ industry: string | undefined;
55
57
  cookieOptions: CookieOptions;
56
58
  sensitiveContent: SensitiveContent;
57
59
  isBrandPage: boolean;
@@ -183,7 +185,7 @@ export declare const useBrandPageMakerStore: import("pinia").StoreDefinition<"br
183
185
  setBrandPageType({ brandPageType }: {
184
186
  brandPageType: BrandPageType;
185
187
  }): void;
186
- initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: InitialisePayload): Promise<void>;
188
+ initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride, }: InitialisePayload): Promise<void>;
187
189
  initialisePages({ pages, sections, }: {
188
190
  pages: PageModel[];
189
191
  sections: PageSettingsStateSections;
@@ -64,6 +64,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
64
64
  ogTitle: undefined,
65
65
  ogDescription: undefined,
66
66
  businessName: undefined,
67
+ industry: undefined,
67
68
  isBrandPage: true,
68
69
  isBrandPageOrIsBrandContact: false,
69
70
  isBrandSite: false,
@@ -407,7 +408,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
407
408
  brandPageType === BRAND_PAGE_TYPES.brandContact;
408
409
  this.isBrandContact = brandPageType === BRAND_PAGE_TYPES.brandContact;
409
410
  },
410
- async initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, logoVariationImageUrls, shopConfigData, isServerRenderOverride = false, }) {
411
+ async initialise({ brandPage, brandPageType, emailAddress, features, logoDraftDesignAttributes, unsplashApplicationName, templateCategories, personalisationData, isPersonalisationEnabled, businessName, industry, logoVariationImageUrls, shopConfigData, isServerRenderOverride = false, }) {
411
412
  const brandPageContainerStore = useBrandPageContainerStore();
412
413
  const userStore = useBrandPageMakerUserStore();
413
414
  const uiStore = useUiStore();
@@ -623,6 +624,7 @@ export const useBrandPageMakerStore = defineStore('brandPageMaker', {
623
624
  isCookiePreviewEnabled: brandPageModel.cookieOptions?.isCookiePreviewEnabled,
624
625
  });
625
626
  this.businessName = businessName;
627
+ this.industry = industry;
626
628
  }
627
629
  finally {
628
630
  this.setIsInitialising({ isInitialising: false });
@@ -30,7 +30,7 @@ export declare class DesignTemplateClient {
30
30
  constructor(options?: DesignTemplateClientOptions);
31
31
  getTemplateItemsByTemplateType(templateTypeName: string, options?: GetTemplatesAsyncOptions): Promise<Paginated<PaginatedDesignTemplateItem> | null>;
32
32
  getTemplateByTemplateToken(templateToken: string): Promise<DesignTemplate | null>;
33
- generateText(prompt: string, existingText?: string, snapshotBase64?: string): Promise<string | null>;
33
+ generateText(prompt: string, existingText?: string, snapshotBase64?: string, businessName?: string, industry?: string): Promise<string | null>;
34
34
  }
35
35
  export declare const getInstance: () => DesignTemplateClient;
36
36
  export {};
@@ -48,7 +48,7 @@ export class DesignTemplateClient {
48
48
  }
49
49
  return null;
50
50
  }
51
- async generateText(prompt, existingText, snapshotBase64) {
51
+ async generateText(prompt, existingText, snapshotBase64, businessName, industry) {
52
52
  try {
53
53
  // Get CSRF token from meta tag
54
54
  const csrfToken = document.head
@@ -56,8 +56,10 @@ export class DesignTemplateClient {
56
56
  ?.getAttribute('content');
57
57
  const response = await axios.post(getGenerateTextEndpoint(), {
58
58
  prompt,
59
- existingText: existingText || 'N/A',
59
+ existingText: existingText || '',
60
60
  snapshotBase64: snapshotBase64 || '',
61
+ businessName: businessName || '',
62
+ industry: industry || '',
61
63
  }, {
62
64
  withCredentials: true,
63
65
  headers: {
@@ -50,7 +50,7 @@ export function useSnapshot() {
50
50
  const canvas = await window.html2canvas(element, {
51
51
  allowTaint: true,
52
52
  useCORS: true,
53
- scale: 0.5, // Reduce quality to decrease file size
53
+ scale: 0.8, // Reduce quality to decrease file size
54
54
  logging: false,
55
55
  backgroundColor: '#ffffff',
56
56
  });