@tagadapay/plugin-sdk 3.1.25 → 4.0.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/README.md +1129 -1129
- package/build-cdn.js +499 -499
- package/dist/external-tracker.js +5 -5
- package/dist/external-tracker.min.js +2 -2
- package/dist/external-tracker.min.js.map +2 -2
- package/dist/react/config/payment.d.ts +2 -2
- package/dist/react/config/payment.js +5 -5
- package/dist/react/hooks/usePayment.d.ts +7 -0
- package/dist/react/hooks/usePayment.js +1 -0
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/tagada-react-sdk-minimal.min.js +2 -2
- package/dist/tagada-react-sdk-minimal.min.js.map +4 -4
- package/dist/tagada-react-sdk.js +1616 -1275
- package/dist/tagada-react-sdk.min.js +2 -2
- package/dist/tagada-react-sdk.min.js.map +4 -4
- package/dist/tagada-sdk.js +869 -27
- package/dist/tagada-sdk.min.js +2 -2
- package/dist/tagada-sdk.min.js.map +4 -4
- package/dist/v2/core/config/environment.d.ts +3 -3
- package/dist/v2/core/config/environment.js +7 -7
- package/dist/v2/core/funnelClient.d.ts +2 -0
- package/dist/v2/core/resources/funnel.d.ts +1 -1
- package/dist/v2/core/resources/geo.d.ts +50 -0
- package/dist/v2/core/resources/geo.js +35 -0
- package/dist/v2/core/resources/payments.d.ts +19 -1
- package/dist/v2/core/resources/payments.js +8 -0
- package/dist/v2/core/utils/previewModeIndicator.js +101 -101
- package/dist/v2/react/components/FunnelScriptInjector.js +167 -19
- package/dist/v2/react/components/StripeExpressButton.d.ts +8 -0
- package/dist/v2/react/components/StripeExpressButton.js +22 -1
- package/dist/v2/react/hooks/payment-actions/useNgeniusThreedsAction.d.ts +15 -0
- package/dist/v2/react/hooks/payment-actions/useNgeniusThreedsAction.js +166 -0
- package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.js +12 -0
- package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.js +1 -0
- package/dist/v2/react/hooks/useISOData.js +25 -7
- package/dist/v2/react/hooks/usePaymentPolling.d.ts +1 -1
- package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +12 -4
- package/dist/v2/react/providers/TagadaProvider.js +5 -5
- package/dist/v2/standalone/apple-pay-service.d.ts +12 -0
- package/dist/v2/standalone/apple-pay-service.js +12 -0
- package/dist/v2/standalone/external-tracker.d.ts +1 -1
- package/dist/v2/standalone/google-pay-service.d.ts +9 -0
- package/dist/v2/standalone/google-pay-service.js +9 -0
- package/dist/v2/standalone/index.d.ts +8 -1
- package/dist/v2/standalone/index.js +7 -0
- package/dist/v2/standalone/payment-service.d.ts +18 -5
- package/dist/v2/standalone/payment-service.js +62 -9
- package/package.json +115 -114
|
@@ -23,8 +23,8 @@ export declare function getPaymentConfig(environment?: string): PaymentConfig;
|
|
|
23
23
|
* tagadaClientEnv controls which API server the SDK talks to, but BasisTheory
|
|
24
24
|
* tokens must always match the backend's BT tenant.
|
|
25
25
|
*
|
|
26
|
-
* Production BT: *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
|
|
27
|
-
* Test BT: *.
|
|
26
|
+
* Production BT: *.tagada.io, *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
|
|
27
|
+
* Test BT: *.tagada.dev, *.tagadapay.dev, localhost, vercel.app, etc.
|
|
28
28
|
*/
|
|
29
29
|
export declare function isProductionBasisTheory(): boolean;
|
|
30
30
|
/**
|
|
@@ -50,22 +50,22 @@ import { getBasisTheoryKeys } from '../../config/basisTheory';
|
|
|
50
50
|
* tagadaClientEnv controls which API server the SDK talks to, but BasisTheory
|
|
51
51
|
* tokens must always match the backend's BT tenant.
|
|
52
52
|
*
|
|
53
|
-
* Production BT: *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
|
|
54
|
-
* Test BT: *.
|
|
53
|
+
* Production BT: *.tagada.io, *.tagadapay.com, custom domains (e.g. checkout.myboost.club)
|
|
54
|
+
* Test BT: *.tagada.dev, *.tagadapay.dev, localhost, vercel.app, etc.
|
|
55
55
|
*/
|
|
56
56
|
export function isProductionBasisTheory() {
|
|
57
57
|
if (typeof window === 'undefined')
|
|
58
58
|
return false;
|
|
59
59
|
const hostname = window.location.hostname;
|
|
60
|
-
// Dev backend
|
|
60
|
+
// Dev backend — uses test BT
|
|
61
61
|
if (hostname.includes('app-dev.tagadapay.com') || hostname.includes('cdn-dev.tagadapay.com')) {
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
// Production and preprod share the same production BT tenant
|
|
65
|
-
if (hostname.includes('tagadapay.com'))
|
|
65
|
+
if (hostname.includes('tagada.io') || hostname.includes('tagadapay.com'))
|
|
66
66
|
return true;
|
|
67
67
|
// Dev/staging domains use test BT
|
|
68
|
-
if (hostname.includes('tagadapay.dev'))
|
|
68
|
+
if (hostname.includes('tagada.dev') || hostname.includes('tagadapay.dev'))
|
|
69
69
|
return false;
|
|
70
70
|
// Local development — test BT
|
|
71
71
|
if (hostname === 'localhost' ||
|
|
@@ -33,6 +33,13 @@ export interface PaymentOptions {
|
|
|
33
33
|
threedsProvider?: ThreedsProvider;
|
|
34
34
|
initiatedBy?: 'customer' | 'merchant';
|
|
35
35
|
source?: 'upsell' | 'checkout' | 'offer' | 'missing_club' | 'forced';
|
|
36
|
+
/**
|
|
37
|
+
* Shipping rate selected by the customer. Forwarded on the payment
|
|
38
|
+
* request so the order is created with the right shipping method
|
|
39
|
+
* even if the session's stored rate hasn't fully round-tripped or
|
|
40
|
+
* got cleared (race conditions).
|
|
41
|
+
*/
|
|
42
|
+
shippingRateId?: string;
|
|
36
43
|
onSuccess?: (payment: Payment) => void;
|
|
37
44
|
onFailure?: (error: string) => void;
|
|
38
45
|
onRequireAction?: (payment: Payment) => void;
|
|
@@ -217,6 +217,7 @@ export function usePayment() {
|
|
|
217
217
|
...(threedsSessionId && { threedsSessionId }),
|
|
218
218
|
...(options.initiatedBy && { initiatedBy: options.initiatedBy }),
|
|
219
219
|
...(options.source && { source: options.source }),
|
|
220
|
+
...(options.shippingRateId && { shippingRateId: options.shippingRateId }),
|
|
220
221
|
},
|
|
221
222
|
});
|
|
222
223
|
console.log('Payment response:', response);
|
|
@@ -38,11 +38,11 @@ const InitializationLoader = () => (_jsxs("div", { style: {
|
|
|
38
38
|
borderTop: '1.5px solid #9ca3af',
|
|
39
39
|
borderRadius: '50%',
|
|
40
40
|
animation: 'tagada-spin 1s linear infinite',
|
|
41
|
-
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
42
|
-
@keyframes tagada-spin {
|
|
43
|
-
0% { transform: rotate(0deg); }
|
|
44
|
-
100% { transform: rotate(360deg); }
|
|
45
|
-
}
|
|
41
|
+
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
42
|
+
@keyframes tagada-spin {
|
|
43
|
+
0% { transform: rotate(0deg); }
|
|
44
|
+
100% { transform: rotate(360deg); }
|
|
45
|
+
}
|
|
46
46
|
` })] }));
|
|
47
47
|
const TagadaContext = createContext(null);
|
|
48
48
|
export function TagadaProvider({ children, environment, customApiConfig, debugMode, // Remove default, will be set based on environment
|