@diffsome/react 1.3.4 → 1.4.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.
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +62 -0
- package/dist/index.mjs +61 -0
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
|
-
import { Diffsome, Member, Cart, WishlistItem, DiffsomeConfig, CurrencyInfo, SiteInfo, LoginCredentials, AuthResponse, RegisterData, UpdateProfileData, ResetPasswordData, SocialProvider, WishlistToggleResult, WishlistMoveToCartResult, BundlePricing, ProductCategory, Product, PaginationMeta, ProductListParams, ProductType, CreateOrderData, Order, OrderListParams, PaymentStatusResponse, StripeCheckoutResponse, StripeVerifyResponse, TossPaymentReadyResponse, TossPaymentConfirmResponse, Coupon, CouponValidation, MemberSubscription, DigitalDownloadLink, CanReviewResponse, CreateProductReviewData, ProductReview, UpdateProductReviewData, ProductReviewStats, ProductReviewListParams, BlogCategory, BlogListParams, BlogPost, BoardPost, Board, CreateBoardPostData, BoardPostListParams, BoardListParams, Comment, CreateCommentData, Form, FormSubmissionData, FormSubmission, ReservationSlot, CreateReservationData, Reservation, ReservationService, ReservationSettings, ReservationStaff, ReservationListParams, Media, CustomEntity, EntityRecord, EntityListParams, ChatConversation, ChatMessage as ChatMessage$1 } from '@diffsome/sdk';
|
|
4
|
+
import { Diffsome, Member, Cart, WishlistItem, DiffsomeConfig, CurrencyInfo, SiteInfo, LoginCredentials, AuthResponse, RegisterData, UpdateProfileData, ResetPasswordData, SocialProvider, WishlistToggleResult, WishlistMoveToCartResult, BundlePricing, ProductCategory, Product, PaginationMeta, ProductListParams, ProductType, CreateOrderData, Order, OrderListParams, NicePaymentReadyResponse, NicePaymentConfirmResponse, PaymentStatusResponse, StripeCheckoutResponse, StripeVerifyResponse, TossPaymentReadyResponse, TossPaymentConfirmResponse, Coupon, CouponValidation, MemberSubscription, DigitalDownloadLink, CanReviewResponse, CreateProductReviewData, ProductReview, UpdateProductReviewData, ProductReviewStats, ProductReviewListParams, BlogCategory, BlogListParams, BlogPost, BoardPost, Board, CreateBoardPostData, BoardPostListParams, BoardListParams, Comment, CreateCommentData, Form, FormSubmissionData, FormSubmission, ReservationSlot, CreateReservationData, Reservation, ReservationService, ReservationSettings, ReservationStaff, ReservationListParams, Media, CustomEntity, EntityRecord, EntityListParams, ChatConversation, ChatMessage as ChatMessage$1 } from '@diffsome/sdk';
|
|
5
5
|
export { AddToCartData, AuthResponse, BlogCategory, BlogListParams, BlogPost, Board, BoardListParams, BoardPost, BoardPostListParams, CanReviewResponse, Cart, CartItem, Comment, Coupon, CouponType, CouponValidation, CreateBoardPostData, CreateCommentData, CreateOrderData, CreateProductReviewData, CreateReservationData, CustomEntity, DiffsomeConfig, DigitalDownloadLink, DigitalFile, EntityField, EntityListParams, EntityRecord, EntitySchema, Form, FormSubmission, FormSubmissionData, ListResponse, LoginCredentials, Media, Member, MemberSubscription, Order, OrderItem, OrderListParams, OrderStatus, PaginatedResponse, PaginationMeta, Payment, PaymentMethod, PaymentStatus, PaymentStatusResponse, Product, ProductCategory, ProductListParams, ProductReview, ProductReviewStats, ProductType, ProductVariant, RegisterData, Reservation, ReservationService, ReservationSettings, ReservationSlot, ReservationStaff, ResetPasswordData, SiteInfo, SocialAuthUrl, SocialProvider, StripeCheckoutResponse, StripeVerifyResponse, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, TossPaymentConfirmResponse, TossPaymentReadyResponse, UpdateProfileData, WishlistItem, WishlistMoveToCartResult, WishlistToggleResult } from '@diffsome/sdk';
|
|
6
6
|
|
|
7
7
|
interface DiffsomeContextValue {
|
|
@@ -386,6 +386,8 @@ interface UsePaymentStatusReturn {
|
|
|
386
386
|
currency: CurrencyInfo | null;
|
|
387
387
|
formatPrice: (amount: number) => string;
|
|
388
388
|
isTossAvailable: boolean;
|
|
389
|
+
isNiceAvailable: boolean;
|
|
390
|
+
niceClientKey: string | null;
|
|
389
391
|
isStripeAvailable: boolean;
|
|
390
392
|
stripePublishableKey: string | null;
|
|
391
393
|
}
|
|
@@ -398,6 +400,14 @@ interface UseTossPaymentReturn {
|
|
|
398
400
|
error: Error | null;
|
|
399
401
|
}
|
|
400
402
|
declare function useTossPayment(): UseTossPaymentReturn;
|
|
403
|
+
interface UseNicePaymentReturn {
|
|
404
|
+
preparePayment: (orderNumber: string, returnUrl: string) => Promise<NicePaymentReadyResponse>;
|
|
405
|
+
confirmPayment: (tid: string, orderId: string, amount: number) => Promise<NicePaymentConfirmResponse>;
|
|
406
|
+
cancelPayment: (orderNumber: string, reason: string, amount?: number) => Promise<void>;
|
|
407
|
+
loading: boolean;
|
|
408
|
+
error: Error | null;
|
|
409
|
+
}
|
|
410
|
+
declare function useNicePayment(): UseNicePaymentReturn;
|
|
401
411
|
interface UseStripePaymentReturn {
|
|
402
412
|
createCheckout: (orderNumber: string, successUrl: string, cancelUrl: string) => Promise<StripeCheckoutResponse>;
|
|
403
413
|
verifyPayment: (sessionId: string) => Promise<StripeVerifyResponse>;
|
|
@@ -937,4 +947,4 @@ interface ChatInputProps {
|
|
|
937
947
|
}
|
|
938
948
|
declare const ChatInput: React__default.FC<ChatInputProps>;
|
|
939
949
|
|
|
940
|
-
export { ChatBubble, type ChatBubbleProps, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, ChatWidget, type ChatWidgetProps, type CommentType, DiffsomeContext, type DiffsomeContextValue, DiffsomeProvider, type DiffsomeProviderProps, type Message, RichContent, type RichContentProps, type UseAuthReturn, type UseAvailableSlotsReturn, type UseBlogCategoriesReturn, type UseBlogOptions, type UseBlogPostReturn, type UseBlogReturn, type UseBlogSearchReturn, type UseBlogTagsReturn, type UseBoardPostReturn, type UseBoardPostsReturn, type UseBoardReturn, type UseBoardsReturn, type UseBundleItemsReturn, type UseCanReviewReturn, type UseCartReturn, type UseCategoriesReturn, type UseChatOptions, type UseChatReturn, type UseCommentsOptions, type UseCommentsReturn, type UseCouponsReturn, type UseCreateBoardPostReturn, type UseCreateOrderReturn, type UseCreateReservationReturn, type UseCreateReviewReturn, type UseCreateSubscriptionReturn, type UseCurrencyReturn, type UseDownloadsReturn, type UseEntitiesReturn, type UseEntityRecordReturn, type UseEntityRecordsReturn, type UseEntityReturn, type UseFeaturedBlogReturn, type UseFeaturedProductsReturn, type UseFormReturn, type UseMediaOptions, type UseMediaReturn, type UseMyReservationsReturn, type UseMyReviewsReturn, type UseOrderDownloadsReturn, type UseOrderReturn, type UseOrdersReturn, type UsePaymentStatusReturn, type UseProductReturn, type UseProductReviewsReturn, type UseProductsByTypeReturn, type UseProductsOptions, type UseProductsReturn, type UseReservationServicesReturn, type UseReservationSettingsReturn, type UseReservationStaffsReturn, type UseSiteReturn, type UseSocialAuthReturn, type UseStripePaymentReturn, type UseSubscriptionReturn, type UseSubscriptionsReturn, type UseTossPaymentReturn, type UseValidateCouponReturn, type UseWishlistReturn, useAuth, useAvailableSlots, useBlog, useBlogCategories, useBlogPost, useBlogSearch, useBlogTags, useBoard, useBoardPost, useBoardPosts, useBoards, useBundleItems, useBundleProducts, useCanReview, useCart, useCategories, useChat, useClient, useComments, useCoupons, useCreateBoardPost, useCreateOrder, useCreateReservation, useCreateReview, useCreateSubscription, useCurrency, useDiffsome, useDigitalProducts, useDownloads, useEntities, useEntity, useEntityRecord, useEntityRecords, useFeaturedBlog, useFeaturedProducts, useForm, useMedia, useMyReservations, useMyReviews, useOrder, useOrderDownloads, useOrders, usePaymentStatus, useProduct, useProductReviews, useProducts, useProductsByType, useReservationServices, useReservationSettings, useReservationStaffs, useSite, useSocialAuth, useStripePayment, useSubscription, useSubscriptionProducts, useSubscriptions, useTossPayment, useTypedEntity, useValidateCoupon, useWishlist };
|
|
950
|
+
export { ChatBubble, type ChatBubbleProps, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, ChatWidget, type ChatWidgetProps, type CommentType, DiffsomeContext, type DiffsomeContextValue, DiffsomeProvider, type DiffsomeProviderProps, type Message, RichContent, type RichContentProps, type UseAuthReturn, type UseAvailableSlotsReturn, type UseBlogCategoriesReturn, type UseBlogOptions, type UseBlogPostReturn, type UseBlogReturn, type UseBlogSearchReturn, type UseBlogTagsReturn, type UseBoardPostReturn, type UseBoardPostsReturn, type UseBoardReturn, type UseBoardsReturn, type UseBundleItemsReturn, type UseCanReviewReturn, type UseCartReturn, type UseCategoriesReturn, type UseChatOptions, type UseChatReturn, type UseCommentsOptions, type UseCommentsReturn, type UseCouponsReturn, type UseCreateBoardPostReturn, type UseCreateOrderReturn, type UseCreateReservationReturn, type UseCreateReviewReturn, type UseCreateSubscriptionReturn, type UseCurrencyReturn, type UseDownloadsReturn, type UseEntitiesReturn, type UseEntityRecordReturn, type UseEntityRecordsReturn, type UseEntityReturn, type UseFeaturedBlogReturn, type UseFeaturedProductsReturn, type UseFormReturn, type UseMediaOptions, type UseMediaReturn, type UseMyReservationsReturn, type UseMyReviewsReturn, type UseNicePaymentReturn, type UseOrderDownloadsReturn, type UseOrderReturn, type UseOrdersReturn, type UsePaymentStatusReturn, type UseProductReturn, type UseProductReviewsReturn, type UseProductsByTypeReturn, type UseProductsOptions, type UseProductsReturn, type UseReservationServicesReturn, type UseReservationSettingsReturn, type UseReservationStaffsReturn, type UseSiteReturn, type UseSocialAuthReturn, type UseStripePaymentReturn, type UseSubscriptionReturn, type UseSubscriptionsReturn, type UseTossPaymentReturn, type UseValidateCouponReturn, type UseWishlistReturn, useAuth, useAvailableSlots, useBlog, useBlogCategories, useBlogPost, useBlogSearch, useBlogTags, useBoard, useBoardPost, useBoardPosts, useBoards, useBundleItems, useBundleProducts, useCanReview, useCart, useCategories, useChat, useClient, useComments, useCoupons, useCreateBoardPost, useCreateOrder, useCreateReservation, useCreateReview, useCreateSubscription, useCurrency, useDiffsome, useDigitalProducts, useDownloads, useEntities, useEntity, useEntityRecord, useEntityRecords, useFeaturedBlog, useFeaturedProducts, useForm, useMedia, useMyReservations, useMyReviews, useNicePayment, useOrder, useOrderDownloads, useOrders, usePaymentStatus, useProduct, useProductReviews, useProducts, useProductsByType, useReservationServices, useReservationSettings, useReservationStaffs, useSite, useSocialAuth, useStripePayment, useSubscription, useSubscriptionProducts, useSubscriptions, useTossPayment, useTypedEntity, useValidateCoupon, useWishlist };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
|
-
import { Diffsome, Member, Cart, WishlistItem, DiffsomeConfig, CurrencyInfo, SiteInfo, LoginCredentials, AuthResponse, RegisterData, UpdateProfileData, ResetPasswordData, SocialProvider, WishlistToggleResult, WishlistMoveToCartResult, BundlePricing, ProductCategory, Product, PaginationMeta, ProductListParams, ProductType, CreateOrderData, Order, OrderListParams, PaymentStatusResponse, StripeCheckoutResponse, StripeVerifyResponse, TossPaymentReadyResponse, TossPaymentConfirmResponse, Coupon, CouponValidation, MemberSubscription, DigitalDownloadLink, CanReviewResponse, CreateProductReviewData, ProductReview, UpdateProductReviewData, ProductReviewStats, ProductReviewListParams, BlogCategory, BlogListParams, BlogPost, BoardPost, Board, CreateBoardPostData, BoardPostListParams, BoardListParams, Comment, CreateCommentData, Form, FormSubmissionData, FormSubmission, ReservationSlot, CreateReservationData, Reservation, ReservationService, ReservationSettings, ReservationStaff, ReservationListParams, Media, CustomEntity, EntityRecord, EntityListParams, ChatConversation, ChatMessage as ChatMessage$1 } from '@diffsome/sdk';
|
|
4
|
+
import { Diffsome, Member, Cart, WishlistItem, DiffsomeConfig, CurrencyInfo, SiteInfo, LoginCredentials, AuthResponse, RegisterData, UpdateProfileData, ResetPasswordData, SocialProvider, WishlistToggleResult, WishlistMoveToCartResult, BundlePricing, ProductCategory, Product, PaginationMeta, ProductListParams, ProductType, CreateOrderData, Order, OrderListParams, NicePaymentReadyResponse, NicePaymentConfirmResponse, PaymentStatusResponse, StripeCheckoutResponse, StripeVerifyResponse, TossPaymentReadyResponse, TossPaymentConfirmResponse, Coupon, CouponValidation, MemberSubscription, DigitalDownloadLink, CanReviewResponse, CreateProductReviewData, ProductReview, UpdateProductReviewData, ProductReviewStats, ProductReviewListParams, BlogCategory, BlogListParams, BlogPost, BoardPost, Board, CreateBoardPostData, BoardPostListParams, BoardListParams, Comment, CreateCommentData, Form, FormSubmissionData, FormSubmission, ReservationSlot, CreateReservationData, Reservation, ReservationService, ReservationSettings, ReservationStaff, ReservationListParams, Media, CustomEntity, EntityRecord, EntityListParams, ChatConversation, ChatMessage as ChatMessage$1 } from '@diffsome/sdk';
|
|
5
5
|
export { AddToCartData, AuthResponse, BlogCategory, BlogListParams, BlogPost, Board, BoardListParams, BoardPost, BoardPostListParams, CanReviewResponse, Cart, CartItem, Comment, Coupon, CouponType, CouponValidation, CreateBoardPostData, CreateCommentData, CreateOrderData, CreateProductReviewData, CreateReservationData, CustomEntity, DiffsomeConfig, DigitalDownloadLink, DigitalFile, EntityField, EntityListParams, EntityRecord, EntitySchema, Form, FormSubmission, FormSubmissionData, ListResponse, LoginCredentials, Media, Member, MemberSubscription, Order, OrderItem, OrderListParams, OrderStatus, PaginatedResponse, PaginationMeta, Payment, PaymentMethod, PaymentStatus, PaymentStatusResponse, Product, ProductCategory, ProductListParams, ProductReview, ProductReviewStats, ProductType, ProductVariant, RegisterData, Reservation, ReservationService, ReservationSettings, ReservationSlot, ReservationStaff, ResetPasswordData, SiteInfo, SocialAuthUrl, SocialProvider, StripeCheckoutResponse, StripeVerifyResponse, SubscriptionInterval, SubscriptionPlan, SubscriptionStatus, TossPaymentConfirmResponse, TossPaymentReadyResponse, UpdateProfileData, WishlistItem, WishlistMoveToCartResult, WishlistToggleResult } from '@diffsome/sdk';
|
|
6
6
|
|
|
7
7
|
interface DiffsomeContextValue {
|
|
@@ -386,6 +386,8 @@ interface UsePaymentStatusReturn {
|
|
|
386
386
|
currency: CurrencyInfo | null;
|
|
387
387
|
formatPrice: (amount: number) => string;
|
|
388
388
|
isTossAvailable: boolean;
|
|
389
|
+
isNiceAvailable: boolean;
|
|
390
|
+
niceClientKey: string | null;
|
|
389
391
|
isStripeAvailable: boolean;
|
|
390
392
|
stripePublishableKey: string | null;
|
|
391
393
|
}
|
|
@@ -398,6 +400,14 @@ interface UseTossPaymentReturn {
|
|
|
398
400
|
error: Error | null;
|
|
399
401
|
}
|
|
400
402
|
declare function useTossPayment(): UseTossPaymentReturn;
|
|
403
|
+
interface UseNicePaymentReturn {
|
|
404
|
+
preparePayment: (orderNumber: string, returnUrl: string) => Promise<NicePaymentReadyResponse>;
|
|
405
|
+
confirmPayment: (tid: string, orderId: string, amount: number) => Promise<NicePaymentConfirmResponse>;
|
|
406
|
+
cancelPayment: (orderNumber: string, reason: string, amount?: number) => Promise<void>;
|
|
407
|
+
loading: boolean;
|
|
408
|
+
error: Error | null;
|
|
409
|
+
}
|
|
410
|
+
declare function useNicePayment(): UseNicePaymentReturn;
|
|
401
411
|
interface UseStripePaymentReturn {
|
|
402
412
|
createCheckout: (orderNumber: string, successUrl: string, cancelUrl: string) => Promise<StripeCheckoutResponse>;
|
|
403
413
|
verifyPayment: (sessionId: string) => Promise<StripeVerifyResponse>;
|
|
@@ -937,4 +947,4 @@ interface ChatInputProps {
|
|
|
937
947
|
}
|
|
938
948
|
declare const ChatInput: React__default.FC<ChatInputProps>;
|
|
939
949
|
|
|
940
|
-
export { ChatBubble, type ChatBubbleProps, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, ChatWidget, type ChatWidgetProps, type CommentType, DiffsomeContext, type DiffsomeContextValue, DiffsomeProvider, type DiffsomeProviderProps, type Message, RichContent, type RichContentProps, type UseAuthReturn, type UseAvailableSlotsReturn, type UseBlogCategoriesReturn, type UseBlogOptions, type UseBlogPostReturn, type UseBlogReturn, type UseBlogSearchReturn, type UseBlogTagsReturn, type UseBoardPostReturn, type UseBoardPostsReturn, type UseBoardReturn, type UseBoardsReturn, type UseBundleItemsReturn, type UseCanReviewReturn, type UseCartReturn, type UseCategoriesReturn, type UseChatOptions, type UseChatReturn, type UseCommentsOptions, type UseCommentsReturn, type UseCouponsReturn, type UseCreateBoardPostReturn, type UseCreateOrderReturn, type UseCreateReservationReturn, type UseCreateReviewReturn, type UseCreateSubscriptionReturn, type UseCurrencyReturn, type UseDownloadsReturn, type UseEntitiesReturn, type UseEntityRecordReturn, type UseEntityRecordsReturn, type UseEntityReturn, type UseFeaturedBlogReturn, type UseFeaturedProductsReturn, type UseFormReturn, type UseMediaOptions, type UseMediaReturn, type UseMyReservationsReturn, type UseMyReviewsReturn, type UseOrderDownloadsReturn, type UseOrderReturn, type UseOrdersReturn, type UsePaymentStatusReturn, type UseProductReturn, type UseProductReviewsReturn, type UseProductsByTypeReturn, type UseProductsOptions, type UseProductsReturn, type UseReservationServicesReturn, type UseReservationSettingsReturn, type UseReservationStaffsReturn, type UseSiteReturn, type UseSocialAuthReturn, type UseStripePaymentReturn, type UseSubscriptionReturn, type UseSubscriptionsReturn, type UseTossPaymentReturn, type UseValidateCouponReturn, type UseWishlistReturn, useAuth, useAvailableSlots, useBlog, useBlogCategories, useBlogPost, useBlogSearch, useBlogTags, useBoard, useBoardPost, useBoardPosts, useBoards, useBundleItems, useBundleProducts, useCanReview, useCart, useCategories, useChat, useClient, useComments, useCoupons, useCreateBoardPost, useCreateOrder, useCreateReservation, useCreateReview, useCreateSubscription, useCurrency, useDiffsome, useDigitalProducts, useDownloads, useEntities, useEntity, useEntityRecord, useEntityRecords, useFeaturedBlog, useFeaturedProducts, useForm, useMedia, useMyReservations, useMyReviews, useOrder, useOrderDownloads, useOrders, usePaymentStatus, useProduct, useProductReviews, useProducts, useProductsByType, useReservationServices, useReservationSettings, useReservationStaffs, useSite, useSocialAuth, useStripePayment, useSubscription, useSubscriptionProducts, useSubscriptions, useTossPayment, useTypedEntity, useValidateCoupon, useWishlist };
|
|
950
|
+
export { ChatBubble, type ChatBubbleProps, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, ChatWidget, type ChatWidgetProps, type CommentType, DiffsomeContext, type DiffsomeContextValue, DiffsomeProvider, type DiffsomeProviderProps, type Message, RichContent, type RichContentProps, type UseAuthReturn, type UseAvailableSlotsReturn, type UseBlogCategoriesReturn, type UseBlogOptions, type UseBlogPostReturn, type UseBlogReturn, type UseBlogSearchReturn, type UseBlogTagsReturn, type UseBoardPostReturn, type UseBoardPostsReturn, type UseBoardReturn, type UseBoardsReturn, type UseBundleItemsReturn, type UseCanReviewReturn, type UseCartReturn, type UseCategoriesReturn, type UseChatOptions, type UseChatReturn, type UseCommentsOptions, type UseCommentsReturn, type UseCouponsReturn, type UseCreateBoardPostReturn, type UseCreateOrderReturn, type UseCreateReservationReturn, type UseCreateReviewReturn, type UseCreateSubscriptionReturn, type UseCurrencyReturn, type UseDownloadsReturn, type UseEntitiesReturn, type UseEntityRecordReturn, type UseEntityRecordsReturn, type UseEntityReturn, type UseFeaturedBlogReturn, type UseFeaturedProductsReturn, type UseFormReturn, type UseMediaOptions, type UseMediaReturn, type UseMyReservationsReturn, type UseMyReviewsReturn, type UseNicePaymentReturn, type UseOrderDownloadsReturn, type UseOrderReturn, type UseOrdersReturn, type UsePaymentStatusReturn, type UseProductReturn, type UseProductReviewsReturn, type UseProductsByTypeReturn, type UseProductsOptions, type UseProductsReturn, type UseReservationServicesReturn, type UseReservationSettingsReturn, type UseReservationStaffsReturn, type UseSiteReturn, type UseSocialAuthReturn, type UseStripePaymentReturn, type UseSubscriptionReturn, type UseSubscriptionsReturn, type UseTossPaymentReturn, type UseValidateCouponReturn, type UseWishlistReturn, useAuth, useAvailableSlots, useBlog, useBlogCategories, useBlogPost, useBlogSearch, useBlogTags, useBoard, useBoardPost, useBoardPosts, useBoards, useBundleItems, useBundleProducts, useCanReview, useCart, useCategories, useChat, useClient, useComments, useCoupons, useCreateBoardPost, useCreateOrder, useCreateReservation, useCreateReview, useCreateSubscription, useCurrency, useDiffsome, useDigitalProducts, useDownloads, useEntities, useEntity, useEntityRecord, useEntityRecords, useFeaturedBlog, useFeaturedProducts, useForm, useMedia, useMyReservations, useMyReviews, useNicePayment, useOrder, useOrderDownloads, useOrders, usePaymentStatus, useProduct, useProductReviews, useProducts, useProductsByType, useReservationServices, useReservationSettings, useReservationStaffs, useSite, useSocialAuth, useStripePayment, useSubscription, useSubscriptionProducts, useSubscriptions, useTossPayment, useTypedEntity, useValidateCoupon, useWishlist };
|
package/dist/index.js
CHANGED
|
@@ -66,6 +66,7 @@ __export(index_exports, {
|
|
|
66
66
|
useMedia: () => useMedia,
|
|
67
67
|
useMyReservations: () => useMyReservations,
|
|
68
68
|
useMyReviews: () => useMyReviews,
|
|
69
|
+
useNicePayment: () => useNicePayment,
|
|
69
70
|
useOrder: () => useOrder,
|
|
70
71
|
useOrderDownloads: () => useOrderDownloads,
|
|
71
72
|
useOrders: () => useOrders,
|
|
@@ -943,6 +944,8 @@ function usePaymentStatus() {
|
|
|
943
944
|
currency,
|
|
944
945
|
formatPrice,
|
|
945
946
|
isTossAvailable: status?.toss?.available ?? false,
|
|
947
|
+
isNiceAvailable: status?.nice?.available ?? false,
|
|
948
|
+
niceClientKey: status?.nice?.client_key ?? null,
|
|
946
949
|
isStripeAvailable: status?.stripe?.available ?? false,
|
|
947
950
|
stripePublishableKey: status?.stripe?.publishable_key ?? null
|
|
948
951
|
};
|
|
@@ -1006,6 +1009,64 @@ function useTossPayment() {
|
|
|
1006
1009
|
error
|
|
1007
1010
|
};
|
|
1008
1011
|
}
|
|
1012
|
+
function useNicePayment() {
|
|
1013
|
+
const client = useClient();
|
|
1014
|
+
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
1015
|
+
const [error, setError] = (0, import_react9.useState)(null);
|
|
1016
|
+
const preparePayment = (0, import_react9.useCallback)(async (orderNumber, returnUrl) => {
|
|
1017
|
+
setLoading(true);
|
|
1018
|
+
setError(null);
|
|
1019
|
+
try {
|
|
1020
|
+
return await client.shop.nicePaymentReady({
|
|
1021
|
+
order_number: orderNumber,
|
|
1022
|
+
return_url: returnUrl
|
|
1023
|
+
});
|
|
1024
|
+
} catch (err) {
|
|
1025
|
+
const error2 = err instanceof Error ? err : new Error("Failed to prepare payment");
|
|
1026
|
+
setError(error2);
|
|
1027
|
+
throw error2;
|
|
1028
|
+
} finally {
|
|
1029
|
+
setLoading(false);
|
|
1030
|
+
}
|
|
1031
|
+
}, [client]);
|
|
1032
|
+
const confirmPayment = (0, import_react9.useCallback)(async (tid, orderId, amount) => {
|
|
1033
|
+
setLoading(true);
|
|
1034
|
+
setError(null);
|
|
1035
|
+
try {
|
|
1036
|
+
return await client.shop.nicePaymentConfirm({
|
|
1037
|
+
tid,
|
|
1038
|
+
order_id: orderId,
|
|
1039
|
+
amount
|
|
1040
|
+
});
|
|
1041
|
+
} catch (err) {
|
|
1042
|
+
const error2 = err instanceof Error ? err : new Error("Failed to confirm payment");
|
|
1043
|
+
setError(error2);
|
|
1044
|
+
throw error2;
|
|
1045
|
+
} finally {
|
|
1046
|
+
setLoading(false);
|
|
1047
|
+
}
|
|
1048
|
+
}, [client]);
|
|
1049
|
+
const cancelPayment = (0, import_react9.useCallback)(async (orderNumber, reason, amount) => {
|
|
1050
|
+
setLoading(true);
|
|
1051
|
+
setError(null);
|
|
1052
|
+
try {
|
|
1053
|
+
await client.shop.nicePaymentCancel(orderNumber, reason, amount);
|
|
1054
|
+
} catch (err) {
|
|
1055
|
+
const error2 = err instanceof Error ? err : new Error("Failed to cancel payment");
|
|
1056
|
+
setError(error2);
|
|
1057
|
+
throw error2;
|
|
1058
|
+
} finally {
|
|
1059
|
+
setLoading(false);
|
|
1060
|
+
}
|
|
1061
|
+
}, [client]);
|
|
1062
|
+
return {
|
|
1063
|
+
preparePayment,
|
|
1064
|
+
confirmPayment,
|
|
1065
|
+
cancelPayment,
|
|
1066
|
+
loading,
|
|
1067
|
+
error
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1009
1070
|
function useStripePayment() {
|
|
1010
1071
|
const client = useClient();
|
|
1011
1072
|
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
@@ -3269,6 +3330,7 @@ var OfflineForm = ({
|
|
|
3269
3330
|
useMedia,
|
|
3270
3331
|
useMyReservations,
|
|
3271
3332
|
useMyReviews,
|
|
3333
|
+
useNicePayment,
|
|
3272
3334
|
useOrder,
|
|
3273
3335
|
useOrderDownloads,
|
|
3274
3336
|
useOrders,
|
package/dist/index.mjs
CHANGED
|
@@ -851,6 +851,8 @@ function usePaymentStatus() {
|
|
|
851
851
|
currency,
|
|
852
852
|
formatPrice,
|
|
853
853
|
isTossAvailable: status?.toss?.available ?? false,
|
|
854
|
+
isNiceAvailable: status?.nice?.available ?? false,
|
|
855
|
+
niceClientKey: status?.nice?.client_key ?? null,
|
|
854
856
|
isStripeAvailable: status?.stripe?.available ?? false,
|
|
855
857
|
stripePublishableKey: status?.stripe?.publishable_key ?? null
|
|
856
858
|
};
|
|
@@ -914,6 +916,64 @@ function useTossPayment() {
|
|
|
914
916
|
error
|
|
915
917
|
};
|
|
916
918
|
}
|
|
919
|
+
function useNicePayment() {
|
|
920
|
+
const client = useClient();
|
|
921
|
+
const [loading, setLoading] = useState8(false);
|
|
922
|
+
const [error, setError] = useState8(null);
|
|
923
|
+
const preparePayment = useCallback9(async (orderNumber, returnUrl) => {
|
|
924
|
+
setLoading(true);
|
|
925
|
+
setError(null);
|
|
926
|
+
try {
|
|
927
|
+
return await client.shop.nicePaymentReady({
|
|
928
|
+
order_number: orderNumber,
|
|
929
|
+
return_url: returnUrl
|
|
930
|
+
});
|
|
931
|
+
} catch (err) {
|
|
932
|
+
const error2 = err instanceof Error ? err : new Error("Failed to prepare payment");
|
|
933
|
+
setError(error2);
|
|
934
|
+
throw error2;
|
|
935
|
+
} finally {
|
|
936
|
+
setLoading(false);
|
|
937
|
+
}
|
|
938
|
+
}, [client]);
|
|
939
|
+
const confirmPayment = useCallback9(async (tid, orderId, amount) => {
|
|
940
|
+
setLoading(true);
|
|
941
|
+
setError(null);
|
|
942
|
+
try {
|
|
943
|
+
return await client.shop.nicePaymentConfirm({
|
|
944
|
+
tid,
|
|
945
|
+
order_id: orderId,
|
|
946
|
+
amount
|
|
947
|
+
});
|
|
948
|
+
} catch (err) {
|
|
949
|
+
const error2 = err instanceof Error ? err : new Error("Failed to confirm payment");
|
|
950
|
+
setError(error2);
|
|
951
|
+
throw error2;
|
|
952
|
+
} finally {
|
|
953
|
+
setLoading(false);
|
|
954
|
+
}
|
|
955
|
+
}, [client]);
|
|
956
|
+
const cancelPayment = useCallback9(async (orderNumber, reason, amount) => {
|
|
957
|
+
setLoading(true);
|
|
958
|
+
setError(null);
|
|
959
|
+
try {
|
|
960
|
+
await client.shop.nicePaymentCancel(orderNumber, reason, amount);
|
|
961
|
+
} catch (err) {
|
|
962
|
+
const error2 = err instanceof Error ? err : new Error("Failed to cancel payment");
|
|
963
|
+
setError(error2);
|
|
964
|
+
throw error2;
|
|
965
|
+
} finally {
|
|
966
|
+
setLoading(false);
|
|
967
|
+
}
|
|
968
|
+
}, [client]);
|
|
969
|
+
return {
|
|
970
|
+
preparePayment,
|
|
971
|
+
confirmPayment,
|
|
972
|
+
cancelPayment,
|
|
973
|
+
loading,
|
|
974
|
+
error
|
|
975
|
+
};
|
|
976
|
+
}
|
|
917
977
|
function useStripePayment() {
|
|
918
978
|
const client = useClient();
|
|
919
979
|
const [loading, setLoading] = useState8(false);
|
|
@@ -3176,6 +3236,7 @@ export {
|
|
|
3176
3236
|
useMedia,
|
|
3177
3237
|
useMyReservations,
|
|
3178
3238
|
useMyReviews,
|
|
3239
|
+
useNicePayment,
|
|
3179
3240
|
useOrder,
|
|
3180
3241
|
useOrderDownloads,
|
|
3181
3242
|
useOrders,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diffsome/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React hooks and providers for Diffsome SDK - Headless e-commerce & CMS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"url": "https://github.com/diffsome/diffsome-react.git"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@diffsome/sdk": ">=3.
|
|
42
|
+
"@diffsome/sdk": ">=3.4.0",
|
|
43
43
|
"react": ">=18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@diffsome/sdk": "
|
|
46
|
+
"@diffsome/sdk": "file:../sdk",
|
|
47
47
|
"@types/node": "^25.0.10",
|
|
48
48
|
"@types/react": "^18.2.0",
|
|
49
49
|
"react": "^18.2.0",
|