flowrix 1.0.1-beta.5 → 1.0.1-beta.50
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.
- package/dist/module.d.mts +1 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +49 -20
- package/dist/runtime/composables/Brand/brand.d.ts +2 -2
- package/dist/runtime/composables/Brand/brand.js +2 -0
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
- package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
- package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +14 -6
- package/dist/runtime/composables/Checkout/useBillingAddress.js +6 -1
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +92 -73
- package/dist/runtime/composables/Checkout/useCheckout.js +26 -21
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +14 -6
- package/dist/runtime/composables/Checkout/useCreateAccount.js +2 -0
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +9 -1
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +3 -2
- package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +9 -1
- package/dist/runtime/composables/Checkout/useShippingAddress.js +6 -1
- package/dist/runtime/composables/Customer/useRegister.d.ts +2 -2
- package/dist/runtime/composables/Customer/useRegister.js +2 -0
- package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
- package/dist/runtime/composables/Extras/useCountry.js +5 -4
- package/dist/runtime/composables/Header/useHeader.d.ts +1 -1
- package/dist/runtime/composables/Product/useService.js +0 -3
- package/dist/runtime/composables/useAddToCart.js +1 -1
- package/dist/runtime/composables/useSearch.js +1 -1
- package/dist/runtime/middleware/flowrix.d.ts +4 -4
- package/dist/runtime/middleware/flowrix.js +32 -20
- package/dist/runtime/server/api/albums.js +1 -1
- package/dist/runtime/server/api/auth/forgot.js +1 -1
- package/dist/runtime/server/api/auth/login.js +1 -1
- package/dist/runtime/server/api/auth/logout.js +1 -1
- package/dist/runtime/server/api/auth/register.js +1 -1
- package/dist/runtime/server/api/auth/session.get.js +1 -1
- package/dist/runtime/server/api/auth/user/reset-password.js +1 -1
- package/dist/runtime/server/api/auth/user/session.js +1 -1
- package/dist/runtime/server/api/auth/user/verify-token.js +1 -1
- package/dist/runtime/server/api/banners.js +1 -1
- package/dist/runtime/server/api/blog/[slug].js +1 -1
- package/dist/runtime/server/api/blog/blog.js +1 -1
- package/dist/runtime/server/api/brand/[slug].js +1 -1
- package/dist/runtime/server/api/cache/[...slug].delete.d.ts +2 -0
- package/dist/runtime/server/api/cache/[...slug].delete.js +40 -0
- package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
- package/dist/runtime/server/api/cache/clean.get.js +16 -0
- package/dist/runtime/server/api/cart/[slug]/add.js +1 -1
- package/dist/runtime/server/api/cart/[slug]/update.js +1 -1
- package/dist/runtime/server/api/cart/remove.js +1 -1
- package/dist/runtime/server/api/cart/service/[slug]/add.js +1 -1
- package/dist/runtime/server/api/catalog/categories.js +1 -1
- package/dist/runtime/server/api/catalog/featured.js +1 -1
- package/dist/runtime/server/api/catalog/samples.js +1 -1
- package/dist/runtime/server/api/catalog/search.js +1 -1
- package/dist/runtime/server/api/category/[...slug].js +1 -1
- package/dist/runtime/server/api/checkout/applyCoupon.js +1 -1
- package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
- package/dist/runtime/server/api/checkout/configs.js +10 -11
- package/dist/runtime/server/api/checkout/countries.js +1 -1
- package/dist/runtime/server/api/checkout/paymentmethod.js +1 -1
- package/dist/runtime/server/api/company/profile.d.ts +1 -1
- package/dist/runtime/server/api/company/profile.js +4 -9
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +1 -1
- package/dist/runtime/server/api/contact-center/webforms/create.js +1 -1
- package/dist/runtime/server/api/customer/address/add.js +1 -1
- package/dist/runtime/server/api/customer/address/delete.js +1 -1
- package/dist/runtime/server/api/customer/address/setshipping.js +1 -1
- package/dist/runtime/server/api/customer/address/update.js +1 -1
- package/dist/runtime/server/api/customer/cards/delete.js +1 -1
- package/dist/runtime/server/api/customer/cards/get.js +1 -1
- package/dist/runtime/server/api/customer/change-password.js +1 -1
- package/dist/runtime/server/api/customer/checkout.js +1 -1
- package/dist/runtime/server/api/customer/orders.js +1 -1
- package/dist/runtime/server/api/customer/profile/update.js +1 -1
- package/dist/runtime/server/api/customer/quotations.js +1 -1
- package/dist/runtime/server/api/customer/search.js +1 -1
- package/dist/runtime/server/api/customer/tax-invoice.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/add.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/get.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +1 -1
- package/dist/runtime/server/api/featured.d.ts +2 -0
- package/dist/runtime/server/api/featured.js +16 -0
- package/dist/runtime/server/api/location.js +1 -1
- package/dist/runtime/server/api/nav/[id]/links.js +1 -1
- package/dist/runtime/server/api/page/[slug].js +1 -1
- package/dist/runtime/server/api/product/[...slug].js +4 -2
- package/dist/runtime/server/api/samples.d.ts +3 -0
- package/dist/runtime/server/api/samples.js +20 -0
- package/dist/runtime/server/api/search.d.ts +3 -0
- package/dist/runtime/server/api/search.js +15 -0
- package/dist/runtime/server/api/service/[slug].js +1 -1
- package/dist/runtime/server/api/service/availability.js +1 -1
- package/dist/runtime/server/api/shop.d.ts +3 -0
- package/dist/runtime/server/api/shop.js +15 -0
- package/dist/runtime/server/api/subscribe.js +1 -1
- package/dist/runtime/server/api/v2/[...slug].js +3 -1
- package/dist/runtime/server/api/webform.d.ts +3 -0
- package/dist/runtime/server/api/webform.js +16 -0
- package/dist/runtime/stores/Cart.js +35 -16
- package/dist/runtime/stores/Checkout.d.ts +8 -6
- package/dist/runtime/stores/Checkout.js +9 -1
- package/dist/runtime/stores/Search.d.ts +5 -0
- package/dist/runtime/utils/api.js +1 -1
- package/dist/runtime/utils/htmlCache.d.ts +5 -0
- package/dist/runtime/utils/htmlCache.js +59 -0
- package/dist/types.d.mts +6 -2
- package/package.json +24 -17
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
3
|
+
declare const _default: _nuxt_schema.NuxtModule<_nuxt_schema.ModuleOptions, _nuxt_schema.ModuleOptions, false>;
|
|
6
4
|
|
|
7
5
|
export { _default as default };
|
|
8
|
-
export type { ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, installModule, addImportsDir, addPlugin, addImports
|
|
1
|
+
import { defineNuxtModule, createResolver, installModule, addServerHandler, addImportsDir, addPlugin, addImports } from '@nuxt/kit';
|
|
2
2
|
|
|
3
3
|
const module = defineNuxtModule({
|
|
4
4
|
meta: {
|
|
@@ -7,28 +7,33 @@ const module = defineNuxtModule({
|
|
|
7
7
|
},
|
|
8
8
|
defaults: {},
|
|
9
9
|
async setup(_options, nuxt) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
public
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
const env = process.env;
|
|
11
|
+
const runtimeConfig = nuxt.options.runtimeConfig;
|
|
12
|
+
runtimeConfig.FLOWRIX_API_KEY ||= env.FLOWRIX_API_KEY || "";
|
|
13
|
+
runtimeConfig.FLOWRIX_API_SECRET ||= env.FLOWRIX_API_SECRET || "";
|
|
14
|
+
runtimeConfig.FLOWRIX_API_ORIGIN ||= env.FLOWRIX_API_ORIGIN || "";
|
|
15
|
+
runtimeConfig.FLOWRIX_API_BASE ||= env.FLOWRIX_API_BASE || "";
|
|
16
|
+
runtimeConfig.FLOWRIX_API_BASE_V2 ||= env.FLOWRIX_API_BASE_V2 || "";
|
|
17
|
+
Object.assign(runtimeConfig.public, {
|
|
18
|
+
...runtimeConfig.public,
|
|
19
|
+
FLOWRIX_API_KEY: runtimeConfig.public.FLOWRIX_API_KEY || env.FLOWRIX_API_KEY || "",
|
|
20
|
+
FLOWRIX_API_SECRET: runtimeConfig.public.FLOWRIX_API_SECRET || env.FLOWRIX_API_SECRET || "",
|
|
21
|
+
FLOWRIX_API_ORIGIN: runtimeConfig.public.FLOWRIX_API_ORIGIN || env.FLOWRIX_API_ORIGIN || "",
|
|
22
|
+
FLOWRIX_API_BASE: runtimeConfig.public.FLOWRIX_API_BASE || env.FLOWRIX_API_BASE || "",
|
|
23
|
+
FLOWRIX_API_BASE_V2: runtimeConfig.public.FLOWRIX_API_BASE_V2 || env.FLOWRIX_API_BASE_V2 || ""
|
|
24
|
+
});
|
|
25
|
+
console.info("\u2705 Flowrix runtime config loaded:", {
|
|
26
|
+
apiKey: runtimeConfig.public.FLOWRIX_API_KEY,
|
|
27
|
+
apiBase: runtimeConfig.public.FLOWRIX_API_BASE
|
|
28
|
+
});
|
|
28
29
|
const resolver = createResolver(import.meta.url);
|
|
29
30
|
await installModule("@pinia/nuxt");
|
|
30
|
-
|
|
31
|
+
addServerHandler({
|
|
32
|
+
middleware: true,
|
|
33
|
+
handler: resolver.resolve("./runtime/utils/htmlCache")
|
|
34
|
+
});
|
|
31
35
|
addImportsDir(resolver.resolve("./runtime/stores"));
|
|
36
|
+
addImportsDir(resolver.resolve("./runtime/composables"));
|
|
32
37
|
addPlugin({
|
|
33
38
|
src: resolver.resolve("./runtime/plugin"),
|
|
34
39
|
mode: "all"
|
|
@@ -265,6 +270,30 @@ const module = defineNuxtModule({
|
|
|
265
270
|
route: "/api/v2/**",
|
|
266
271
|
handler: resolver.resolve("./runtime/server/api/v2/[...slug]")
|
|
267
272
|
});
|
|
273
|
+
addServerHandler({
|
|
274
|
+
route: "/api/shop",
|
|
275
|
+
handler: resolver.resolve("./runtime/server/api/shop")
|
|
276
|
+
});
|
|
277
|
+
addServerHandler({
|
|
278
|
+
route: "/api/featured",
|
|
279
|
+
handler: resolver.resolve("./runtime/server/api/featured")
|
|
280
|
+
});
|
|
281
|
+
addServerHandler({
|
|
282
|
+
route: "/api/samples",
|
|
283
|
+
handler: resolver.resolve("./runtime/server/api/samples")
|
|
284
|
+
});
|
|
285
|
+
addServerHandler({
|
|
286
|
+
route: "/api/webform",
|
|
287
|
+
handler: resolver.resolve("./runtime/server/api/webform")
|
|
288
|
+
});
|
|
289
|
+
addServerHandler({
|
|
290
|
+
route: "/api/cache/clean",
|
|
291
|
+
handler: resolver.resolve("./runtime/server/api/cache/clean.get")
|
|
292
|
+
});
|
|
293
|
+
addServerHandler({
|
|
294
|
+
route: "/api/cache/**",
|
|
295
|
+
handler: resolver.resolve("./runtime/server/api/cache/[...slug].delete")
|
|
296
|
+
});
|
|
268
297
|
}
|
|
269
298
|
});
|
|
270
299
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineAsyncComponent, watch } from "vue";
|
|
2
|
+
import { useRoute, useFetch } from "#imports";
|
|
2
3
|
export function useBrand(template) {
|
|
3
4
|
const route = useRoute();
|
|
4
5
|
const components = import.meta.glob(
|
|
@@ -20,6 +21,7 @@ export function useBrand(template) {
|
|
|
20
21
|
const slug = route.params.slug;
|
|
21
22
|
const query = route.query;
|
|
22
23
|
const { data: brandData, error, pending, refresh } = useFetch(`/api/brand/${slug}`, {
|
|
24
|
+
method: "post",
|
|
23
25
|
query
|
|
24
26
|
});
|
|
25
27
|
watch(brandData, (newData) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface Product {
|
|
1
|
+
export interface Product {
|
|
2
2
|
name: string;
|
|
3
3
|
height?: number;
|
|
4
4
|
width?: number;
|
|
@@ -32,18 +32,28 @@ interface Product {
|
|
|
32
32
|
per_order_pricing: number;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
interface CartDetailProps {
|
|
35
|
+
export interface CartDetailProps {
|
|
36
36
|
items: Record<string, Product>;
|
|
37
37
|
}
|
|
38
38
|
export declare const useCartDetail: (props: CartDetailProps) => {
|
|
39
39
|
productAccordionStates: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
40
40
|
cartItems: import("vue").ComputedRef<Record<string, Product>>;
|
|
41
|
-
companyProfile:
|
|
42
|
-
checkoutData: import("vue").ComputedRef<
|
|
41
|
+
companyProfile: null;
|
|
42
|
+
checkoutData: import("vue").ComputedRef<{
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
preferences?: Record<string, any>[] | undefined;
|
|
45
|
+
outlets?: Record<string, any>[] | undefined;
|
|
46
|
+
deliverytype?: string | undefined;
|
|
47
|
+
order_no?: string | undefined;
|
|
48
|
+
publishableKey?: any;
|
|
49
|
+
calculations?: any;
|
|
50
|
+
shippingmethods?: any;
|
|
51
|
+
cart?: Record<string, import("../../stores/Checkout.js").CartItem> | undefined;
|
|
52
|
+
totals?: Record<string, any> | undefined;
|
|
53
|
+
}>;
|
|
43
54
|
removeFromCartMiddleware: (productId: string, product: Product) => Promise<void>;
|
|
44
55
|
updateQuantityMiddleware: (product: Product, qty: number) => Promise<void>;
|
|
45
56
|
toggleAccordion: (rowId: string) => void;
|
|
46
57
|
dvidedsummary: (sammarydata: any[]) => any[][];
|
|
47
58
|
swatchimagesSrcset: (swatchImage: string) => string;
|
|
48
59
|
};
|
|
49
|
-
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { onMounted, ref, computed } from "vue";
|
|
2
|
+
import { useCartStore } from "../../stores/Cart.js";
|
|
3
|
+
import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
|
|
4
|
+
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
2
5
|
export const useCartDetail = (props) => {
|
|
3
6
|
const cartStore = useCartStore();
|
|
4
7
|
const { profile: companyProfile } = useCompanyProfile();
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export default function (inputData: any): {
|
|
2
|
-
checkoutStore:
|
|
2
|
+
checkoutStore: import("pinia").Store<"checkout", import("../../stores/index.js").CheckoutState, {}, {
|
|
3
|
+
resetState(): void;
|
|
4
|
+
paymentMethods(formData: any): Promise<any>;
|
|
5
|
+
getConfig(): Promise<void>;
|
|
6
|
+
submitCheckout(): Promise<any>;
|
|
7
|
+
confirmPayment(checkoutId: string): Promise<void>;
|
|
8
|
+
CheckUserAccount(email: string): Promise<any>;
|
|
9
|
+
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
10
|
+
}>;
|
|
3
11
|
passwordShow: import("vue").Ref<string, string>;
|
|
4
12
|
password: import("vue").Ref<string, string>;
|
|
5
13
|
password_confirmationShow: import("vue").Ref<string, string>;
|
|
@@ -7,11 +15,11 @@ export default function (inputData: any): {
|
|
|
7
15
|
UserAccount: import("vue").Ref<boolean, boolean>;
|
|
8
16
|
CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
|
|
9
17
|
CheckingUserAccount: import("vue").Ref<boolean, boolean>;
|
|
10
|
-
passwordStrength:
|
|
11
|
-
passwordStrengthClass:
|
|
12
|
-
passwordStrengthValue:
|
|
13
|
-
passwordStrengthWidth:
|
|
14
|
-
passwordStrengthTextColor:
|
|
18
|
+
passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
|
|
19
|
+
passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
|
|
20
|
+
passwordStrengthValue: import("vue").ComputedRef<number>;
|
|
21
|
+
passwordStrengthWidth: import("vue").ComputedRef<string>;
|
|
22
|
+
passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
|
|
15
23
|
UpdateStripe: (inputData: any) => Promise<void>;
|
|
16
24
|
Countries: import("vue").Ref<never[], never[]>;
|
|
17
25
|
ChangeCountry: (billingfield: any) => Promise<void>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { ref, computed, onMounted } from "vue";
|
|
2
|
+
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
3
|
+
import { useCountry } from "../Extras/useCountry.js";
|
|
4
|
+
import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
|
|
5
|
+
import useStripe from "./PaymentMethods/useStripe.js";
|
|
6
|
+
import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
|
|
2
7
|
export default function(inputData) {
|
|
3
8
|
const checkoutStore = useCheckoutStore();
|
|
4
9
|
const passwordShow = ref("password");
|
|
@@ -54,7 +59,7 @@ export default function(inputData) {
|
|
|
54
59
|
});
|
|
55
60
|
const UpdateStripe = (async (inputData2) => {
|
|
56
61
|
await checkoutStore.saveToCheckoutSession(inputData2);
|
|
57
|
-
const { getpaymentMethod } =
|
|
62
|
+
const { getpaymentMethod } = useStripe();
|
|
58
63
|
const totalPrice = computed(() => {
|
|
59
64
|
return checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
|
|
60
65
|
});
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
export default function (): {
|
|
2
|
-
router:
|
|
3
|
-
route:
|
|
2
|
+
router: import("vue-router").Router;
|
|
3
|
+
route: import("vue-router").RouteLocationNormalizedLoadedGeneric;
|
|
4
4
|
inputData: import("vue").Ref<{
|
|
5
|
-
deliverymethod:
|
|
6
|
-
billing_address:
|
|
5
|
+
deliverymethod: string | number | undefined;
|
|
6
|
+
billing_address: string | number | undefined;
|
|
7
7
|
billing_country: any;
|
|
8
8
|
shippingasbilling: boolean;
|
|
9
9
|
isCustomer: boolean;
|
|
10
|
-
billing_state:
|
|
11
|
-
billing_suburb:
|
|
10
|
+
billing_state: string | number | undefined;
|
|
11
|
+
billing_suburb: string | undefined;
|
|
12
12
|
clientsceret: any;
|
|
13
|
-
billing_postcode:
|
|
14
|
-
billing_mobile:
|
|
15
|
-
billing_firstname:
|
|
16
|
-
firstname:
|
|
17
|
-
billing_middlename:
|
|
18
|
-
billing_lastname:
|
|
19
|
-
lastname:
|
|
20
|
-
shipping_address:
|
|
21
|
-
shippingmethod:
|
|
13
|
+
billing_postcode: number | undefined;
|
|
14
|
+
billing_mobile: string | number | undefined;
|
|
15
|
+
billing_firstname: string | number | undefined;
|
|
16
|
+
firstname: string | number | undefined;
|
|
17
|
+
billing_middlename: string | undefined;
|
|
18
|
+
billing_lastname: string | number | undefined;
|
|
19
|
+
lastname: string | number | undefined;
|
|
20
|
+
shipping_address: string | undefined;
|
|
21
|
+
shippingmethod: string | number | undefined;
|
|
22
22
|
shipping_country: any;
|
|
23
|
-
shipping_state:
|
|
24
|
-
shipping_suburb:
|
|
25
|
-
shipping_postcode:
|
|
26
|
-
shipping_mobile:
|
|
27
|
-
shipping_firstname:
|
|
28
|
-
shipping_middlename:
|
|
29
|
-
shipping_lastname:
|
|
23
|
+
shipping_state: string | number | undefined;
|
|
24
|
+
shipping_suburb: string | undefined;
|
|
25
|
+
shipping_postcode: number | undefined;
|
|
26
|
+
shipping_mobile: string | undefined;
|
|
27
|
+
shipping_firstname: string | undefined;
|
|
28
|
+
shipping_middlename: string | undefined;
|
|
29
|
+
shipping_lastname: string | undefined;
|
|
30
30
|
vouchercode: any;
|
|
31
31
|
paymentmethod: string;
|
|
32
32
|
cart: any;
|
|
33
|
-
abndToken:
|
|
33
|
+
abndToken: string | undefined;
|
|
34
34
|
customertoken: string;
|
|
35
|
-
email:
|
|
36
|
-
mobile:
|
|
35
|
+
email: string | number | undefined;
|
|
36
|
+
mobile: string | number | undefined;
|
|
37
37
|
authoritytoleave: undefined;
|
|
38
38
|
register: string;
|
|
39
39
|
password: string;
|
|
@@ -53,38 +53,38 @@ export default function (): {
|
|
|
53
53
|
till_expiryyear: string;
|
|
54
54
|
save_card_details: number;
|
|
55
55
|
}, {
|
|
56
|
-
deliverymethod:
|
|
57
|
-
billing_address:
|
|
56
|
+
deliverymethod: string | number | undefined;
|
|
57
|
+
billing_address: string | number | undefined;
|
|
58
58
|
billing_country: any;
|
|
59
59
|
shippingasbilling: boolean;
|
|
60
60
|
isCustomer: boolean;
|
|
61
|
-
billing_state:
|
|
62
|
-
billing_suburb:
|
|
61
|
+
billing_state: string | number | undefined;
|
|
62
|
+
billing_suburb: string | undefined;
|
|
63
63
|
clientsceret: any;
|
|
64
|
-
billing_postcode:
|
|
65
|
-
billing_mobile:
|
|
66
|
-
billing_firstname:
|
|
67
|
-
firstname:
|
|
68
|
-
billing_middlename:
|
|
69
|
-
billing_lastname:
|
|
70
|
-
lastname:
|
|
71
|
-
shipping_address:
|
|
72
|
-
shippingmethod:
|
|
64
|
+
billing_postcode: number | undefined;
|
|
65
|
+
billing_mobile: string | number | undefined;
|
|
66
|
+
billing_firstname: string | number | undefined;
|
|
67
|
+
firstname: string | number | undefined;
|
|
68
|
+
billing_middlename: string | undefined;
|
|
69
|
+
billing_lastname: string | number | undefined;
|
|
70
|
+
lastname: string | number | undefined;
|
|
71
|
+
shipping_address: string | undefined;
|
|
72
|
+
shippingmethod: string | number | undefined;
|
|
73
73
|
shipping_country: any;
|
|
74
|
-
shipping_state:
|
|
75
|
-
shipping_suburb:
|
|
76
|
-
shipping_postcode:
|
|
77
|
-
shipping_mobile:
|
|
78
|
-
shipping_firstname:
|
|
79
|
-
shipping_middlename:
|
|
80
|
-
shipping_lastname:
|
|
74
|
+
shipping_state: string | number | undefined;
|
|
75
|
+
shipping_suburb: string | undefined;
|
|
76
|
+
shipping_postcode: number | undefined;
|
|
77
|
+
shipping_mobile: string | undefined;
|
|
78
|
+
shipping_firstname: string | undefined;
|
|
79
|
+
shipping_middlename: string | undefined;
|
|
80
|
+
shipping_lastname: string | undefined;
|
|
81
81
|
vouchercode: any;
|
|
82
82
|
paymentmethod: string;
|
|
83
83
|
cart: any;
|
|
84
|
-
abndToken:
|
|
84
|
+
abndToken: string | undefined;
|
|
85
85
|
customertoken: string;
|
|
86
|
-
email:
|
|
87
|
-
mobile:
|
|
86
|
+
email: string | number | undefined;
|
|
87
|
+
mobile: string | number | undefined;
|
|
88
88
|
authoritytoleave: undefined;
|
|
89
89
|
register: string;
|
|
90
90
|
password: string;
|
|
@@ -104,38 +104,38 @@ export default function (): {
|
|
|
104
104
|
till_expiryyear: string;
|
|
105
105
|
save_card_details: number;
|
|
106
106
|
} | {
|
|
107
|
-
deliverymethod:
|
|
108
|
-
billing_address:
|
|
107
|
+
deliverymethod: string | number | undefined;
|
|
108
|
+
billing_address: string | number | undefined;
|
|
109
109
|
billing_country: any;
|
|
110
110
|
shippingasbilling: boolean;
|
|
111
111
|
isCustomer: boolean;
|
|
112
|
-
billing_state:
|
|
113
|
-
billing_suburb:
|
|
112
|
+
billing_state: string | number | undefined;
|
|
113
|
+
billing_suburb: string | undefined;
|
|
114
114
|
clientsceret: any;
|
|
115
|
-
billing_postcode:
|
|
116
|
-
billing_mobile:
|
|
117
|
-
billing_firstname:
|
|
118
|
-
firstname:
|
|
119
|
-
billing_middlename:
|
|
120
|
-
billing_lastname:
|
|
121
|
-
lastname:
|
|
122
|
-
shipping_address:
|
|
123
|
-
shippingmethod:
|
|
115
|
+
billing_postcode: number | undefined;
|
|
116
|
+
billing_mobile: string | number | undefined;
|
|
117
|
+
billing_firstname: string | number | undefined;
|
|
118
|
+
firstname: string | number | undefined;
|
|
119
|
+
billing_middlename: string | undefined;
|
|
120
|
+
billing_lastname: string | number | undefined;
|
|
121
|
+
lastname: string | number | undefined;
|
|
122
|
+
shipping_address: string | undefined;
|
|
123
|
+
shippingmethod: string | number | undefined;
|
|
124
124
|
shipping_country: any;
|
|
125
|
-
shipping_state:
|
|
126
|
-
shipping_suburb:
|
|
127
|
-
shipping_postcode:
|
|
128
|
-
shipping_mobile:
|
|
129
|
-
shipping_firstname:
|
|
130
|
-
shipping_middlename:
|
|
131
|
-
shipping_lastname:
|
|
125
|
+
shipping_state: string | number | undefined;
|
|
126
|
+
shipping_suburb: string | undefined;
|
|
127
|
+
shipping_postcode: number | undefined;
|
|
128
|
+
shipping_mobile: string | undefined;
|
|
129
|
+
shipping_firstname: string | undefined;
|
|
130
|
+
shipping_middlename: string | undefined;
|
|
131
|
+
shipping_lastname: string | undefined;
|
|
132
132
|
vouchercode: any;
|
|
133
133
|
paymentmethod: string;
|
|
134
134
|
cart: any;
|
|
135
|
-
abndToken:
|
|
135
|
+
abndToken: string | undefined;
|
|
136
136
|
customertoken: string;
|
|
137
|
-
email:
|
|
138
|
-
mobile:
|
|
137
|
+
email: string | number | undefined;
|
|
138
|
+
mobile: string | number | undefined;
|
|
139
139
|
authoritytoleave: undefined;
|
|
140
140
|
register: string;
|
|
141
141
|
password: string;
|
|
@@ -155,9 +155,28 @@ export default function (): {
|
|
|
155
155
|
till_expiryyear: string;
|
|
156
156
|
save_card_details: number;
|
|
157
157
|
}>;
|
|
158
|
-
cartData: import("vue").ComputedRef<
|
|
158
|
+
cartData: import("vue").ComputedRef<{
|
|
159
|
+
[x: string]: any;
|
|
160
|
+
preferences?: Record<string, any>[] | undefined;
|
|
161
|
+
outlets?: Record<string, any>[] | undefined;
|
|
162
|
+
deliverytype?: string | undefined;
|
|
163
|
+
order_no?: string | undefined;
|
|
164
|
+
publishableKey?: any;
|
|
165
|
+
calculations?: any;
|
|
166
|
+
shippingmethods?: any;
|
|
167
|
+
cart?: Record<string, import("../../stores/Checkout.js").CartItem> | undefined;
|
|
168
|
+
totals?: Record<string, any> | undefined;
|
|
169
|
+
}>;
|
|
159
170
|
AuthStore: import("vue").Ref<any, any>;
|
|
160
|
-
checkoutStore:
|
|
171
|
+
checkoutStore: import("pinia").Store<"checkout", import("../../stores/index.js").CheckoutState, {}, {
|
|
172
|
+
resetState(): void;
|
|
173
|
+
paymentMethods(formData: any): Promise<any>;
|
|
174
|
+
getConfig(): Promise<void>;
|
|
175
|
+
submitCheckout(): Promise<any>;
|
|
176
|
+
confirmPayment(checkoutId: string): Promise<void>;
|
|
177
|
+
CheckUserAccount(email: string): Promise<any>;
|
|
178
|
+
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
179
|
+
}>;
|
|
161
180
|
countries: any;
|
|
162
181
|
BillingDetailsForm: any;
|
|
163
182
|
DeliveryMethodForm: any;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { ref, computed, watch, onMounted, defineAsyncComponent } from "vue";
|
|
2
|
+
import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
|
|
3
|
+
import { useCartStore } from "../../stores/Cart.js";
|
|
4
|
+
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
5
|
+
import { useCountry } from "../Extras/useCountry.js";
|
|
6
|
+
import { useRouter, useRoute } from "vue-router";
|
|
7
|
+
import { useAuth } from "../useAuth.js";
|
|
2
8
|
export default function() {
|
|
3
9
|
const router = useRouter();
|
|
4
10
|
const route = useRoute();
|
|
5
11
|
const {
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
user,
|
|
13
|
+
token,
|
|
14
|
+
isAuthenticated
|
|
8
15
|
} = useAuth();
|
|
9
16
|
const { profile } = useCompanyProfile();
|
|
10
17
|
const cartStore = useCartStore();
|
|
@@ -75,14 +82,13 @@ export default function() {
|
|
|
75
82
|
save_card_details: 0
|
|
76
83
|
});
|
|
77
84
|
const updateUserFieldsIfuserLogin = (async (sameasbilling = false) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const shippingAddres = LoggedInUser.value.addresses?.filter((address) => address.shipping == 1)[0];
|
|
85
|
+
if (isAuthenticated.value.value) {
|
|
86
|
+
const billingAddres = user.value.addresses?.filter((address) => address.billing == 1)[0];
|
|
87
|
+
const shippingAddres = user.value.addresses?.filter((address) => address.shipping == 1)[0];
|
|
82
88
|
inputData.value.billing_firstname = billingAddres.firstname;
|
|
83
89
|
inputData.value.billing_lastname = billingAddres.lastname;
|
|
84
|
-
inputData.value.email =
|
|
85
|
-
inputData.value.billing_mobile =
|
|
90
|
+
inputData.value.email = user.value.email;
|
|
91
|
+
inputData.value.billing_mobile = user.value.mobile;
|
|
86
92
|
if (sameasbilling == true) {
|
|
87
93
|
} else {
|
|
88
94
|
if (billingAddres != void 0) {
|
|
@@ -116,7 +122,7 @@ export default function() {
|
|
|
116
122
|
inputData.value.shipping_mobile = shippingAddres.mobile;
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
|
-
} else if (
|
|
125
|
+
} else if (isAuthenticated.value && sameasbilling == true) {
|
|
120
126
|
inputData.value.shipping_firstname = inputData.value.billing_firstname ? inputData.value.billing_firstname : "";
|
|
121
127
|
inputData.value.shipping_lastname = inputData.value.billing_lastname ? inputData.value.billing_lastname : "";
|
|
122
128
|
inputData.value.shipping_address = inputData.value.billing_address ? inputData.value.billing_address : "";
|
|
@@ -212,28 +218,28 @@ export default function() {
|
|
|
212
218
|
}
|
|
213
219
|
};
|
|
214
220
|
const CheckFlowrixPayment = ((inputData2, payment) => {
|
|
215
|
-
let
|
|
216
|
-
var
|
|
221
|
+
let status = {};
|
|
222
|
+
var data = {
|
|
217
223
|
card_holder: inputData2.till_cardname,
|
|
218
224
|
month: inputData2.till_expirymonth,
|
|
219
225
|
year: inputData2.till_expiryyear
|
|
220
226
|
};
|
|
221
227
|
payment.tokenize(
|
|
222
|
-
|
|
228
|
+
data,
|
|
223
229
|
//additional data, MUST include card_holder (or first_name & last_name), month and year
|
|
224
|
-
function(
|
|
225
|
-
inputData2.clientsceret =
|
|
226
|
-
checkoutStore.publishableKey.clientsceret =
|
|
230
|
+
function(token2, cardData) {
|
|
231
|
+
inputData2.clientsceret = token2;
|
|
232
|
+
checkoutStore.publishableKey.clientsceret = token2;
|
|
227
233
|
checkoutStore.saveToCheckoutSession(inputData2);
|
|
228
|
-
if (
|
|
229
|
-
|
|
234
|
+
if (token2 != "") {
|
|
235
|
+
status = {};
|
|
230
236
|
}
|
|
231
237
|
},
|
|
232
238
|
function(errors) {
|
|
233
|
-
|
|
239
|
+
status = errors;
|
|
234
240
|
}
|
|
235
241
|
);
|
|
236
|
-
return
|
|
242
|
+
return status;
|
|
237
243
|
});
|
|
238
244
|
const handleSubmit = async (url_cancel, url_success, url_booking) => {
|
|
239
245
|
try {
|
|
@@ -250,8 +256,7 @@ export default function() {
|
|
|
250
256
|
return false;
|
|
251
257
|
}
|
|
252
258
|
}
|
|
253
|
-
|
|
254
|
-
if (Object.keys(LoggedInUser).length == 0) {
|
|
259
|
+
if (isAuthenticated.value) {
|
|
255
260
|
sessiondata.value.fields.firstname = inputData.value.billing_firstname;
|
|
256
261
|
sessiondata.value.fields.lastname = inputData.value.billing_lastname;
|
|
257
262
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export default function (): {
|
|
2
|
-
checkoutStore:
|
|
2
|
+
checkoutStore: import("pinia").Store<"checkout", import("../../stores/index.js").CheckoutState, {}, {
|
|
3
|
+
resetState(): void;
|
|
4
|
+
paymentMethods(formData: any): Promise<any>;
|
|
5
|
+
getConfig(): Promise<void>;
|
|
6
|
+
submitCheckout(): Promise<any>;
|
|
7
|
+
confirmPayment(checkoutId: string): Promise<void>;
|
|
8
|
+
CheckUserAccount(email: string): Promise<any>;
|
|
9
|
+
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
10
|
+
}>;
|
|
3
11
|
passwordShow: import("vue").Ref<string, string>;
|
|
4
12
|
password: import("vue").Ref<string, string>;
|
|
5
13
|
password_confirmationShow: import("vue").Ref<string, string>;
|
|
@@ -7,9 +15,9 @@ export default function (): {
|
|
|
7
15
|
UserAccount: import("vue").Ref<boolean, boolean>;
|
|
8
16
|
CheckUserAccount: (billingDetails: any, userEmail: string) => Promise<void>;
|
|
9
17
|
CheckingUserAccount: import("vue").Ref<boolean, boolean>;
|
|
10
|
-
passwordStrength:
|
|
11
|
-
passwordStrengthClass:
|
|
12
|
-
passwordStrengthValue:
|
|
13
|
-
passwordStrengthWidth:
|
|
14
|
-
passwordStrengthTextColor:
|
|
18
|
+
passwordStrength: import("vue").ComputedRef<"Password must be 8 characters" | "Strong" | "Medium" | "Weak">;
|
|
19
|
+
passwordStrengthClass: import("vue").ComputedRef<"bg-danger" | "bg-success" | "bg-warning">;
|
|
20
|
+
passwordStrengthValue: import("vue").ComputedRef<number>;
|
|
21
|
+
passwordStrengthWidth: import("vue").ComputedRef<string>;
|
|
22
|
+
passwordStrengthTextColor: import("vue").ComputedRef<"text-danger" | "text-success" | "text-black">;
|
|
15
23
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ref } from "vue";
|
|
2
|
+
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
3
|
+
import { usePasswordFormatter } from "../Extras/usePasswordFormatter.js";
|
|
2
4
|
export default function() {
|
|
3
5
|
const checkoutStore = useCheckoutStore();
|
|
4
6
|
const passwordShow = ref("password");
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export default function (): {
|
|
2
|
-
checkoutStore:
|
|
2
|
+
checkoutStore: import("pinia").Store<"checkout", import("../../stores/index.js").CheckoutState, {}, {
|
|
3
|
+
resetState(): void;
|
|
4
|
+
paymentMethods(formData: any): Promise<any>;
|
|
5
|
+
getConfig(): Promise<void>;
|
|
6
|
+
submitCheckout(): Promise<any>;
|
|
7
|
+
confirmPayment(checkoutId: string): Promise<void>;
|
|
8
|
+
CheckUserAccount(email: string): Promise<any>;
|
|
9
|
+
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
10
|
+
}>;
|
|
3
11
|
updateDeliveryMethod: (inputData: any) => Promise<void>;
|
|
4
12
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
2
|
+
import useStripe from "./PaymentMethods/useStripe.js";
|
|
2
3
|
export default function() {
|
|
3
4
|
const checkoutStore = useCheckoutStore();
|
|
4
5
|
const updateDeliveryMethod = (async (inputData) => {
|
|
5
6
|
await checkoutStore.saveToCheckoutSession(inputData);
|
|
6
|
-
const { getpaymentMethod } =
|
|
7
|
+
const { getpaymentMethod } = useStripe();
|
|
7
8
|
const totalPrice = checkoutStore.config ? checkoutStore.config.calculations.total : checkoutStore.config.total;
|
|
8
9
|
if (inputData.paymentmethod && inputData.paymentmethod == "web-stripe") {
|
|
9
10
|
getpaymentMethod("web-stripe", inputData, totalPrice);
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export default function (inputData: any): {
|
|
2
|
-
checkoutStore:
|
|
2
|
+
checkoutStore: import("pinia").Store<"checkout", import("../../stores/index.js").CheckoutState, {}, {
|
|
3
|
+
resetState(): void;
|
|
4
|
+
paymentMethods(formData: any): Promise<any>;
|
|
5
|
+
getConfig(): Promise<void>;
|
|
6
|
+
submitCheckout(): Promise<any>;
|
|
7
|
+
confirmPayment(checkoutId: string): Promise<void>;
|
|
8
|
+
CheckUserAccount(email: string): Promise<any>;
|
|
9
|
+
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
10
|
+
}>;
|
|
3
11
|
updateShippingAddress: (shippingfield: any) => void;
|
|
4
12
|
sameAsBilling: (sameasbilling: boolean | undefined, inputData: any) => Promise<void>;
|
|
5
13
|
UpdateStripe: (inputData: any) => Promise<void>;
|