@tagadapay/plugin-sdk 3.1.11 → 3.1.22
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/README.md +1129 -1129
- package/build-cdn.js +231 -228
- package/dist/data/iso3166.d.ts +23 -33
- package/dist/data/iso3166.js +134 -198
- package/dist/data/languages.d.ts +5 -64
- package/dist/data/languages.js +23 -143
- package/dist/external-tracker.js +968 -102
- package/dist/external-tracker.min.js +2 -2
- package/dist/external-tracker.min.js.map +4 -4
- package/dist/react/hooks/useISOData.js +1 -1
- package/dist/react/hooks/usePaymentPolling.d.ts +3 -3
- package/dist/react/hooks/useShippingRates.d.ts +6 -0
- package/dist/react/hooks/useShippingRates.js +38 -0
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/react/services/apiService.d.ts +21 -0
- package/dist/react/services/apiService.js +10 -0
- package/dist/tagada-sdk.js +2079 -179
- package/dist/tagada-sdk.min.js +4 -2
- package/dist/tagada-sdk.min.js.map +4 -4
- package/dist/v2/core/client.d.ts +4 -2
- package/dist/v2/core/client.js +4 -3
- package/dist/v2/core/errors.d.ts +75 -0
- package/dist/v2/core/errors.js +104 -0
- package/dist/v2/core/funnelClient.d.ts +16 -15
- package/dist/v2/core/funnelClient.js +1 -1
- package/dist/v2/core/index.d.ts +1 -0
- package/dist/v2/core/index.js +2 -0
- package/dist/v2/core/pixelMapping.d.ts +49 -0
- package/dist/v2/core/pixelMapping.js +325 -0
- package/dist/v2/core/resources/apiClient.d.ts +2 -0
- package/dist/v2/core/resources/apiClient.js +52 -9
- package/dist/v2/core/resources/checkout.d.ts +89 -30
- package/dist/v2/core/resources/checkout.js +8 -0
- package/dist/v2/core/resources/customer.d.ts +20 -19
- package/dist/v2/core/resources/funnel.d.ts +17 -17
- package/dist/v2/core/resources/payments.d.ts +84 -13
- package/dist/v2/core/resources/payments.js +26 -9
- package/dist/v2/core/resources/shippingRates.d.ts +15 -0
- package/dist/v2/core/resources/shippingRates.js +11 -0
- package/dist/v2/core/types.d.ts +50 -12
- package/dist/v2/core/types.js +0 -3
- package/dist/v2/core/utils/checkout.d.ts +2 -2
- package/dist/v2/core/utils/checkout.js +7 -2
- package/dist/v2/core/utils/order.d.ts +11 -9
- package/dist/v2/core/utils/previewModeIndicator.js +101 -101
- package/dist/v2/index.d.ts +4 -2
- package/dist/v2/index.js +1 -1
- package/dist/v2/react/components/ApplePayButton.js +13 -4
- package/dist/v2/react/components/FunnelScriptInjector.js +51 -30
- package/dist/v2/react/components/WhopCheckout.d.ts +24 -0
- package/dist/v2/react/components/WhopCheckout.js +231 -0
- package/dist/v2/react/hooks/__examples__/FunnelContextExample.js +1 -1
- package/dist/v2/react/hooks/payment-actions/useAirwallexRadarAction.d.ts +14 -0
- package/dist/v2/react/hooks/payment-actions/useAirwallexRadarAction.js +181 -0
- package/dist/v2/react/hooks/payment-actions/useErrorAction.d.ts +9 -0
- package/dist/v2/react/hooks/payment-actions/useErrorAction.js +21 -0
- package/dist/v2/react/hooks/payment-actions/useFinixRadarAction.d.ts +14 -0
- package/dist/v2/react/hooks/payment-actions/useFinixRadarAction.js +187 -0
- package/dist/v2/react/hooks/payment-actions/useKessPayAction.d.ts +11 -0
- package/dist/v2/react/hooks/payment-actions/useKessPayAction.js +91 -0
- package/dist/v2/react/hooks/payment-actions/useMasterCardAction.d.ts +24 -0
- package/dist/v2/react/hooks/payment-actions/useMasterCardAction.js +221 -0
- package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.d.ts +15 -0
- package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.js +142 -0
- package/dist/v2/react/hooks/payment-actions/useProcessorAuthAction.d.ts +3 -0
- package/dist/v2/react/hooks/payment-actions/useProcessorAuthAction.js +13 -0
- package/dist/v2/react/hooks/payment-actions/useRedirectAction.d.ts +10 -0
- package/dist/v2/react/hooks/payment-actions/useRedirectAction.js +35 -0
- package/dist/v2/react/hooks/payment-actions/useStripeRadarAction.d.ts +14 -0
- package/dist/v2/react/hooks/payment-actions/useStripeRadarAction.js +192 -0
- package/dist/v2/react/hooks/payment-actions/useThreedsAuthAction.d.ts +14 -0
- package/dist/v2/react/hooks/payment-actions/useThreedsAuthAction.js +81 -0
- package/dist/v2/react/hooks/payment-actions/useTrustFlowAction.d.ts +11 -0
- package/dist/v2/react/hooks/payment-actions/useTrustFlowAction.js +84 -0
- package/dist/v2/react/hooks/payment-processing/usePaymentInstruments.d.ts +14 -0
- package/dist/v2/react/hooks/payment-processing/usePaymentInstruments.js +36 -0
- package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.d.ts +31 -0
- package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.js +212 -0
- package/dist/v2/react/hooks/payment-redirect/useAirwallex3dsReturn.d.ts +14 -0
- package/dist/v2/react/hooks/payment-redirect/useAirwallex3dsReturn.js +207 -0
- package/dist/v2/react/hooks/payment-redirect/useGenericPaymentReturn.d.ts +12 -0
- package/dist/v2/react/hooks/payment-redirect/useGenericPaymentReturn.js +101 -0
- package/dist/v2/react/hooks/useCheckoutQuery.d.ts +6 -0
- package/dist/v2/react/hooks/useCheckoutQuery.js +45 -0
- package/dist/v2/react/hooks/useFunnel.d.ts +1 -2
- package/dist/v2/react/hooks/useGeoLocation.d.ts +2 -1
- package/dist/v2/react/hooks/useGeoLocation.js +4 -2
- package/dist/v2/react/hooks/useGoogleAutocomplete.js +82 -33
- package/dist/v2/react/hooks/useISOData.js +1 -1
- package/dist/v2/react/hooks/usePaymentPolling.d.ts +3 -3
- package/dist/v2/react/hooks/usePaymentQuery.d.ts +18 -5
- package/dist/v2/react/hooks/usePaymentQuery.js +63 -1015
- package/dist/v2/react/hooks/usePaymentRetrieve.d.ts +3 -2
- package/dist/v2/react/hooks/usePaymentRetrieve.js +3 -1
- package/dist/v2/react/hooks/usePixelTracking.d.ts +5 -43
- package/dist/v2/react/hooks/usePixelTracking.js +213 -407
- package/dist/v2/react/hooks/useShippingRatesQuery.d.ts +6 -0
- package/dist/v2/react/hooks/useShippingRatesQuery.js +47 -4
- package/dist/v2/react/hooks/useStepConfig.d.ts +2 -8
- package/dist/v2/react/hooks/useStepConfig.js +1 -1
- package/dist/v2/react/hooks/useWhopPaymentPolling.d.ts +30 -0
- package/dist/v2/react/hooks/useWhopPaymentPolling.js +61 -0
- package/dist/v2/react/index.d.ts +7 -0
- package/dist/v2/react/index.js +4 -0
- package/dist/v2/react/providers/ExpressPaymentMethodsProvider.d.ts +2 -1
- package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +3 -1
- package/dist/v2/react/providers/TagadaProvider.js +76 -7
- package/dist/v2/standalone/external-tracker.d.ts +52 -46
- package/dist/v2/standalone/external-tracker.js +205 -98
- package/dist/v2/standalone/index.d.ts +22 -0
- package/dist/v2/standalone/index.js +125 -0
- package/package.json +112 -112
- package/dist/react/utils/__tests__/urlUtils.test.d.ts +0 -1
- package/dist/react/utils/__tests__/urlUtils.test.js +0 -189
- package/dist/v2/core/__tests__/pathRemapping.test.d.ts +0 -11
- package/dist/v2/core/__tests__/pathRemapping.test.js +0 -776
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Handles payment status retrieval after external redirects
|
|
4
4
|
* This is useful for processors that require server-side status checks (e.g., some 3DS flows)
|
|
5
5
|
*/
|
|
6
|
+
import { TagadaError } from '../../core/errors';
|
|
6
7
|
export interface RetrieveResult {
|
|
7
8
|
retrieveResult?: {
|
|
8
9
|
status?: string;
|
|
@@ -15,12 +16,12 @@ export interface RetrieveResult {
|
|
|
15
16
|
transactionId?: string;
|
|
16
17
|
message?: string;
|
|
17
18
|
success?: boolean;
|
|
18
|
-
error?:
|
|
19
|
+
error?: string;
|
|
19
20
|
}
|
|
20
21
|
export interface PaymentRetrieveHook {
|
|
21
22
|
startRetrievePolling: (paymentId: string) => Promise<void>;
|
|
22
23
|
isLoading: boolean;
|
|
23
|
-
error:
|
|
24
|
+
error: TagadaError | null;
|
|
24
25
|
isPolling: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare function usePaymentRetrieve(): PaymentRetrieveHook;
|
|
@@ -7,6 +7,7 @@ import { useState, useCallback, useRef, useEffect, useMemo } from 'react';
|
|
|
7
7
|
import { PaymentsResource } from '../../core/resources/payments';
|
|
8
8
|
import { usePaymentPolling } from './usePaymentPolling';
|
|
9
9
|
import { getGlobalApiClient } from './useApiQuery';
|
|
10
|
+
import { TagadaError, TagadaErrorCode } from '../../core/errors';
|
|
10
11
|
export function usePaymentRetrieve() {
|
|
11
12
|
const [isLoading, setIsLoading] = useState(false);
|
|
12
13
|
const [error, setError] = useState(null);
|
|
@@ -166,10 +167,11 @@ export function usePaymentRetrieve() {
|
|
|
166
167
|
void startRetrievePolling(paymentIdFromUrl);
|
|
167
168
|
}
|
|
168
169
|
}, [startRetrievePolling]);
|
|
170
|
+
const tagadaError = useMemo(() => error ? new TagadaError(error, { code: TagadaErrorCode.PAYMENT_FAILED }) : null, [error]);
|
|
169
171
|
return {
|
|
170
172
|
startRetrievePolling,
|
|
171
173
|
isLoading,
|
|
172
|
-
error,
|
|
174
|
+
error: tagadaError,
|
|
173
175
|
isPolling: isPollingRef.current,
|
|
174
176
|
};
|
|
175
177
|
}
|
|
@@ -2,55 +2,17 @@
|
|
|
2
2
|
* usePixelTracking Hook & Provider
|
|
3
3
|
*
|
|
4
4
|
* SDK-level pixel tracking based on runtime stepConfig.pixels injected
|
|
5
|
-
* by the CRM.
|
|
6
|
-
*
|
|
7
|
-
* integrations.
|
|
5
|
+
* by the CRM. Uses core/pixelMapping for event mapping and gating,
|
|
6
|
+
* keeping browser-specific init/fire logic here.
|
|
8
7
|
*/
|
|
9
8
|
import React from 'react';
|
|
10
|
-
|
|
9
|
+
import { type StandardPixelEvent } from '../../core/pixelMapping';
|
|
10
|
+
export type { StandardPixelEvent } from '../../core/pixelMapping';
|
|
11
11
|
export interface PixelTrackingContextValue {
|
|
12
|
-
track: (eventName: StandardPixelEvent, parameters?: Record<string,
|
|
12
|
+
track: (eventName: StandardPixelEvent, parameters?: Record<string, unknown>) => void;
|
|
13
13
|
pixelsInitialized: boolean;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Provider that initializes pixels based on stepConfig.pixels
|
|
17
|
-
* and exposes a simple track(event, params) API.
|
|
18
|
-
*/
|
|
19
15
|
export declare function PixelTrackingProvider({ children }: {
|
|
20
16
|
children: React.ReactNode;
|
|
21
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
/**
|
|
23
|
-
* Hook to access SDK pixel tracking.
|
|
24
|
-
* Must be used within TagadaProvider (which wraps PixelTrackingProvider).
|
|
25
|
-
*/
|
|
26
18
|
export declare function usePixelTracking(): PixelTrackingContextValue;
|
|
27
|
-
declare global {
|
|
28
|
-
interface FacebookPixelFunction {
|
|
29
|
-
(...args: unknown[]): void;
|
|
30
|
-
callMethod?: (...args: unknown[]) => void;
|
|
31
|
-
queue?: unknown[];
|
|
32
|
-
loaded?: boolean;
|
|
33
|
-
version?: string;
|
|
34
|
-
}
|
|
35
|
-
interface TikTokPixelFunction {
|
|
36
|
-
(...args: unknown[]): void;
|
|
37
|
-
methods?: string[];
|
|
38
|
-
setAndDefer?: (target: TikTokPixelFunction, method: string) => void;
|
|
39
|
-
load?: (pixelId: string) => void;
|
|
40
|
-
page?: () => void;
|
|
41
|
-
track?: (eventName: string, params: Record<string, unknown>) => void;
|
|
42
|
-
queue?: unknown[];
|
|
43
|
-
}
|
|
44
|
-
interface SnapchatPixelFunction {
|
|
45
|
-
(...args: unknown[]): void;
|
|
46
|
-
handleRequest?: (...args: unknown[]) => void;
|
|
47
|
-
queue?: unknown[];
|
|
48
|
-
}
|
|
49
|
-
interface Window {
|
|
50
|
-
fbq?: FacebookPixelFunction;
|
|
51
|
-
_fbq?: FacebookPixelFunction;
|
|
52
|
-
ttq?: TikTokPixelFunction;
|
|
53
|
-
snaptr?: SnapchatPixelFunction;
|
|
54
|
-
dataLayer?: any[];
|
|
55
|
-
}
|
|
56
|
-
}
|