@tagadapay/plugin-sdk 3.1.2 → 3.1.8
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 +113 -113
- package/dist/external-tracker.js +1104 -491
- package/dist/external-tracker.min.js +2 -2
- package/dist/external-tracker.min.js.map +4 -4
- package/dist/react/hooks/useApplePay.js +25 -36
- package/dist/react/hooks/usePaymentPolling.d.ts +9 -3
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/react/utils/money.d.ts +4 -3
- package/dist/react/utils/money.js +39 -6
- package/dist/react/utils/trackingUtils.js +1 -0
- package/dist/v2/core/client.js +34 -2
- package/dist/v2/core/config/environment.js +9 -2
- package/dist/v2/core/funnelClient.d.ts +92 -1
- package/dist/v2/core/funnelClient.js +247 -3
- package/dist/v2/core/resources/apiClient.js +1 -1
- package/dist/v2/core/resources/checkout.d.ts +68 -0
- package/dist/v2/core/resources/funnel.d.ts +15 -0
- package/dist/v2/core/resources/payments.d.ts +50 -3
- package/dist/v2/core/resources/payments.js +38 -7
- package/dist/v2/core/utils/pluginConfig.js +40 -5
- package/dist/v2/core/utils/previewMode.d.ts +3 -0
- package/dist/v2/core/utils/previewMode.js +44 -14
- package/dist/v2/core/utils/previewModeIndicator.d.ts +19 -0
- package/dist/v2/core/utils/previewModeIndicator.js +414 -0
- package/dist/v2/core/utils/tokenStorage.d.ts +4 -0
- package/dist/v2/core/utils/tokenStorage.js +15 -1
- package/dist/v2/index.d.ts +6 -1
- package/dist/v2/index.js +6 -1
- package/dist/v2/react/components/ApplePayButton.d.ts +21 -121
- package/dist/v2/react/components/ApplePayButton.js +221 -290
- package/dist/v2/react/components/FunnelScriptInjector.d.ts +3 -1
- package/dist/v2/react/components/FunnelScriptInjector.js +128 -24
- package/dist/v2/react/components/PreviewModeIndicator.d.ts +46 -0
- package/dist/v2/react/components/PreviewModeIndicator.js +113 -0
- package/dist/v2/react/hooks/useApplePayCheckout.d.ts +16 -0
- package/dist/v2/react/hooks/useApplePayCheckout.js +193 -0
- package/dist/v2/react/hooks/useFunnel.d.ts +42 -6
- package/dist/v2/react/hooks/useFunnel.js +25 -5
- package/dist/v2/react/hooks/usePaymentPolling.d.ts +9 -3
- package/dist/v2/react/hooks/usePaymentPolling.js +31 -9
- package/dist/v2/react/hooks/usePaymentQuery.d.ts +32 -2
- package/dist/v2/react/hooks/usePaymentQuery.js +304 -7
- package/dist/v2/react/hooks/usePaymentRetrieve.d.ts +26 -0
- package/dist/v2/react/hooks/usePaymentRetrieve.js +175 -0
- package/dist/v2/react/hooks/useStepConfig.d.ts +62 -0
- package/dist/v2/react/hooks/useStepConfig.js +52 -0
- package/dist/v2/react/index.d.ts +9 -3
- package/dist/v2/react/index.js +5 -1
- package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +27 -19
- package/dist/v2/react/providers/TagadaProvider.js +7 -7
- package/dist/v2/standalone/external-tracker.d.ts +2 -0
- package/dist/v2/standalone/external-tracker.js +6 -3
- package/package.json +112 -112
- package/dist/v2/react/hooks/useApplePay.d.ts +0 -16
- package/dist/v2/react/hooks/useApplePay.js +0 -247
package/dist/v2/index.js
CHANGED
|
@@ -13,8 +13,13 @@ export * from './core/utils/pluginConfig';
|
|
|
13
13
|
export * from './core/utils/products';
|
|
14
14
|
export * from './core/utils/previewMode';
|
|
15
15
|
export * from './core/utils/configHotReload';
|
|
16
|
+
export { injectPreviewModeIndicator, removePreviewModeIndicator, isIndicatorInjected } from './core/utils/previewModeIndicator';
|
|
17
|
+
// Step config utilities (for reading runtime configuration from HTML)
|
|
18
|
+
export { getAssignedStepConfig, getAssignedPaymentFlowId, getAssignedStaticResources, getAssignedScripts,
|
|
19
|
+
// Local development helpers
|
|
20
|
+
loadLocalFunnelConfig, getLocalFunnelConfig, } from './core/funnelClient';
|
|
16
21
|
// Path remapping helpers (framework-agnostic)
|
|
17
22
|
export * from './core/pathRemapping';
|
|
18
23
|
export { FunnelActionType } from './core/resources/funnel';
|
|
19
24
|
// React exports (hooks and components only, types are exported above)
|
|
20
|
-
export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCredits, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useFunnelLegacy, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffer, useOrder, useOrderBump, usePayment, usePluginConfig, usePostPurchases, usePreloadQuery, usePreviewOffer, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
|
|
25
|
+
export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, PreviewModeIndicator, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useApplePayCheckout, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCredits, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useFunnelLegacy, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffer, useOrder, useOrderBump, usePayment, usePaymentRetrieve, usePluginConfig, usePostPurchases, usePreloadQuery, usePreviewOffer, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStepConfig, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
|
|
@@ -1,141 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Apple Pay Button Component for v2 Architecture
|
|
3
|
-
*
|
|
3
|
+
* Clean rewrite based on working CMS implementation
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { CheckoutData } from '../../core/resources/checkout';
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
ApplePaySession: typeof ApplePaySession;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
7
12
|
declare class ApplePaySession {
|
|
8
13
|
static canMakePayments(): boolean;
|
|
9
14
|
static canMakePaymentsWithActiveCard(merchantId: string): Promise<boolean>;
|
|
10
15
|
static STATUS_SUCCESS: number;
|
|
11
16
|
static STATUS_FAILURE: number;
|
|
12
|
-
|
|
13
|
-
static STATUS_INVALID_SHIPPING_POSTAL_ADDRESS: number;
|
|
14
|
-
static STATUS_INVALID_SHIPPING_CONTACT: number;
|
|
15
|
-
static STATUS_PIN_REQUIRED: number;
|
|
16
|
-
static STATUS_PIN_INCORRECT: number;
|
|
17
|
-
static STATUS_PIN_LOCKOUT: number;
|
|
18
|
-
constructor(version: number, paymentRequest: ApplePayPaymentRequest);
|
|
17
|
+
constructor(version: number, request: any);
|
|
19
18
|
begin(): void;
|
|
20
19
|
abort(): void;
|
|
21
20
|
completeMerchantValidation(merchantSession: any): void;
|
|
22
|
-
completePayment(
|
|
23
|
-
completeShippingContactSelection(
|
|
24
|
-
completeShippingMethodSelection(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
oncancel: ((event: Event) => void) | null;
|
|
32
|
-
}
|
|
33
|
-
interface ApplePayPaymentRequest {
|
|
34
|
-
countryCode: string;
|
|
35
|
-
currencyCode: string;
|
|
36
|
-
supportedNetworks: string[];
|
|
37
|
-
merchantCapabilities: string[];
|
|
38
|
-
total: ApplePayLineItem;
|
|
39
|
-
lineItems?: ApplePayLineItem[];
|
|
40
|
-
shippingType?: 'shipping' | 'delivery' | 'storePickup' | 'servicePickup';
|
|
41
|
-
shippingMethods?: ApplePayShippingMethod[];
|
|
42
|
-
requiredBillingContactFields?: string[];
|
|
43
|
-
requiredShippingContactFields?: string[];
|
|
44
|
-
applicationData?: string;
|
|
45
|
-
}
|
|
46
|
-
interface ApplePayLineItem {
|
|
47
|
-
label: string;
|
|
48
|
-
amount: string;
|
|
49
|
-
type?: 'final' | 'pending';
|
|
50
|
-
}
|
|
51
|
-
interface ApplePayShippingMethod {
|
|
52
|
-
label: string;
|
|
53
|
-
amount: string;
|
|
54
|
-
detail?: string;
|
|
55
|
-
identifier: string;
|
|
56
|
-
}
|
|
57
|
-
interface ApplePayPaymentToken {
|
|
58
|
-
paymentData: any;
|
|
59
|
-
paymentMethod: {
|
|
60
|
-
displayName: string;
|
|
61
|
-
network: string;
|
|
62
|
-
type: string;
|
|
63
|
-
paymentPass: any;
|
|
64
|
-
billingContact?: ApplePayPaymentContact;
|
|
65
|
-
};
|
|
66
|
-
transactionIdentifier: string;
|
|
67
|
-
}
|
|
68
|
-
interface ApplePayPaymentContact {
|
|
69
|
-
phoneNumber?: string;
|
|
70
|
-
emailAddress?: string;
|
|
71
|
-
givenName?: string;
|
|
72
|
-
familyName?: string;
|
|
73
|
-
phoneticGivenName?: string;
|
|
74
|
-
phoneticFamilyName?: string;
|
|
75
|
-
addressLines?: string[];
|
|
76
|
-
locality?: string;
|
|
77
|
-
administrativeArea?: string;
|
|
78
|
-
postalCode?: string;
|
|
79
|
-
countryCode?: string;
|
|
80
|
-
}
|
|
81
|
-
interface ApplePayValidateMerchantEvent {
|
|
82
|
-
validationURL: string;
|
|
83
|
-
}
|
|
84
|
-
interface ApplePayPaymentAuthorizedEvent {
|
|
85
|
-
payment: {
|
|
86
|
-
token: ApplePayPaymentToken;
|
|
87
|
-
billingContact?: ApplePayPaymentContact;
|
|
88
|
-
shippingContact?: ApplePayPaymentContact;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
interface ApplePayShippingContactSelectionEvent {
|
|
92
|
-
shippingContact: ApplePayPaymentContact;
|
|
93
|
-
}
|
|
94
|
-
interface ApplePayShippingMethodSelectionEvent {
|
|
95
|
-
shippingMethod: ApplePayShippingMethod;
|
|
96
|
-
}
|
|
97
|
-
interface ApplePayPaymentMethodSelectionEvent {
|
|
98
|
-
paymentMethod: any;
|
|
99
|
-
}
|
|
100
|
-
interface ApplePayPaymentAuthorizationResult {
|
|
101
|
-
status: number;
|
|
102
|
-
errors?: ApplePayError[];
|
|
103
|
-
}
|
|
104
|
-
interface ApplePayShippingContactUpdate {
|
|
105
|
-
errors?: ApplePayError[];
|
|
106
|
-
newShippingMethods?: ApplePayShippingMethod[];
|
|
107
|
-
newTotal?: ApplePayLineItem;
|
|
108
|
-
newLineItems?: ApplePayLineItem[];
|
|
109
|
-
}
|
|
110
|
-
interface ApplePayShippingMethodUpdate {
|
|
111
|
-
newTotal?: ApplePayLineItem;
|
|
112
|
-
newLineItems?: ApplePayLineItem[];
|
|
113
|
-
}
|
|
114
|
-
interface ApplePayPaymentMethodUpdate {
|
|
115
|
-
newTotal?: ApplePayLineItem;
|
|
116
|
-
newLineItems?: ApplePayLineItem[];
|
|
117
|
-
}
|
|
118
|
-
interface ApplePayError {
|
|
119
|
-
code: string;
|
|
120
|
-
message: string;
|
|
121
|
-
contactField?: string;
|
|
122
|
-
}
|
|
123
|
-
declare global {
|
|
124
|
-
interface Window {
|
|
125
|
-
ApplePaySession: typeof ApplePaySession;
|
|
126
|
-
}
|
|
21
|
+
completePayment(status: number): void;
|
|
22
|
+
completeShippingContactSelection(status: number, shippingMethods: any[], total: any, lineItems: any[]): void;
|
|
23
|
+
completeShippingMethodSelection(status: number, total: any, lineItems: any[]): void;
|
|
24
|
+
onvalidatemerchant: ((event: any) => void) | null;
|
|
25
|
+
onpaymentauthorized: ((event: any) => void) | null;
|
|
26
|
+
onshippingcontactselected: ((event: any) => void) | null;
|
|
27
|
+
onshippingmethodselected: ((event: any) => void) | null;
|
|
28
|
+
oncancel: (() => void) | null;
|
|
29
|
+
onerror: ((event: any) => void) | null;
|
|
127
30
|
}
|
|
128
31
|
export interface ApplePayButtonProps {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
32
|
+
checkout: CheckoutData;
|
|
33
|
+
onSuccess?: (result: {
|
|
34
|
+
payment: any;
|
|
35
|
+
order: any;
|
|
36
|
+
}) => void;
|
|
132
37
|
onError?: (error: string) => void;
|
|
133
38
|
onCancel?: () => void;
|
|
134
|
-
storeName?: string;
|
|
135
|
-
currencyCode?: string;
|
|
136
|
-
variant?: 'default' | 'outline' | 'ghost';
|
|
137
|
-
size?: 'sm' | 'md' | 'lg';
|
|
138
|
-
checkout: CheckoutData;
|
|
139
39
|
}
|
|
140
40
|
export declare const ApplePayButton: React.FC<ApplePayButtonProps>;
|
|
141
41
|
export default ApplePayButton;
|