@tagadapay/plugin-sdk 3.1.12 → 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/build-cdn.js +129 -11
- 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 -101
- 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/tagada-sdk.js +12066 -0
- package/dist/tagada-sdk.min.js +50 -0
- package/dist/tagada-sdk.min.js.map +7 -0
- 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 +2 -0
- 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/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/currency.d.ts +14 -0
- package/dist/v2/core/utils/currency.js +40 -0
- package/dist/v2/core/utils/index.d.ts +1 -0
- package/dist/v2/core/utils/index.js +2 -0
- package/dist/v2/core/utils/order.d.ts +11 -9
- package/dist/v2/core/utils/pluginConfig.d.ts +8 -0
- package/dist/v2/core/utils/pluginConfig.js +28 -0
- package/dist/v2/index.d.ts +3 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/react/components/FunnelScriptInjector.js +21 -0
- 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/useGeoLocation.d.ts +2 -1
- package/dist/v2/react/hooks/useGeoLocation.js +4 -2
- 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 -48
- package/dist/v2/react/hooks/usePixelTracking.js +212 -514
- package/dist/v2/react/hooks/useShippingRatesQuery.js +13 -5
- 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 +71 -2
- 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 +126 -1
- package/package.json +3 -3
- 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
package/dist/data/languages.d.ts
CHANGED
|
@@ -1,81 +1,22 @@
|
|
|
1
|
-
import type { SupportedLanguage } from './iso3166';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* await importRussian();
|
|
2
|
+
* Language import utilities — CDN-backed.
|
|
3
|
+
* All language-specific geodata is now fetched from Vercel Blob CDN,
|
|
4
|
+
* so these helpers are thin wrappers around ensureGeoDataLoaded().
|
|
7
5
|
*/
|
|
6
|
+
import type { SupportedLanguage } from './iso3166';
|
|
8
7
|
export declare function importRussian(): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Import and register German language data
|
|
11
|
-
*/
|
|
12
8
|
export declare function importGerman(): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Import and register French language data
|
|
15
|
-
*/
|
|
16
9
|
export declare function importFrench(): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Import and register Spanish language data
|
|
19
|
-
*/
|
|
20
10
|
export declare function importSpanish(): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Import and register Chinese language data
|
|
23
|
-
*/
|
|
24
11
|
export declare function importChinese(): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Import and register Hindi language data
|
|
27
|
-
*/
|
|
28
12
|
export declare function importHindi(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Import and register Portuguese language data
|
|
31
|
-
*/
|
|
32
13
|
export declare function importPortuguese(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Import and register Japanese language data
|
|
35
|
-
*/
|
|
36
14
|
export declare function importJapanese(): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Import and register Arabic language data
|
|
39
|
-
*/
|
|
40
15
|
export declare function importArabic(): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Import and register Italian language data
|
|
43
|
-
*/
|
|
44
16
|
export declare function importItalian(): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Import and register Hebrew language data
|
|
47
|
-
*/
|
|
48
17
|
export declare function importHebrew(): Promise<void>;
|
|
49
|
-
|
|
50
|
-
* Language import functions mapping
|
|
51
|
-
*/
|
|
52
|
-
export declare const languageImports: {
|
|
53
|
-
readonly ru: typeof importRussian;
|
|
54
|
-
readonly de: typeof importGerman;
|
|
55
|
-
readonly fr: typeof importFrench;
|
|
56
|
-
readonly es: typeof importSpanish;
|
|
57
|
-
readonly zh: typeof importChinese;
|
|
58
|
-
readonly hi: typeof importHindi;
|
|
59
|
-
readonly pt: typeof importPortuguese;
|
|
60
|
-
readonly ja: typeof importJapanese;
|
|
61
|
-
readonly ar: typeof importArabic;
|
|
62
|
-
readonly it: typeof importItalian;
|
|
63
|
-
readonly he: typeof importHebrew;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Import multiple languages at once
|
|
67
|
-
* @param languages - Array of language codes to import
|
|
68
|
-
* @example
|
|
69
|
-
* import { importLanguages } from '@tagadapay/plugin-sdk/data/languages';
|
|
70
|
-
* await importLanguages(['ru', 'de', 'fr']);
|
|
71
|
-
*/
|
|
18
|
+
export declare const languageImports: Record<string, () => Promise<void>>;
|
|
72
19
|
export declare function importLanguages(languages: SupportedLanguage[]): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Import all available languages (except English which is already imported)
|
|
75
|
-
* @example
|
|
76
|
-
* import { importAllLanguages } from '@tagadapay/plugin-sdk/data/languages';
|
|
77
|
-
* await importAllLanguages();
|
|
78
|
-
*/
|
|
79
20
|
export declare function importAllLanguages(): Promise<void>;
|
|
80
21
|
export declare const LANGUAGES: {
|
|
81
22
|
aa: {
|
package/dist/data/languages.js
CHANGED
|
@@ -1,153 +1,33 @@
|
|
|
1
|
-
// Language import utilities for modular ISO data loading
|
|
2
|
-
// This file provides convenient functions to import specific languages
|
|
3
|
-
import { registerLanguage } from './iso3166';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* await importRussian();
|
|
9
|
-
*/
|
|
10
|
-
export async function importRussian() {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
12
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
13
|
-
const ruDatabase = (await import('iso3166-2-db/i18n/dispute/UN/ru')).default;
|
|
14
|
-
registerLanguage('ru', ruDatabase);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Import and register German language data
|
|
18
|
-
*/
|
|
19
|
-
export async function importGerman() {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
22
|
-
const deDatabase = (await import('iso3166-2-db/i18n/dispute/UN/de')).default;
|
|
23
|
-
registerLanguage('de', deDatabase);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Import and register French language data
|
|
27
|
-
*/
|
|
28
|
-
export async function importFrench() {
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
31
|
-
const frDatabase = (await import('iso3166-2-db/i18n/dispute/UN/fr')).default;
|
|
32
|
-
registerLanguage('fr', frDatabase);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Import and register Spanish language data
|
|
36
|
-
*/
|
|
37
|
-
export async function importSpanish() {
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
40
|
-
const esDatabase = (await import('iso3166-2-db/i18n/dispute/UN/es')).default;
|
|
41
|
-
registerLanguage('es', esDatabase);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Import and register Chinese language data
|
|
45
|
-
*/
|
|
46
|
-
export async function importChinese() {
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
49
|
-
const zhDatabase = (await import('iso3166-2-db/i18n/dispute/UN/zh')).default;
|
|
50
|
-
registerLanguage('zh', zhDatabase);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Import and register Hindi language data
|
|
54
|
-
*/
|
|
55
|
-
export async function importHindi() {
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
57
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
58
|
-
const hiDatabase = (await import('iso3166-2-db/i18n/dispute/UN/hi')).default;
|
|
59
|
-
registerLanguage('hi', hiDatabase);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Import and register Portuguese language data
|
|
63
|
-
*/
|
|
64
|
-
export async function importPortuguese() {
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
66
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
67
|
-
const ptDatabase = (await import('iso3166-2-db/i18n/dispute/UN/pt')).default;
|
|
68
|
-
registerLanguage('pt', ptDatabase);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Import and register Japanese language data
|
|
72
|
-
*/
|
|
73
|
-
export async function importJapanese() {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
75
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
76
|
-
const jaDatabase = (await import('iso3166-2-db/i18n/dispute/UN/ja')).default;
|
|
77
|
-
registerLanguage('ja', jaDatabase);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Import and register Arabic language data
|
|
81
|
-
*/
|
|
82
|
-
export async function importArabic() {
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
85
|
-
const arDatabase = (await import('iso3166-2-db/i18n/dispute/UN/ar')).default;
|
|
86
|
-
registerLanguage('ar', arDatabase);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Import and register Italian language data
|
|
90
|
-
*/
|
|
91
|
-
export async function importItalian() {
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
93
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
94
|
-
const itDatabase = (await import('iso3166-2-db/i18n/dispute/UN/it')).default;
|
|
95
|
-
registerLanguage('it', itDatabase);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Import and register Hebrew language data
|
|
99
|
-
*/
|
|
100
|
-
export async function importHebrew() {
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
102
|
-
// @ts-ignore - iso3166-2-db doesn't have TypeScript definitions
|
|
103
|
-
const heDatabase = (await import('iso3166-2-db/i18n/dispute/UN/he')).default;
|
|
104
|
-
registerLanguage('he', heDatabase);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Language import functions mapping
|
|
2
|
+
* Language import utilities — CDN-backed.
|
|
3
|
+
* All language-specific geodata is now fetched from Vercel Blob CDN,
|
|
4
|
+
* so these helpers are thin wrappers around ensureGeoDataLoaded().
|
|
108
5
|
*/
|
|
6
|
+
import { ensureGeoDataLoaded } from './iso3166';
|
|
7
|
+
export async function importRussian() { await ensureGeoDataLoaded('ru'); }
|
|
8
|
+
export async function importGerman() { await ensureGeoDataLoaded('de'); }
|
|
9
|
+
export async function importFrench() { await ensureGeoDataLoaded('fr'); }
|
|
10
|
+
export async function importSpanish() { await ensureGeoDataLoaded('es'); }
|
|
11
|
+
export async function importChinese() { await ensureGeoDataLoaded('zh'); }
|
|
12
|
+
export async function importHindi() { await ensureGeoDataLoaded('hi'); }
|
|
13
|
+
export async function importPortuguese() { await ensureGeoDataLoaded('pt'); }
|
|
14
|
+
export async function importJapanese() { await ensureGeoDataLoaded('ja'); }
|
|
15
|
+
export async function importArabic() { await ensureGeoDataLoaded('ar'); }
|
|
16
|
+
export async function importItalian() { await ensureGeoDataLoaded('it'); }
|
|
17
|
+
export async function importHebrew() { await ensureGeoDataLoaded('he'); }
|
|
109
18
|
export const languageImports = {
|
|
110
|
-
ru: importRussian,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
es: importSpanish,
|
|
114
|
-
zh: importChinese,
|
|
115
|
-
hi: importHindi,
|
|
116
|
-
pt: importPortuguese,
|
|
117
|
-
ja: importJapanese,
|
|
118
|
-
ar: importArabic,
|
|
119
|
-
it: importItalian,
|
|
120
|
-
he: importHebrew,
|
|
19
|
+
ru: importRussian, de: importGerman, fr: importFrench, es: importSpanish,
|
|
20
|
+
zh: importChinese, hi: importHindi, pt: importPortuguese, ja: importJapanese,
|
|
21
|
+
ar: importArabic, it: importItalian, he: importHebrew,
|
|
121
22
|
};
|
|
122
|
-
/**
|
|
123
|
-
* Import multiple languages at once
|
|
124
|
-
* @param languages - Array of language codes to import
|
|
125
|
-
* @example
|
|
126
|
-
* import { importLanguages } from '@tagadapay/plugin-sdk/data/languages';
|
|
127
|
-
* await importLanguages(['ru', 'de', 'fr']);
|
|
128
|
-
*/
|
|
129
23
|
export async function importLanguages(languages) {
|
|
130
|
-
|
|
131
|
-
.filter(lang => lang !== 'en')
|
|
132
|
-
.map(lang =>
|
|
133
|
-
const importFn = languageImports[lang];
|
|
134
|
-
if (!importFn) {
|
|
135
|
-
console.warn(`No import function found for language: ${lang}`);
|
|
136
|
-
return Promise.resolve();
|
|
137
|
-
}
|
|
138
|
-
return importFn();
|
|
139
|
-
});
|
|
140
|
-
await Promise.all(importPromises);
|
|
24
|
+
await Promise.all(languages
|
|
25
|
+
.filter(lang => lang !== 'en')
|
|
26
|
+
.map(lang => ensureGeoDataLoaded(lang)));
|
|
141
27
|
}
|
|
142
|
-
/**
|
|
143
|
-
* Import all available languages (except English which is already imported)
|
|
144
|
-
* @example
|
|
145
|
-
* import { importAllLanguages } from '@tagadapay/plugin-sdk/data/languages';
|
|
146
|
-
* await importAllLanguages();
|
|
147
|
-
*/
|
|
148
28
|
export async function importAllLanguages() {
|
|
149
|
-
const
|
|
150
|
-
await importLanguages(
|
|
29
|
+
const all = ['ru', 'de', 'fr', 'es', 'zh', 'hi', 'pt', 'ja', 'ar', 'it', 'he'];
|
|
30
|
+
await importLanguages(all);
|
|
151
31
|
}
|
|
152
32
|
export const LANGUAGES = {
|
|
153
33
|
aa: {
|