@primer-io/primer-js 1.0.8 → 1.1.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/CHANGELOG.md +18 -0
- package/dist/custom-elements.json +2068 -3955
- package/dist/jsx/index.d.ts +126 -186
- package/dist/primer-loader.d.ts +301 -522
- package/dist/primer-loader.js +46 -12
- package/dist/vscode.html-custom-data.json +64 -136
- package/dist/web-types.json +169 -411
- package/package.json +1 -1
- package/src/controllers/reactive-state/README.md +0 -210
package/dist/primer-loader.d.ts
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
|
+
import { ContextProvider } from '@lit/context';
|
|
1
2
|
import { Task, initialState } from '@lit/task';
|
|
2
3
|
import { CSSResult, LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, SVGTemplateResult, TemplateResult, nothing } from 'lit';
|
|
3
4
|
|
|
4
|
-
export type CardNetwork = {
|
|
5
|
-
displayName: string;
|
|
6
|
-
network: string;
|
|
7
|
-
};
|
|
8
|
-
export type CardNetworksContextType = {
|
|
9
|
-
detectedCardNetwork: CardNetwork | null;
|
|
10
|
-
selectableCardNetworks: CardNetwork[];
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
} | null;
|
|
13
|
-
/**
|
|
14
|
-
* SDK state representation
|
|
15
|
-
*/
|
|
16
|
-
export type SdkState = {
|
|
17
|
-
isSuccessful: boolean;
|
|
18
|
-
isProcessing: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* SDK/component initialization errors.
|
|
21
|
-
* This represents errors from the Primer JS layer itself (e.g., configuration errors,
|
|
22
|
-
* component initialization failures), not payment processing errors.
|
|
23
|
-
*/
|
|
24
|
-
primerJsError: Error | null;
|
|
25
|
-
isLoading: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Payment processing failure information.
|
|
28
|
-
* Contains structured error details from failed payment attempts.
|
|
29
|
-
* Includes error code, message, diagnostics ID, and additional metadata.
|
|
30
|
-
*/
|
|
31
|
-
paymentFailure: {
|
|
32
|
-
code: string;
|
|
33
|
-
message: string;
|
|
34
|
-
diagnosticsId?: string | null;
|
|
35
|
-
data?: Record<string, unknown>;
|
|
36
|
-
} | null;
|
|
37
|
-
};
|
|
38
|
-
export type SdkStateContextType = SdkState | null;
|
|
39
5
|
declare const PaymentInstrumentType: {
|
|
40
6
|
readonly WORLDPAY_IDEAL: "WORLDPAY_IDEAL";
|
|
41
7
|
readonly AUTOMATED_CLEARING_HOUSE: "AUTOMATED_CLEARING_HOUSE";
|
|
@@ -604,6 +570,7 @@ declare enum HeadlessManagerType {
|
|
|
604
570
|
NATIVE = "NATIVE",
|
|
605
571
|
REDIRECT = "REDIRECT",
|
|
606
572
|
KLARNA = "KLARNA",
|
|
573
|
+
ADYEN_KLARNA = "ADYEN_KLARNA",
|
|
607
574
|
ACH = "ACH",
|
|
608
575
|
BLIK = "BLIK"
|
|
609
576
|
}
|
|
@@ -1082,6 +1049,33 @@ export interface IBlikPaymentMethodManager {
|
|
|
1082
1049
|
blikCode: string;
|
|
1083
1050
|
}): Promise<void>;
|
|
1084
1051
|
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Adyen Klarna payment option
|
|
1054
|
+
*/
|
|
1055
|
+
export interface AdyenKlarnaPaymentOption {
|
|
1056
|
+
id: string;
|
|
1057
|
+
label: string;
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Adyen Klarna Payment Method Manager
|
|
1061
|
+
*
|
|
1062
|
+
* Unlike direct Klarna integration, Adyen Klarna uses a redirect flow
|
|
1063
|
+
* with payment type selection (Pay Now, Pay Later, etc.)
|
|
1064
|
+
*/
|
|
1065
|
+
export interface IAdyenKlarnaPaymentMethodManager {
|
|
1066
|
+
/**
|
|
1067
|
+
* Get available payment options
|
|
1068
|
+
*/
|
|
1069
|
+
getPaymentOptions(): AdyenKlarnaPaymentOption[];
|
|
1070
|
+
/**
|
|
1071
|
+
* Select a payment option
|
|
1072
|
+
*/
|
|
1073
|
+
selectOption(optionId: string): void;
|
|
1074
|
+
/**
|
|
1075
|
+
* Start the payment flow with the selected option
|
|
1076
|
+
*/
|
|
1077
|
+
start(): Promise<void>;
|
|
1078
|
+
}
|
|
1085
1079
|
export interface HeadlessVaultManager {
|
|
1086
1080
|
fetchVaultedPaymentMethods(): Promise<VaultedPaymentMethod[]>;
|
|
1087
1081
|
deleteVaultedPaymentMethod(id: string): Promise<void>;
|
|
@@ -1163,7 +1157,10 @@ export interface KlarnaPaymentMethodManagerOptions {
|
|
|
1163
1157
|
export interface AchPaymentMethodManagerOptions {
|
|
1164
1158
|
onCollectBankAccountDetailsComplete?: () => void;
|
|
1165
1159
|
}
|
|
1166
|
-
export
|
|
1160
|
+
export interface AdyenKlarnaPaymentMethodManagerOptions {
|
|
1161
|
+
onPaymentOptionsChange?: (options: AdyenKlarnaPaymentOption[]) => void;
|
|
1162
|
+
}
|
|
1163
|
+
export type PaymentMethodManagerOptions = CardPaymentMethodManagerOptions | KlarnaPaymentMethodManagerOptions | AdyenKlarnaPaymentMethodManagerOptions | AchPaymentMethodManagerOptions;
|
|
1167
1164
|
export interface CheckoutStyle {
|
|
1168
1165
|
fontFaces?: Array<{
|
|
1169
1166
|
fontFamily?: string;
|
|
@@ -1230,6 +1227,7 @@ export interface PrimerHeadlessCheckout {
|
|
|
1230
1227
|
createPaymentMethodManager(type: "PAYPAL" | "GOOGLE_PAY" | "APPLE_PAY", options?: PaymentMethodManagerOptions): Promise<INativePaymentMethodManager | null>;
|
|
1231
1228
|
createPaymentMethodManager(type: "STRIPE_ACH", options?: AchPaymentMethodManagerOptions): Promise<IAchPaymentMethodManager | null>;
|
|
1232
1229
|
createPaymentMethodManager(type: "KLARNA", options?: PaymentMethodManagerOptions): Promise<IKlarnaPaymentMethodManager | null>;
|
|
1230
|
+
createPaymentMethodManager(type: "ADYEN_KLARNA", options?: AdyenKlarnaPaymentMethodManagerOptions): Promise<IAdyenKlarnaPaymentMethodManager | null>;
|
|
1233
1231
|
createPaymentMethodManager(type: PaymentMethodType, options?: PaymentMethodManagerOptions): Promise<IRedirectPaymentMethodManager | null>;
|
|
1234
1232
|
createVaultManager(): HeadlessVaultManager;
|
|
1235
1233
|
getSDKUtilities(): HeadlessSDKUtilities;
|
|
@@ -1451,6 +1449,38 @@ export interface PrimerCheckoutOptions {
|
|
|
1451
1449
|
* @default window.location.hostname
|
|
1452
1450
|
*/
|
|
1453
1451
|
merchantDomain?: string;
|
|
1452
|
+
/**
|
|
1453
|
+
* Configuration for redirect-based payment methods.
|
|
1454
|
+
*
|
|
1455
|
+
* Controls the return URL behavior for payment methods that require a redirect
|
|
1456
|
+
* to an external page (e.g. PayPal, Klarna, and most APMs), whether to force
|
|
1457
|
+
* a full-page redirect instead of opening the flow in a popup where supported,
|
|
1458
|
+
* and how to handle users closing the redirect popup.
|
|
1459
|
+
*
|
|
1460
|
+
* @example
|
|
1461
|
+
* ```typescript
|
|
1462
|
+
* redirect: {
|
|
1463
|
+
* returnUrl: 'https://merchant.example.com/checkout/return',
|
|
1464
|
+
* forceRedirect: true,
|
|
1465
|
+
* }
|
|
1466
|
+
* ```
|
|
1467
|
+
*/
|
|
1468
|
+
redirect?: {
|
|
1469
|
+
/**
|
|
1470
|
+
* URL the payment method redirects back to after the customer completes
|
|
1471
|
+
* (or cancels) the flow on the external page.
|
|
1472
|
+
*
|
|
1473
|
+
* If omitted, the SDK uses the current page URL.
|
|
1474
|
+
*/
|
|
1475
|
+
returnUrl?: string;
|
|
1476
|
+
/**
|
|
1477
|
+
* Whether to force a full-page redirect for payment methods that would
|
|
1478
|
+
* otherwise open in a popup.
|
|
1479
|
+
*
|
|
1480
|
+
* @default false
|
|
1481
|
+
*/
|
|
1482
|
+
forceRedirect?: boolean;
|
|
1483
|
+
};
|
|
1454
1484
|
/**
|
|
1455
1485
|
* Configuration for card payment method options.
|
|
1456
1486
|
* Controls the display and validation of card form fields.
|
|
@@ -1640,6 +1670,11 @@ export interface PrimerCheckoutOptions {
|
|
|
1640
1670
|
* ```
|
|
1641
1671
|
*/
|
|
1642
1672
|
klarna?: KlarnaOptions;
|
|
1673
|
+
adyenKlarna?: {
|
|
1674
|
+
buttonOptions?: {
|
|
1675
|
+
text?: string;
|
|
1676
|
+
};
|
|
1677
|
+
};
|
|
1643
1678
|
/**
|
|
1644
1679
|
* Configuration for payment method vaulting (save for later use).
|
|
1645
1680
|
*
|
|
@@ -1861,35 +1896,10 @@ export interface PrimerCheckoutOptions {
|
|
|
1861
1896
|
*/
|
|
1862
1897
|
enabledPaymentMethods?: typeof PaymentMethodType.PAYMENT_CARD | typeof PaymentMethodType.PAYPAL | (typeof PaymentMethodType.ADYEN_BLIK)[];
|
|
1863
1898
|
}
|
|
1864
|
-
export type InitializedManager = {
|
|
1865
|
-
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
1866
|
-
manager: IAchPaymentMethodManager;
|
|
1867
|
-
} | {
|
|
1868
|
-
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
1869
|
-
manager: ICardPaymentMethodManager;
|
|
1870
|
-
} | {
|
|
1871
|
-
type: typeof PaymentMethodType.KLARNA;
|
|
1872
|
-
manager: IKlarnaPaymentMethodManager;
|
|
1873
|
-
} | {
|
|
1874
|
-
type: RedirectPaymentMethodTypes;
|
|
1875
|
-
manager: IRedirectPaymentMethodManager;
|
|
1876
|
-
} | {
|
|
1877
|
-
type: typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
1878
|
-
manager: INativePaymentMethodManager;
|
|
1879
|
-
} | {
|
|
1880
|
-
type: typeof PaymentMethodType.ADYEN_BLIK;
|
|
1881
|
-
manager: IBlikPaymentMethodManager;
|
|
1882
|
-
};
|
|
1883
1899
|
/**
|
|
1884
1900
|
* Native payment method types (sent with managerType: 'NATIVE' from server)
|
|
1885
1901
|
*/
|
|
1886
1902
|
export type NativePaymentMethodTypes = typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY | typeof PaymentMethodType.ADYEN_BLIK;
|
|
1887
|
-
export type ManagerByType<T extends PaymentMethodType> = Extract<InitializedManager, {
|
|
1888
|
-
type: T;
|
|
1889
|
-
}>;
|
|
1890
|
-
export interface InitializedManagersMap extends Map<PaymentMethodType, InitializedManager> {
|
|
1891
|
-
get<T extends PaymentMethodType>(key: T): ManagerByType<T> | undefined;
|
|
1892
|
-
}
|
|
1893
1903
|
/**
|
|
1894
1904
|
* Payment methods that use the REDIRECT manager type.
|
|
1895
1905
|
*
|
|
@@ -1897,13 +1907,13 @@ export interface InitializedManagersMap extends Map<PaymentMethodType, Initializ
|
|
|
1897
1907
|
* - STRIPE_ACH: Uses ACH manager
|
|
1898
1908
|
* - PAYMENT_CARD: Uses CARD manager
|
|
1899
1909
|
* - KLARNA: Uses KLARNA manager
|
|
1910
|
+
* - ADYEN_KLARNA: Uses ADYEN_KLARNA manager
|
|
1900
1911
|
* - PAYPAL, GOOGLE_PAY, APPLE_PAY: Use NATIVE manager
|
|
1901
1912
|
* - ADYEN_BLIK: Uses BLIK manager
|
|
1902
1913
|
*
|
|
1903
1914
|
* All other payment methods use the REDIRECT manager by default.
|
|
1904
1915
|
*/
|
|
1905
|
-
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType, typeof PaymentMethodType.STRIPE_ACH | typeof PaymentMethodType.PAYMENT_CARD | typeof PaymentMethodType.KLARNA | typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY | typeof PaymentMethodType.ADYEN_BLIK>;
|
|
1906
|
-
export type DynamicPaymentMethodTypes = typeof PaymentMethodType.STRIPE_ACH;
|
|
1916
|
+
export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType, typeof PaymentMethodType.STRIPE_ACH | typeof PaymentMethodType.PAYMENT_CARD | typeof PaymentMethodType.KLARNA | typeof PaymentMethodType.ADYEN_KLARNA | typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY | typeof PaymentMethodType.ADYEN_BLIK>;
|
|
1907
1917
|
/**
|
|
1908
1918
|
* Represents a payment method that uses the REDIRECT manager.
|
|
1909
1919
|
*
|
|
@@ -1912,51 +1922,43 @@ export type DynamicPaymentMethodTypes = typeof PaymentMethodType.STRIPE_ACH;
|
|
|
1912
1922
|
* use custom inline UI components while still being classified as REDIRECT type
|
|
1913
1923
|
* due to their flow characteristics (status polling, external authorization).
|
|
1914
1924
|
*/
|
|
1915
|
-
export
|
|
1925
|
+
export interface RedirectPaymentMethod {
|
|
1916
1926
|
type: RedirectPaymentMethodTypes;
|
|
1917
1927
|
managerType: HeadlessManagerType.REDIRECT;
|
|
1918
|
-
|
|
1928
|
+
manager: IRedirectPaymentMethodManager;
|
|
1929
|
+
}
|
|
1930
|
+
export interface NativePaymentMethod {
|
|
1931
|
+
type: typeof PaymentMethodType.PAYPAL | typeof PaymentMethodType.GOOGLE_PAY | typeof PaymentMethodType.APPLE_PAY;
|
|
1932
|
+
managerType: HeadlessManagerType.NATIVE;
|
|
1933
|
+
manager: INativePaymentMethodManager;
|
|
1934
|
+
}
|
|
1935
|
+
export interface BlikPaymentMethod {
|
|
1936
|
+
type: typeof PaymentMethodType.ADYEN_BLIK;
|
|
1937
|
+
managerType: HeadlessManagerType.BLIK;
|
|
1938
|
+
manager: IBlikPaymentMethodManager;
|
|
1939
|
+
}
|
|
1919
1940
|
export type InitializedPaymentMethod = {
|
|
1920
1941
|
type: typeof PaymentMethodType.STRIPE_ACH;
|
|
1921
1942
|
managerType: HeadlessManagerType.ACH;
|
|
1943
|
+
manager: IAchPaymentMethodManager;
|
|
1922
1944
|
} | {
|
|
1923
1945
|
type: typeof PaymentMethodType.PAYMENT_CARD;
|
|
1924
1946
|
managerType: HeadlessManagerType.CARD;
|
|
1947
|
+
manager: ICardPaymentMethodManager;
|
|
1925
1948
|
} | {
|
|
1926
1949
|
type: typeof PaymentMethodType.KLARNA;
|
|
1927
1950
|
managerType: HeadlessManagerType.KLARNA;
|
|
1951
|
+
manager: IKlarnaPaymentMethodManager;
|
|
1928
1952
|
} | {
|
|
1929
|
-
type: typeof PaymentMethodType.
|
|
1930
|
-
managerType: HeadlessManagerType.
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
managerType: HeadlessManagerType.NATIVE;
|
|
1934
|
-
} | {
|
|
1935
|
-
type: typeof PaymentMethodType.APPLE_PAY;
|
|
1936
|
-
managerType: HeadlessManagerType.NATIVE;
|
|
1937
|
-
} | {
|
|
1938
|
-
type: typeof PaymentMethodType.ADYEN_BLIK;
|
|
1939
|
-
managerType: HeadlessManagerType.BLIK;
|
|
1940
|
-
} | RedirectPaymentMethod;
|
|
1941
|
-
export type PaymentMethodByType<T extends PaymentMethodType> = Extract<InitializedPaymentMethod, {
|
|
1942
|
-
type: T;
|
|
1943
|
-
}>;
|
|
1944
|
-
export interface InitializedPaymentMethodMap extends Map<PaymentMethodType, InitializedPaymentMethod> {
|
|
1945
|
-
get<T extends PaymentMethodType>(key: T): PaymentMethodByType<T> | undefined;
|
|
1946
|
-
}
|
|
1953
|
+
type: typeof PaymentMethodType.ADYEN_KLARNA;
|
|
1954
|
+
managerType: HeadlessManagerType.ADYEN_KLARNA;
|
|
1955
|
+
manager: IAdyenKlarnaPaymentMethodManager;
|
|
1956
|
+
} | BlikPaymentMethod | RedirectPaymentMethod | NativePaymentMethod;
|
|
1947
1957
|
export interface AssetsConfig {
|
|
1948
1958
|
backgroundColor: string;
|
|
1949
1959
|
name: string;
|
|
1950
1960
|
iconUrl: string;
|
|
1951
1961
|
}
|
|
1952
|
-
export type AnalyticsContextType = AnalyticsUtils | null;
|
|
1953
|
-
export type EventsContextType = PrimerEventsController | null;
|
|
1954
|
-
export type HeadlessUtilsContextType = HeadlessSDKUtilities | null;
|
|
1955
|
-
export type ConfigurationContextType = ClientConfiguration | null;
|
|
1956
|
-
export type KlarnaCategoriesContextType = {
|
|
1957
|
-
categories: KlarnaPaymentMethodCategory[];
|
|
1958
|
-
isLoading: boolean;
|
|
1959
|
-
};
|
|
1960
1962
|
/**
|
|
1961
1963
|
* Options for initializing the Vault Manager
|
|
1962
1964
|
*/
|
|
@@ -1995,142 +1997,88 @@ export interface VaultManagerItemState {
|
|
|
1995
1997
|
selectedVaultedPaymentMethod: VaultedPaymentMethod | null;
|
|
1996
1998
|
setSelectedVaultedPaymentMethod: (paymentMethod: VaultedPaymentMethod | null) => void;
|
|
1997
1999
|
}
|
|
2000
|
+
export type KlarnaCategoriesContextType = {
|
|
2001
|
+
categories: KlarnaPaymentMethodCategory[];
|
|
2002
|
+
isLoading: boolean;
|
|
2003
|
+
};
|
|
2004
|
+
export type AdyenKlarnaOptionsContextType = {
|
|
2005
|
+
options: AdyenKlarnaPaymentOption[];
|
|
2006
|
+
isLoading: boolean;
|
|
2007
|
+
};
|
|
2008
|
+
export type CardNetwork = {
|
|
2009
|
+
displayName: string;
|
|
2010
|
+
network: string;
|
|
2011
|
+
};
|
|
2012
|
+
export type CardNetworksContextType = {
|
|
2013
|
+
detectedCardNetwork: CardNetwork | null;
|
|
2014
|
+
selectableCardNetworks: CardNetwork[];
|
|
2015
|
+
isLoading: boolean;
|
|
2016
|
+
} | null;
|
|
1998
2017
|
/**
|
|
1999
|
-
*
|
|
2000
|
-
* Contains properties that don't change frequently and relate to vault functionality
|
|
2001
|
-
*/
|
|
2002
|
-
export type VaultManagerContextType = VaultManagerState | null;
|
|
2003
|
-
/**
|
|
2004
|
-
* Context for vault manager CVV-specific state
|
|
2005
|
-
* Contains properties specifically related to CVV input functionality
|
|
2006
|
-
* Further separated to minimize re-renders related to frequently changing CVV input state
|
|
2018
|
+
* SDK state representation
|
|
2007
2019
|
*/
|
|
2008
|
-
export type
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
private sdkStateProvider;
|
|
2012
|
-
private paymentMethodsProvider;
|
|
2013
|
-
private paymentManagerProvider;
|
|
2014
|
-
private cardNetworksContext;
|
|
2015
|
-
private vaultManagerProvider;
|
|
2016
|
-
private vaultManagerCvvProvider;
|
|
2017
|
-
private clientOptionsContext;
|
|
2018
|
-
private headlessUtilsProvider;
|
|
2019
|
-
private configurationProvider;
|
|
2020
|
-
private klarnaCategoriesProvider;
|
|
2021
|
-
private computedStylesProvider;
|
|
2022
|
-
private analyticsProvider;
|
|
2023
|
-
private eventsProvider;
|
|
2024
|
-
constructor(host: PrimerCheckoutType);
|
|
2025
|
-
hostConnected(): void;
|
|
2020
|
+
export type SdkState = {
|
|
2021
|
+
isSuccessful: boolean;
|
|
2022
|
+
isProcessing: boolean;
|
|
2026
2023
|
/**
|
|
2027
|
-
*
|
|
2028
|
-
*
|
|
2024
|
+
* SDK/component initialization errors.
|
|
2025
|
+
* This represents errors from the Primer JS layer itself (e.g., configuration errors,
|
|
2026
|
+
* component initialization failures), not payment processing errors.
|
|
2029
2027
|
*/
|
|
2030
|
-
|
|
2028
|
+
primerJsError: Error | null;
|
|
2029
|
+
isLoading: boolean;
|
|
2031
2030
|
/**
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2031
|
+
* Payment processing failure information.
|
|
2032
|
+
* Contains structured error details from failed payment attempts.
|
|
2033
|
+
* Includes error code, message, diagnostics ID, and additional metadata.
|
|
2034
2034
|
*/
|
|
2035
|
-
|
|
2035
|
+
paymentFailure: {
|
|
2036
|
+
code: string;
|
|
2037
|
+
message: string;
|
|
2038
|
+
diagnosticsId?: string | null;
|
|
2039
|
+
data?: Record<string, unknown>;
|
|
2040
|
+
} | null;
|
|
2041
|
+
};
|
|
2042
|
+
export type ContextType = {
|
|
2043
|
+
analytics?: AnalyticsUtils;
|
|
2044
|
+
configuration?: ClientConfiguration;
|
|
2045
|
+
computedStyles?: CSSStyleDeclaration | null;
|
|
2046
|
+
klarnaCategories: KlarnaCategoriesContextType;
|
|
2047
|
+
adyenKlarnaOptions?: AdyenKlarnaOptionsContextType;
|
|
2048
|
+
cardNetworks?: CardNetworksContextType;
|
|
2049
|
+
events?: PrimerEventsController;
|
|
2050
|
+
clientOptions?: PrimerCheckoutOptions;
|
|
2051
|
+
paymentMethods: InitializedPaymentMethod[];
|
|
2052
|
+
headlessUtils?: HeadlessSDKUtilities;
|
|
2053
|
+
sdkState: SdkState;
|
|
2054
|
+
vaultManager?: VaultManagerState;
|
|
2055
|
+
vaultItem?: VaultManagerItemState;
|
|
2056
|
+
};
|
|
2057
|
+
declare class SDKContextController implements ReactiveController {
|
|
2058
|
+
host: PrimerCheckoutType;
|
|
2059
|
+
contextProvider: ContextProvider<{
|
|
2060
|
+
__context__: ContextType;
|
|
2061
|
+
}>;
|
|
2062
|
+
constructor(host: PrimerCheckoutType);
|
|
2063
|
+
hostConnected(): void;
|
|
2036
2064
|
/**
|
|
2037
|
-
* Updates the
|
|
2038
|
-
* @param value The new payment manager mapping.
|
|
2065
|
+
* Updates the main SDK context by merging new values into the existing context.
|
|
2039
2066
|
*/
|
|
2040
|
-
|
|
2067
|
+
setContext(value: Partial<NonNullable<ContextType>>): void;
|
|
2068
|
+
setSdkState(stateUpdate: Partial<SdkState>): void;
|
|
2069
|
+
resetSdkState(): void;
|
|
2041
2070
|
setCardNetworks(value: CardNetworksContextType): void;
|
|
2042
2071
|
setCardNetworksLoadingFalse(): void;
|
|
2043
|
-
setVaultManager(
|
|
2072
|
+
setVaultManager(vaultManager: VaultManagerState): void;
|
|
2044
2073
|
setKlarnaCategories(value: KlarnaCategoriesContextType): void;
|
|
2045
|
-
|
|
2046
|
-
setHeadlessUtils(value: HeadlessUtilsContextType): void;
|
|
2047
|
-
setConfiguration(value: ConfigurationContextType): void;
|
|
2048
|
-
setAnalyticsUtils(value: AnalyticsContextType): void;
|
|
2049
|
-
getAnalyticsUtils(): AnalyticsContextType | undefined;
|
|
2074
|
+
setAdyenKlarnaOptions(value: AdyenKlarnaOptionsContextType): void;
|
|
2050
2075
|
setComputedStyles(value: CSSStyleDeclaration): void;
|
|
2051
|
-
setVaultManagerCvv(
|
|
2076
|
+
setVaultManagerCvv(vaultItem: VaultManagerItemState): void;
|
|
2052
2077
|
/**
|
|
2053
2078
|
* Updates the events context.
|
|
2054
2079
|
* @param value The new events controller.
|
|
2055
2080
|
*/
|
|
2056
|
-
setEventsController(
|
|
2057
|
-
}
|
|
2058
|
-
export type ReducerCallbacks<State, _Action extends {
|
|
2059
|
-
type: string;
|
|
2060
|
-
}> = {
|
|
2061
|
-
[K in keyof State]?: State[K] extends (...args: unknown[]) => unknown ? State[K] : never;
|
|
2062
|
-
};
|
|
2063
|
-
export type TypedReducer<State, Action extends {
|
|
2064
|
-
type: string;
|
|
2065
|
-
}, Callbacks> = (state: State, action: Action, callbacks: Callbacks) => State;
|
|
2066
|
-
declare abstract class ReactiveStateController<Host extends ReactiveControllerHost, State, Action extends {
|
|
2067
|
-
type: string;
|
|
2068
|
-
}, Callbacks = ReducerCallbacks<State, Action> | null> implements ReactiveController {
|
|
2069
|
-
protected host: Host;
|
|
2070
|
-
protected stateHandler: (state: State) => void;
|
|
2071
|
-
private _dispatcher;
|
|
2072
|
-
constructor(host: Host, initialState: State, reducer: TypedReducer<State, Action, Callbacks>, initialCallbacks: Callbacks, stateHandler?: (state: State) => void);
|
|
2073
|
-
get currentState(): Readonly<State>;
|
|
2074
|
-
protected dispatch(action: Action): void;
|
|
2075
|
-
protected setCallbacks(callbacks: Partial<Callbacks>): void;
|
|
2076
|
-
hostConnected(): void;
|
|
2077
|
-
hostDisconnected(): void;
|
|
2078
|
-
}
|
|
2079
|
-
declare class CompositeStateController<Host extends ReactiveControllerHost> implements ReactiveController {
|
|
2080
|
-
protected host: Host;
|
|
2081
|
-
private _controllers;
|
|
2082
|
-
constructor(host: Host);
|
|
2083
|
-
addController<State, Action extends {
|
|
2084
|
-
type: string;
|
|
2085
|
-
}, Callbacks = ReducerCallbacks<State, Action> | null>(controller: ReactiveStateController<Host, State, Action, Callbacks>): void;
|
|
2086
|
-
hostConnected(): void;
|
|
2087
|
-
hostDisconnected(): void;
|
|
2088
|
-
}
|
|
2089
|
-
export type SdkStateAction = {
|
|
2090
|
-
type: "SET_LOADING";
|
|
2091
|
-
payload: boolean;
|
|
2092
|
-
} | {
|
|
2093
|
-
type: "SET_PROCESSING";
|
|
2094
|
-
payload: boolean;
|
|
2095
|
-
} | {
|
|
2096
|
-
type: "SET_SUCCESS";
|
|
2097
|
-
payload: boolean;
|
|
2098
|
-
} | {
|
|
2099
|
-
type: "SET_PRIMER_JS_ERROR";
|
|
2100
|
-
payload: Error | null;
|
|
2101
|
-
} | {
|
|
2102
|
-
type: "SET_PAYMENT_FAILURE";
|
|
2103
|
-
payload: {
|
|
2104
|
-
code: string;
|
|
2105
|
-
message: string;
|
|
2106
|
-
diagnosticsId?: string | null;
|
|
2107
|
-
data?: Record<string, unknown>;
|
|
2108
|
-
} | null;
|
|
2109
|
-
} | {
|
|
2110
|
-
type: "COMPLETE_PROCESSING";
|
|
2111
|
-
} | {
|
|
2112
|
-
type: "RESET";
|
|
2113
|
-
};
|
|
2114
|
-
declare class SdkStateController extends ReactiveStateController<PrimerCheckoutType, SdkState, SdkStateAction, null> {
|
|
2115
|
-
constructor(host: PrimerCheckoutType);
|
|
2116
|
-
setLoading(loading: boolean): void;
|
|
2117
|
-
setProcessing(processing: boolean): void;
|
|
2118
|
-
setSuccess(success: boolean): void;
|
|
2119
|
-
setPrimerJsError(error: Error | null): void;
|
|
2120
|
-
setPaymentFailure(failure: {
|
|
2121
|
-
code: string;
|
|
2122
|
-
message: string;
|
|
2123
|
-
diagnosticsId?: string | null;
|
|
2124
|
-
data?: Record<string, unknown>;
|
|
2125
|
-
} | null): void;
|
|
2126
|
-
completeProcessing(): void;
|
|
2127
|
-
reset(): void;
|
|
2128
|
-
startLoading(): void;
|
|
2129
|
-
completeLoading(): void;
|
|
2130
|
-
startProcessing(): void;
|
|
2131
|
-
stopProcessing(): void;
|
|
2132
|
-
resetError(): void;
|
|
2133
|
-
forceCompleteLoading(): void;
|
|
2081
|
+
setEventsController(events?: PrimerEventsController): void;
|
|
2134
2082
|
}
|
|
2135
2083
|
/**
|
|
2136
2084
|
* PrimerCheckoutType defines the interface for the primer-checkout component implementation.
|
|
@@ -2142,18 +2090,28 @@ export interface PrimerCheckoutType extends ReactiveControllerHost, LitElement {
|
|
|
2142
2090
|
clientToken: string;
|
|
2143
2091
|
options: PrimerCheckoutOptions;
|
|
2144
2092
|
sdkContextController: SDKContextController;
|
|
2145
|
-
sdkStateController: SdkStateController;
|
|
2146
2093
|
primerEventsController: PrimerEventsController;
|
|
2147
2094
|
vaultManagerController: VaultManagerController;
|
|
2148
2095
|
primerJS?: PrimerJS;
|
|
2149
2096
|
}
|
|
2150
|
-
declare class VaultManagerController
|
|
2151
|
-
private
|
|
2152
|
-
private
|
|
2097
|
+
declare class VaultManagerController implements ReactiveController {
|
|
2098
|
+
private host;
|
|
2099
|
+
private _coreState;
|
|
2100
|
+
private _itemState;
|
|
2153
2101
|
private _vaultManager;
|
|
2154
2102
|
private _options;
|
|
2155
2103
|
private createVaultManagerFn;
|
|
2156
2104
|
constructor(host: PrimerCheckoutType);
|
|
2105
|
+
/**
|
|
2106
|
+
* Update core state with deep-equality guard.
|
|
2107
|
+
* Only pushes to context if state actually changed.
|
|
2108
|
+
*/
|
|
2109
|
+
private updateCoreState;
|
|
2110
|
+
/**
|
|
2111
|
+
* Update item state with deep-equality guard.
|
|
2112
|
+
* Only pushes to context if state actually changed.
|
|
2113
|
+
*/
|
|
2114
|
+
private updateItemState;
|
|
2157
2115
|
/**
|
|
2158
2116
|
* Initialize the vault manager with a factory function and options
|
|
2159
2117
|
* @param createVaultManagerFn - Bound function to create vault manager when needed
|
|
@@ -2166,9 +2124,7 @@ declare class VaultManagerController extends CompositeStateController<PrimerChec
|
|
|
2166
2124
|
set options(options: VaultManagerInitOptions | null);
|
|
2167
2125
|
get vaultManagerState(): Readonly<VaultManagerState>;
|
|
2168
2126
|
get vaultItemState(): Readonly<VaultManagerItemState>;
|
|
2169
|
-
|
|
2170
|
-
* Lifecycle method called when the host disconnects
|
|
2171
|
-
*/
|
|
2127
|
+
hostConnected(): void;
|
|
2172
2128
|
hostDisconnected(): void;
|
|
2173
2129
|
/**
|
|
2174
2130
|
* Transform raw vault data into filtered, event-ready format.
|
|
@@ -2317,7 +2273,6 @@ export interface VaultAPI {
|
|
|
2317
2273
|
export declare class PrimerJS {
|
|
2318
2274
|
private headlessInstance;
|
|
2319
2275
|
private paymentMethods;
|
|
2320
|
-
private paymentManagers;
|
|
2321
2276
|
private vaultController;
|
|
2322
2277
|
/**
|
|
2323
2278
|
* Vault namespace providing programmatic access to vaulted payment method operations.
|
|
@@ -2433,11 +2388,6 @@ export declare class PrimerJS {
|
|
|
2433
2388
|
* @internal - This is only used internally by the SDK
|
|
2434
2389
|
*/
|
|
2435
2390
|
setPaymentMethods(methods: InitializedPaymentMethod[]): void;
|
|
2436
|
-
/**
|
|
2437
|
-
* Set the initialized payment managers
|
|
2438
|
-
* @internal - This is only used internally by the SDK
|
|
2439
|
-
*/
|
|
2440
|
-
setPaymentManagers(managers: InitializedManagersMap): void;
|
|
2441
2391
|
/**
|
|
2442
2392
|
* Internal method to set the vault controller reference.
|
|
2443
2393
|
* Called during vault initialization.
|
|
@@ -2536,9 +2486,6 @@ export interface CardSubmitErrorsPayload {
|
|
|
2536
2486
|
export interface CardSubmitPayload {
|
|
2537
2487
|
source?: string;
|
|
2538
2488
|
}
|
|
2539
|
-
export interface PrimeAchErrorPayload {
|
|
2540
|
-
error: Error;
|
|
2541
|
-
}
|
|
2542
2489
|
export interface VaultSubmitPayload {
|
|
2543
2490
|
source?: string;
|
|
2544
2491
|
}
|
|
@@ -2550,7 +2497,7 @@ export interface ShowOtherPaymentsToggledPayload {
|
|
|
2550
2497
|
expanded: boolean;
|
|
2551
2498
|
}
|
|
2552
2499
|
export interface PrimerEvents {
|
|
2553
|
-
"primer:state-change": CustomEvent<
|
|
2500
|
+
"primer:state-change": CustomEvent<SdkState>;
|
|
2554
2501
|
"primer:methods-update": CustomEvent<InitializedPaymentMethod[]>;
|
|
2555
2502
|
"primer:ready": CustomEvent<PrimerJS>;
|
|
2556
2503
|
"primer:card-network-change": CustomEvent<CardNetworksContextType>;
|
|
@@ -2563,10 +2510,6 @@ export interface PrimerEvents {
|
|
|
2563
2510
|
"primer:card-error": CustomEvent<CardSubmitErrorsPayload>;
|
|
2564
2511
|
"primer:dialog-open": CustomEvent;
|
|
2565
2512
|
"primer:dialog-close": CustomEvent;
|
|
2566
|
-
"primer-ach-error": CustomEvent<PrimeAchErrorPayload>;
|
|
2567
|
-
"primer-ach-bank-details-collected": CustomEvent;
|
|
2568
|
-
"primer-ach-mandate-confirmed": CustomEvent;
|
|
2569
|
-
"primer-ach-mandate-declined": CustomEvent;
|
|
2570
2513
|
"primer:payment-start": CustomEvent<{
|
|
2571
2514
|
paymentMethodType: PaymentMethodType;
|
|
2572
2515
|
abortPaymentCreation: () => void;
|
|
@@ -2609,10 +2552,9 @@ export interface PrimerEvents {
|
|
|
2609
2552
|
"primer:show-other-payments-toggle": CustomEvent<ShowOtherPaymentsTogglePayload>;
|
|
2610
2553
|
"primer:show-other-payments-toggled": CustomEvent<ShowOtherPaymentsToggledPayload>;
|
|
2611
2554
|
}
|
|
2612
|
-
declare class PrimerEventsController
|
|
2613
|
-
host:
|
|
2614
|
-
constructor(host:
|
|
2615
|
-
hostConnected(): void;
|
|
2555
|
+
declare class PrimerEventsController {
|
|
2556
|
+
host: LitElement;
|
|
2557
|
+
constructor(host: LitElement);
|
|
2616
2558
|
/**
|
|
2617
2559
|
* Dispatch a custom event using the unified naming pattern.
|
|
2618
2560
|
* Ensures that every event bubbles and crosses shadow DOM boundaries.
|
|
@@ -2621,7 +2563,7 @@ declare class PrimerEventsController implements ReactiveController {
|
|
|
2621
2563
|
* @param detail - The payload for the event.
|
|
2622
2564
|
*/
|
|
2623
2565
|
dispatchEvent<K extends keyof PrimerEvents>(type: K, detail: PrimerEvents[K]["detail"]): void;
|
|
2624
|
-
dispatchSdkState(sdkState:
|
|
2566
|
+
dispatchSdkState(sdkState: SdkState): void;
|
|
2625
2567
|
dispatchPaymentMethods(paymentMethods: InitializedPaymentMethod[]): void;
|
|
2626
2568
|
dispatchCheckoutInitialized(checkoutInstance: PrimerJS): void;
|
|
2627
2569
|
dispatchCardNetworkChange(network: CardNetworksContextType): void;
|
|
@@ -2824,16 +2766,11 @@ declare const targetLocales = [
|
|
|
2824
2766
|
export type LocaleCode = typeof sourceLocale | (typeof targetLocales)[number];
|
|
2825
2767
|
declare class HeadlessSdkController implements ReactiveController {
|
|
2826
2768
|
host: PrimerCheckoutType;
|
|
2827
|
-
private sdkInstanceTask;
|
|
2828
|
-
private createPaymentMethodManager;
|
|
2829
|
-
private _paymentsList;
|
|
2830
2769
|
private currentSdkInstance;
|
|
2831
2770
|
private primerJS;
|
|
2832
2771
|
private loadingTimeout;
|
|
2833
2772
|
private isDisconnected;
|
|
2834
2773
|
constructor(host: PrimerCheckoutType);
|
|
2835
|
-
set paymentsList(value: PaymentMethodInfo[]);
|
|
2836
|
-
get paymentsList(): PaymentMethodInfo[];
|
|
2837
2774
|
get primerJSInstance(): PrimerJS | null;
|
|
2838
2775
|
hostConnected(): void;
|
|
2839
2776
|
hostDisconnected(): void;
|
|
@@ -2851,20 +2788,7 @@ declare class HeadlessSdkController implements ReactiveController {
|
|
|
2851
2788
|
string | null,
|
|
2852
2789
|
PrimerCheckoutOptions | null
|
|
2853
2790
|
]) => Promise<PrimerHeadlessCheckout | typeof initialState>;
|
|
2854
|
-
|
|
2855
|
-
PrimerHeadlessCheckout | null | undefined,
|
|
2856
|
-
PaymentMethodInfo[]
|
|
2857
|
-
]) => Promise<InitializedPaymentMethodMap | typeof initialState | null>;
|
|
2858
|
-
initializePaymentMethodManager(paymentMethod: PaymentMethodInfo): () => Promise<{
|
|
2859
|
-
type: PaymentMethodType;
|
|
2860
|
-
manager: IKlarnaPaymentMethodManager;
|
|
2861
|
-
} | {
|
|
2862
|
-
type: PaymentMethodType;
|
|
2863
|
-
manager: ICardPaymentMethodManager;
|
|
2864
|
-
} | {
|
|
2865
|
-
type: PaymentMethodType;
|
|
2866
|
-
manager: IRedirectPaymentMethodManager;
|
|
2867
|
-
} | null>;
|
|
2791
|
+
private createManager;
|
|
2868
2792
|
/**
|
|
2869
2793
|
* Updates card networks state and dispatches events
|
|
2870
2794
|
*
|
|
@@ -2872,25 +2796,6 @@ declare class HeadlessSdkController implements ReactiveController {
|
|
|
2872
2796
|
*/
|
|
2873
2797
|
private updateCardNetworksState;
|
|
2874
2798
|
}
|
|
2875
|
-
declare global {
|
|
2876
|
-
interface HTMLElementTagNameMap {
|
|
2877
|
-
"primer-checkout": PrimerCheckoutComponent;
|
|
2878
|
-
}
|
|
2879
|
-
type PublicPrimerEvents = Omit<PrimerEvents, "primer-ach-error" | "primer-ach-bank-details-collected" | "primer-ach-mandate-confirmed" | "primer-ach-mandate-declined">;
|
|
2880
|
-
interface DocumentEventMap extends PublicPrimerEvents {
|
|
2881
|
-
}
|
|
2882
|
-
interface HTMLElementEventMap extends PublicPrimerEvents {
|
|
2883
|
-
}
|
|
2884
|
-
}
|
|
2885
|
-
declare class AchPaymentEventsController implements ReactiveController {
|
|
2886
|
-
host: PrimerCheckoutComponent;
|
|
2887
|
-
constructor(host: PrimerCheckoutComponent);
|
|
2888
|
-
private _error;
|
|
2889
|
-
private _mandateConfirmed;
|
|
2890
|
-
private _mandateDeclined;
|
|
2891
|
-
hostConnected(): void;
|
|
2892
|
-
hostDisconnected(): void;
|
|
2893
|
-
}
|
|
2894
2799
|
/**
|
|
2895
2800
|
* PrimerCheckoutComponent implements the main checkout experience.
|
|
2896
2801
|
* This component includes a CSS-only loader that displays before the JavaScript
|
|
@@ -2924,11 +2829,9 @@ export declare class PrimerCheckoutComponent extends LitElement implements Prime
|
|
|
2924
2829
|
locale: LocaleCode;
|
|
2925
2830
|
private onSlotChange;
|
|
2926
2831
|
sdkContextController: SDKContextController;
|
|
2927
|
-
sdkStateController: SdkStateController;
|
|
2928
2832
|
primerEventsController: PrimerEventsController;
|
|
2929
2833
|
styleProcessingController: StyleProcessingController;
|
|
2930
2834
|
vaultManagerController: VaultManagerController;
|
|
2931
|
-
achPaymentEventsController: AchPaymentEventsController;
|
|
2932
2835
|
headlessSdkController: HeadlessSdkController;
|
|
2933
2836
|
constructor();
|
|
2934
2837
|
connectedCallback(): void;
|
|
@@ -3480,28 +3383,6 @@ declare global {
|
|
|
3480
3383
|
"primer-error-message": ErrorMessageComponent;
|
|
3481
3384
|
}
|
|
3482
3385
|
}
|
|
3483
|
-
declare class PortalComponent extends LitElement {
|
|
3484
|
-
static styles: import("lit").CSSResult[];
|
|
3485
|
-
private _id;
|
|
3486
|
-
get id(): string;
|
|
3487
|
-
getContainer(): HTMLDivElement;
|
|
3488
|
-
/**
|
|
3489
|
-
* Proxies the events sent from the portalled content and
|
|
3490
|
-
* re-dispatches them.
|
|
3491
|
-
*
|
|
3492
|
-
* TODO: find a better way to scale to new events instead
|
|
3493
|
-
* of hardcoding them one by one here.
|
|
3494
|
-
*/
|
|
3495
|
-
private _setupEventListeners;
|
|
3496
|
-
disconnectedCallback(): void;
|
|
3497
|
-
private _handleSlotChange;
|
|
3498
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
3499
|
-
}
|
|
3500
|
-
declare global {
|
|
3501
|
-
interface HTMLElementTagNameMap {
|
|
3502
|
-
"primer-portal": PortalComponent;
|
|
3503
|
-
}
|
|
3504
|
-
}
|
|
3505
3386
|
declare class DialogComponent extends LitElement {
|
|
3506
3387
|
static styles: import("lit").CSSResult[];
|
|
3507
3388
|
size: "flex" | "large";
|
|
@@ -3536,22 +3417,20 @@ declare global {
|
|
|
3536
3417
|
*/
|
|
3537
3418
|
declare class PrimerKlarnaComponent extends LitElement {
|
|
3538
3419
|
static styles: import("lit").CSSResult[];
|
|
3539
|
-
|
|
3540
|
-
sdkState: SdkStateContextType;
|
|
3541
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
3542
|
-
klarnaCategories: KlarnaCategoriesContextType | null;
|
|
3420
|
+
primerContext?: ContextType;
|
|
3543
3421
|
disabled: boolean;
|
|
3544
3422
|
private selectedCategory;
|
|
3545
3423
|
private isExpanded;
|
|
3546
|
-
private
|
|
3424
|
+
private categoryLoading;
|
|
3547
3425
|
private klarnaContainer;
|
|
3548
|
-
private
|
|
3549
|
-
|
|
3426
|
+
private _setupTask;
|
|
3427
|
+
private handleExpandedChange;
|
|
3428
|
+
private klarnaPaymentInProgress;
|
|
3550
3429
|
startKlarnaPayment(): Promise<void>;
|
|
3551
3430
|
renderSelectedCategory(): Promise<void>;
|
|
3552
3431
|
selectCategory(category: string): void;
|
|
3553
3432
|
updated(changedProperties: Map<string, unknown>): void;
|
|
3554
|
-
renderCategorySelection(): import("lit-html").TemplateResult<1
|
|
3433
|
+
renderCategorySelection(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
3555
3434
|
renderExpandedContent(): import("lit-html").TemplateResult<1>;
|
|
3556
3435
|
render(): import("lit-html").TemplateResult<1> | typeof nothing | undefined;
|
|
3557
3436
|
}
|
|
@@ -3560,7 +3439,6 @@ declare global {
|
|
|
3560
3439
|
"primer-klarna": PrimerKlarnaComponent;
|
|
3561
3440
|
}
|
|
3562
3441
|
}
|
|
3563
|
-
export type PaymentMethodsContextType = InitializedPaymentMethod[] | null;
|
|
3564
3442
|
/**
|
|
3565
3443
|
* Google Pay component with shadow root rendering for full-width button support.
|
|
3566
3444
|
*
|
|
@@ -3572,10 +3450,9 @@ export type PaymentMethodsContextType = InitializedPaymentMethod[] | null;
|
|
|
3572
3450
|
*/
|
|
3573
3451
|
declare class GooglePayComponent extends LitElement {
|
|
3574
3452
|
static styles: import("lit").CSSResult[];
|
|
3575
|
-
paymentMethod:
|
|
3576
|
-
|
|
3453
|
+
paymentMethod: NativePaymentMethod | undefined;
|
|
3454
|
+
primerContext?: ContextType;
|
|
3577
3455
|
disabled: boolean;
|
|
3578
|
-
private loadManagerTask;
|
|
3579
3456
|
private renderButtonTask;
|
|
3580
3457
|
constructor();
|
|
3581
3458
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
@@ -3598,11 +3475,10 @@ declare global {
|
|
|
3598
3475
|
*/
|
|
3599
3476
|
declare class ApplePayComponent extends LitElement {
|
|
3600
3477
|
static styles: import("lit").CSSResult[];
|
|
3601
|
-
paymentMethod:
|
|
3602
|
-
|
|
3478
|
+
paymentMethod: NativePaymentMethod | undefined;
|
|
3479
|
+
primerContext?: ContextType;
|
|
3603
3480
|
disabled: boolean;
|
|
3604
3481
|
private buttonContainerRef;
|
|
3605
|
-
private loadManagerTask;
|
|
3606
3482
|
private renderButtonTask;
|
|
3607
3483
|
constructor();
|
|
3608
3484
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
@@ -3625,11 +3501,10 @@ declare global {
|
|
|
3625
3501
|
*/
|
|
3626
3502
|
declare class PayPalComponent extends LitElement {
|
|
3627
3503
|
static styles: import("lit").CSSResult[];
|
|
3628
|
-
paymentMethod:
|
|
3629
|
-
|
|
3504
|
+
paymentMethod: NativePaymentMethod | undefined;
|
|
3505
|
+
primerContext?: ContextType;
|
|
3630
3506
|
disabled: boolean;
|
|
3631
3507
|
private buttonContainerRef;
|
|
3632
|
-
private loadManagerTask;
|
|
3633
3508
|
private renderButtonTask;
|
|
3634
3509
|
constructor();
|
|
3635
3510
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
@@ -3663,32 +3538,15 @@ declare global {
|
|
|
3663
3538
|
*/
|
|
3664
3539
|
declare class BlikComponent extends LitElement {
|
|
3665
3540
|
static styles: import("lit").CSSResult[];
|
|
3666
|
-
paymentMethod:
|
|
3541
|
+
paymentMethod: BlikPaymentMethod | undefined;
|
|
3667
3542
|
disabled: boolean;
|
|
3668
|
-
paymentManagers: InitializedManagersMap;
|
|
3669
3543
|
private currentState;
|
|
3670
3544
|
private blikCode;
|
|
3671
3545
|
private errorMessage;
|
|
3672
3546
|
private pollingDuration;
|
|
3673
3547
|
private pollingTimer;
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
* Validates BLIK manager exists before allowing payment flow
|
|
3677
|
-
*
|
|
3678
|
-
* This Task provides reactive validation of manager availability:
|
|
3679
|
-
* - Automatically re-runs when paymentMethod or paymentManagers change
|
|
3680
|
-
* - Provides type-safe access to the BLIK manager
|
|
3681
|
-
* - Enables early error detection before user interaction
|
|
3682
|
-
*
|
|
3683
|
-
* Unlike native payment methods (Apple Pay, Google Pay, PayPal) which use a
|
|
3684
|
-
* two-task pattern (manager loading + button rendering), BLIK only needs the
|
|
3685
|
-
* manager loading task because it renders its own UI via Lit templates.
|
|
3686
|
-
*/
|
|
3687
|
-
private loadManagerTask;
|
|
3688
|
-
/**
|
|
3689
|
-
* Handles button click to toggle between collapsed and expanded states
|
|
3690
|
-
*/
|
|
3691
|
-
private handleButtonClick;
|
|
3548
|
+
private get isExpanded();
|
|
3549
|
+
private handleExpandedChange;
|
|
3692
3550
|
/**
|
|
3693
3551
|
* Handles collapsing the form back to button-only view
|
|
3694
3552
|
* Resets form state when user clicks button to collapse
|
|
@@ -3714,10 +3572,6 @@ declare class BlikComponent extends LitElement {
|
|
|
3714
3572
|
* Validates and submits the BLIK code
|
|
3715
3573
|
*/
|
|
3716
3574
|
private submitBlikCode;
|
|
3717
|
-
/**
|
|
3718
|
-
* Renders the collapsed button state
|
|
3719
|
-
*/
|
|
3720
|
-
private renderCollapsed;
|
|
3721
3575
|
/**
|
|
3722
3576
|
* Renders the expanded input state
|
|
3723
3577
|
*/
|
|
@@ -3745,15 +3599,50 @@ declare global {
|
|
|
3745
3599
|
"primer-blik": BlikComponent;
|
|
3746
3600
|
}
|
|
3747
3601
|
}
|
|
3748
|
-
declare class
|
|
3602
|
+
declare class AdyenKlarnaComponent extends LitElement {
|
|
3749
3603
|
static styles: import("lit").CSSResult[];
|
|
3750
|
-
|
|
3604
|
+
primerContext?: ContextType;
|
|
3605
|
+
/**
|
|
3606
|
+
* The payment method from context
|
|
3607
|
+
*/
|
|
3608
|
+
paymentMethod?: InitializedPaymentMethod;
|
|
3609
|
+
/**
|
|
3610
|
+
* Whether the component is disabled
|
|
3611
|
+
*/
|
|
3751
3612
|
disabled: boolean;
|
|
3752
|
-
paymentMethods: PaymentMethodsContextType;
|
|
3753
3613
|
/**
|
|
3754
|
-
*
|
|
3614
|
+
* Whether the accordion is expanded
|
|
3755
3615
|
*/
|
|
3756
|
-
|
|
3616
|
+
private expanded;
|
|
3617
|
+
/**
|
|
3618
|
+
* Currently selected option ID
|
|
3619
|
+
*/
|
|
3620
|
+
private selectedOptionId;
|
|
3621
|
+
/**
|
|
3622
|
+
* Whether the payment is currently being processed
|
|
3623
|
+
*/
|
|
3624
|
+
private loading;
|
|
3625
|
+
private paymentInProgress;
|
|
3626
|
+
private get manager();
|
|
3627
|
+
/**
|
|
3628
|
+
* Get the Klarna logo URL from the payment method configuration
|
|
3629
|
+
*/
|
|
3630
|
+
private get klarnaLogoUrl();
|
|
3631
|
+
private handleOptionSelect;
|
|
3632
|
+
private handleConfirm;
|
|
3633
|
+
private renderPaymentOptions;
|
|
3634
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
3635
|
+
}
|
|
3636
|
+
declare global {
|
|
3637
|
+
interface HTMLElementTagNameMap {
|
|
3638
|
+
"primer-adyen-klarna": AdyenKlarnaComponent;
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
declare class PaymentMethodComponent extends LitElement {
|
|
3642
|
+
static styles: import("lit").CSSResult[];
|
|
3643
|
+
type: PaymentMethodType | undefined;
|
|
3644
|
+
disabled: boolean;
|
|
3645
|
+
primerContext?: ContextType;
|
|
3757
3646
|
/**
|
|
3758
3647
|
* Sends PAYMENT_METHOD_SELECTION analytics event when user clicks on payment method
|
|
3759
3648
|
* @private
|
|
@@ -3771,14 +3660,12 @@ declare global {
|
|
|
3771
3660
|
"primer-payment-method": PaymentMethodComponent;
|
|
3772
3661
|
}
|
|
3773
3662
|
}
|
|
3774
|
-
export type ClientOptionsContextType = PrimerCheckoutOptions | null;
|
|
3775
3663
|
declare class PaymentMethodContainerComponent extends LitElement {
|
|
3776
3664
|
static styles: import("lit").CSSResult[];
|
|
3777
3665
|
include?: string;
|
|
3778
3666
|
exclude?: string;
|
|
3779
3667
|
disabled: boolean;
|
|
3780
|
-
|
|
3781
|
-
clientOptions: ClientOptionsContextType;
|
|
3668
|
+
primerContext?: ContextType;
|
|
3782
3669
|
private getFilteredMethods;
|
|
3783
3670
|
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
3784
3671
|
}
|
|
@@ -3787,105 +3674,31 @@ declare global {
|
|
|
3787
3674
|
"primer-payment-method-container": PaymentMethodContainerComponent;
|
|
3788
3675
|
}
|
|
3789
3676
|
}
|
|
3790
|
-
|
|
3791
|
-
export interface AchFormState {
|
|
3792
|
-
value: string;
|
|
3793
|
-
error: string;
|
|
3794
|
-
pristine: boolean;
|
|
3795
|
-
touched: boolean;
|
|
3796
|
-
dirty: boolean;
|
|
3797
|
-
valid: boolean;
|
|
3798
|
-
}
|
|
3799
|
-
export type AchFormStateMap = Record<AchField, AchFormState>;
|
|
3800
|
-
export type ValidationFunction = (data: StripeAchCustomerDetails) => Promise<Validation>;
|
|
3801
|
-
declare class AchPaymentFormControler implements ReactiveController {
|
|
3802
|
-
host: AchPaymentComponent;
|
|
3803
|
-
validate: ValidationFunction;
|
|
3804
|
-
formState: AchFormStateMap;
|
|
3805
|
-
get hasError(): {
|
|
3806
|
-
firstName: boolean;
|
|
3807
|
-
lastName: boolean;
|
|
3808
|
-
emailAddress: boolean;
|
|
3809
|
-
};
|
|
3810
|
-
get formData(): StripeAchCustomerDetails;
|
|
3811
|
-
constructor(host: AchPaymentComponent, validate: ValidationFunction);
|
|
3812
|
-
setFieldValue(field: AchField, value: string): Promise<void>;
|
|
3813
|
-
setValidation(validation: Validation, submit?: boolean): void;
|
|
3814
|
-
setFieldTouched(field: AchField): void;
|
|
3815
|
-
resetForm(): void;
|
|
3816
|
-
private isValidFieldName;
|
|
3817
|
-
hostConnected(): void;
|
|
3818
|
-
hostDisconnected(): void;
|
|
3819
|
-
}
|
|
3820
|
-
declare class AchPaymentComponent extends LitElement {
|
|
3821
|
-
static styles: import("lit").CSSResult[];
|
|
3822
|
-
protected readonly formController: AchPaymentFormControler;
|
|
3823
|
-
paymentMethod: InitializedPaymentMethod | undefined;
|
|
3824
|
-
paymentManagers: InitializedManagersMap;
|
|
3825
|
-
sdkState: SdkStateContextType | undefined;
|
|
3826
|
-
clientOptions: ClientOptionsContextType | undefined;
|
|
3827
|
-
screen: "form" | "mandate";
|
|
3828
|
-
private isSubmitting;
|
|
3829
|
-
private _paymentMethodManagerTask;
|
|
3830
|
-
private _handleInput;
|
|
3831
|
-
private _handleBlur;
|
|
3832
|
-
private _handleError;
|
|
3833
|
-
private _handleSubmitButtonClick;
|
|
3834
|
-
private _handleCollectBankAccountDetails;
|
|
3835
|
-
private _handleConfirmMandate;
|
|
3836
|
-
private _handleDeclineMandate;
|
|
3837
|
-
private renderForm;
|
|
3838
|
-
private renderMandate;
|
|
3839
|
-
render(): typeof nothing | TemplateResult | undefined;
|
|
3840
|
-
}
|
|
3841
|
-
declare global {
|
|
3842
|
-
interface HTMLElementTagNameMap {
|
|
3843
|
-
"primer-ach-payment": AchPaymentComponent;
|
|
3844
|
-
}
|
|
3845
|
-
}
|
|
3846
|
-
declare class DynamicPaymentComponent extends LitElement {
|
|
3677
|
+
declare class PaymentMethodButtonComponent extends LitElement {
|
|
3847
3678
|
static styles: import("lit").CSSResult[];
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
3852
|
-
open: boolean;
|
|
3853
|
-
private _paymentMethodManagerTask;
|
|
3854
|
-
private _getAssetsTask;
|
|
3679
|
+
type: PaymentMethodType | undefined;
|
|
3680
|
+
disabled: boolean;
|
|
3681
|
+
primerContext?: ContextType;
|
|
3855
3682
|
/**
|
|
3856
3683
|
* Based on packages/primer-sdk-web/src/payment-methods/Button.tsx
|
|
3857
3684
|
* Should be replaced once we align on a better solution across all platforms.
|
|
3858
|
-
* TODO: get label from payment config
|
|
3859
3685
|
*/
|
|
3860
3686
|
private _legacyGetButtonLabel;
|
|
3861
|
-
private
|
|
3862
|
-
|
|
3863
|
-
renderDialog(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
3687
|
+
private _setupTask;
|
|
3688
|
+
private _handleClick;
|
|
3864
3689
|
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3865
3690
|
}
|
|
3866
3691
|
declare global {
|
|
3867
3692
|
interface HTMLElementTagNameMap {
|
|
3868
|
-
"primer-
|
|
3693
|
+
"primer-payment-method-button": PaymentMethodButtonComponent;
|
|
3869
3694
|
}
|
|
3870
3695
|
}
|
|
3871
3696
|
declare class RedirectPaymentComponent extends LitElement {
|
|
3872
|
-
static styles: import("lit").CSSResult
|
|
3873
|
-
paymentMethod:
|
|
3697
|
+
static styles: import("lit").CSSResult;
|
|
3698
|
+
paymentMethod: RedirectPaymentMethod | undefined;
|
|
3874
3699
|
disabled: boolean;
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
3878
|
-
clientOptions: ClientOptionsContextType | undefined;
|
|
3879
|
-
private _paymentMethodManagerTask;
|
|
3880
|
-
/**
|
|
3881
|
-
* Based on packages/primer-sdk-web/src/payment-methods/Button.tsx
|
|
3882
|
-
* Should be replaced once we align on a better solution across all platforms.
|
|
3883
|
-
*/
|
|
3884
|
-
private _legacyGetButtonLabel;
|
|
3885
|
-
private _getAssetsTask;
|
|
3886
|
-
private _setupTasks;
|
|
3887
|
-
startRedirectPayment(): void;
|
|
3888
|
-
render(): symbol | import("lit-html").TemplateResult<1> | undefined;
|
|
3700
|
+
private _handleClick;
|
|
3701
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
3889
3702
|
}
|
|
3890
3703
|
declare global {
|
|
3891
3704
|
interface HTMLElementTagNameMap {
|
|
@@ -3905,14 +3718,7 @@ declare global {
|
|
|
3905
3718
|
*/
|
|
3906
3719
|
declare class BillingAddressComponent extends LitElement {
|
|
3907
3720
|
static styles: import("lit").CSSResult[];
|
|
3908
|
-
|
|
3909
|
-
* Configuration from SDK Core containing checkoutModules configuration
|
|
3910
|
-
*/
|
|
3911
|
-
configuration: ConfigurationContextType;
|
|
3912
|
-
/**
|
|
3913
|
-
* Headless SDK utilities for API methods like setBillingAddress
|
|
3914
|
-
*/
|
|
3915
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
3721
|
+
primerContext?: ContextType;
|
|
3916
3722
|
/**
|
|
3917
3723
|
* Form data state
|
|
3918
3724
|
*/
|
|
@@ -3950,7 +3756,7 @@ declare class BillingAddressComponent extends LitElement {
|
|
|
3950
3756
|
* attempting field configuration extraction and country initialization
|
|
3951
3757
|
*
|
|
3952
3758
|
* Lifecycle:
|
|
3953
|
-
* - Task runs when this.configuration or this.headlessUtils changes
|
|
3759
|
+
* - Task runs when this.primerContext?.configuration or this.primerContext?.headlessUtils changes
|
|
3954
3760
|
* - Stays pending (returns initialState) until both contexts are available
|
|
3955
3761
|
* - Completes when field config is extracted and countries initialized
|
|
3956
3762
|
*
|
|
@@ -4115,10 +3921,7 @@ declare class VaultManagerComponent extends LitElement {
|
|
|
4115
3921
|
constructor();
|
|
4116
3922
|
addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
4117
3923
|
removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
4118
|
-
|
|
4119
|
-
vaultItemContext: VaultItemContextType;
|
|
4120
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
4121
|
-
contextEventsController: EventsContextType;
|
|
3924
|
+
primerContext?: ContextType;
|
|
4122
3925
|
/**
|
|
4123
3926
|
* State to track if slot has content (triggers re-render)
|
|
4124
3927
|
*/
|
|
@@ -4263,16 +4066,11 @@ declare class VaultPaymentMethodItemComponent extends LitElement {
|
|
|
4263
4066
|
*/
|
|
4264
4067
|
addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
4265
4068
|
removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
|
|
4266
|
-
|
|
4267
|
-
* Consume the vault manager context
|
|
4268
|
-
*/
|
|
4269
|
-
vaultManagerContext: VaultManagerContextType;
|
|
4270
|
-
vaultItemContext: VaultItemContextType;
|
|
4271
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
4069
|
+
primerContext?: ContextType;
|
|
4272
4070
|
/**
|
|
4273
4071
|
* The payment method to display
|
|
4274
4072
|
*/
|
|
4275
|
-
paymentMethod: VaultedPaymentMethod |
|
|
4073
|
+
paymentMethod: VaultedPaymentMethod | undefined;
|
|
4276
4074
|
/**
|
|
4277
4075
|
* Whether the component is in edit mode
|
|
4278
4076
|
*/
|
|
@@ -4355,10 +4153,6 @@ declare class VaultDeleteConfirmationComponent extends LitElement {
|
|
|
4355
4153
|
* Payment method name to display in confirmation
|
|
4356
4154
|
*/
|
|
4357
4155
|
paymentMethodName: string;
|
|
4358
|
-
/**
|
|
4359
|
-
* Consume the vault manager context to access payment method info
|
|
4360
|
-
*/
|
|
4361
|
-
vaultManager: VaultManagerContextType;
|
|
4362
4156
|
/**
|
|
4363
4157
|
* Handle confirm click
|
|
4364
4158
|
*/
|
|
@@ -4435,11 +4229,7 @@ declare class VaultPaymentSubmitComponent extends LitElement {
|
|
|
4435
4229
|
*/
|
|
4436
4230
|
get buttonText(): string;
|
|
4437
4231
|
set buttonText(value: string);
|
|
4438
|
-
|
|
4439
|
-
sdkState: SdkStateContextType;
|
|
4440
|
-
vaultItemContext: VaultItemContextType;
|
|
4441
|
-
vaultManager: VaultManagerContextType;
|
|
4442
|
-
clientOptions: PrimerCheckoutOptions | null;
|
|
4232
|
+
primerContext?: ContextType;
|
|
4443
4233
|
/**
|
|
4444
4234
|
* The button variant to use.
|
|
4445
4235
|
* @default "primary"
|
|
@@ -4475,16 +4265,7 @@ declare global {
|
|
|
4475
4265
|
*/
|
|
4476
4266
|
declare class VaultCvvInputComponent extends LitElement {
|
|
4477
4267
|
static styles: import("lit").CSSResult[];
|
|
4478
|
-
|
|
4479
|
-
* Form context for checking form dirty state
|
|
4480
|
-
*/
|
|
4481
|
-
vaultManagerFormContext: VaultManagerContextType;
|
|
4482
|
-
/**
|
|
4483
|
-
* CVV-specific context for dedicated CVV handling
|
|
4484
|
-
* Separated to minimize re-renders on frequent CVV input changes
|
|
4485
|
-
*/
|
|
4486
|
-
vaultManagerCvvContext: VaultItemContextType;
|
|
4487
|
-
computedStyles: CSSStyleDeclaration | null;
|
|
4268
|
+
primerContext?: ContextType;
|
|
4488
4269
|
paymentMethod: PaymentCardVaultedMethod | null;
|
|
4489
4270
|
private cvvError;
|
|
4490
4271
|
private cvvInputIsDirty;
|
|
@@ -4610,26 +4391,7 @@ declare class CardFormComponent extends LitElement {
|
|
|
4610
4391
|
* @private
|
|
4611
4392
|
*/
|
|
4612
4393
|
private paymentMethodSelectionSent;
|
|
4613
|
-
|
|
4614
|
-
* Payment managers injected from context
|
|
4615
|
-
*/
|
|
4616
|
-
paymentManagers: InitializedManagersMap;
|
|
4617
|
-
/**
|
|
4618
|
-
* Client options for configuration
|
|
4619
|
-
*/
|
|
4620
|
-
clientOptions: ClientOptionsContextType;
|
|
4621
|
-
/**
|
|
4622
|
-
* Headless utils for accessing server configuration
|
|
4623
|
-
*/
|
|
4624
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
4625
|
-
/**
|
|
4626
|
-
* Analytics utils for sending analytics events
|
|
4627
|
-
*/
|
|
4628
|
-
analyticsUtils: AnalyticsContextType;
|
|
4629
|
-
/**
|
|
4630
|
-
* Events controller from context for receiving forwarded events
|
|
4631
|
-
*/
|
|
4632
|
-
contextEventsController: EventsContextType;
|
|
4394
|
+
primerContext?: ContextType;
|
|
4633
4395
|
/**
|
|
4634
4396
|
* Context provider for card form data
|
|
4635
4397
|
*/
|
|
@@ -4731,7 +4493,7 @@ declare class CardFormComponent extends LitElement {
|
|
|
4731
4493
|
*/
|
|
4732
4494
|
export interface HostedInputHost extends ReactiveControllerHost, LitElement {
|
|
4733
4495
|
cardFormContext: CardFormContext | null;
|
|
4734
|
-
|
|
4496
|
+
primerContext?: ContextType;
|
|
4735
4497
|
/** A string for the input placeholder. */
|
|
4736
4498
|
placeholder: string;
|
|
4737
4499
|
/** An accessible label for the input. */
|
|
@@ -4907,7 +4669,7 @@ declare abstract class AbstractCardInputComponent extends LitElement implements
|
|
|
4907
4669
|
private _cardFormContext;
|
|
4908
4670
|
get cardFormContext(): CardFormContext | null;
|
|
4909
4671
|
set cardFormContext(value: CardFormContext | null);
|
|
4910
|
-
|
|
4672
|
+
primerContext?: ContextType;
|
|
4911
4673
|
/** Tracks which properties were explicitly set by the user */
|
|
4912
4674
|
protected readonly _userAssignedProps: Set<string>;
|
|
4913
4675
|
/** Internal storage for property values */
|
|
@@ -5060,12 +4822,8 @@ declare class CardFormSubmitComponent extends LitElement {
|
|
|
5060
4822
|
*/
|
|
5061
4823
|
get buttonText(): string;
|
|
5062
4824
|
set buttonText(value: string);
|
|
5063
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
5064
|
-
clientOptions: ClientOptionsContextType;
|
|
5065
|
-
sdkState: SdkStateContextType;
|
|
5066
4825
|
cardFormContext: CardFormContext | null;
|
|
5067
|
-
|
|
5068
|
-
contextEventsController: EventsContextType;
|
|
4826
|
+
primerContext?: ContextType;
|
|
5069
4827
|
/**
|
|
5070
4828
|
* The button variant to use.
|
|
5071
4829
|
* @default "primary"
|
|
@@ -5103,11 +4861,7 @@ declare global {
|
|
|
5103
4861
|
*/
|
|
5104
4862
|
declare class CardNetworkSelectorComponent extends LitElement {
|
|
5105
4863
|
static styles: import("lit").CSSResult[];
|
|
5106
|
-
|
|
5107
|
-
* Card networks context from provider
|
|
5108
|
-
*/
|
|
5109
|
-
cardNetworks: CardNetworksContextType;
|
|
5110
|
-
headlessUtils: HeadlessUtilsContextType;
|
|
4864
|
+
primerContext?: ContextType;
|
|
5111
4865
|
private selectedCardNetwork;
|
|
5112
4866
|
/**
|
|
5113
4867
|
* Internal state to track if dropdown is open
|
|
@@ -5208,14 +4962,7 @@ declare global {
|
|
|
5208
4962
|
*/
|
|
5209
4963
|
declare class ShowOtherPaymentsComponent extends LitElement {
|
|
5210
4964
|
static styles: import("lit").CSSResult[];
|
|
5211
|
-
|
|
5212
|
-
* Consume the vault manager context to interact with vault state
|
|
5213
|
-
*/
|
|
5214
|
-
vaultManager: VaultManagerContextType;
|
|
5215
|
-
/**
|
|
5216
|
-
* Consume the events context for external control
|
|
5217
|
-
*/
|
|
5218
|
-
contextEventsController: EventsContextType;
|
|
4965
|
+
primerContext?: ContextType;
|
|
5219
4966
|
/**
|
|
5220
4967
|
* Reference to the collapsable component
|
|
5221
4968
|
*/
|
|
@@ -5297,6 +5044,40 @@ declare global {
|
|
|
5297
5044
|
"primer-show-other-payments": ShowOtherPaymentsComponent;
|
|
5298
5045
|
}
|
|
5299
5046
|
}
|
|
5047
|
+
declare class PaymentMethodAccordionComponent extends LitElement {
|
|
5048
|
+
static styles: import("lit").CSSResult[];
|
|
5049
|
+
type: PaymentMethodType | undefined;
|
|
5050
|
+
disabled: boolean;
|
|
5051
|
+
expanded: boolean;
|
|
5052
|
+
/**
|
|
5053
|
+
* When true, suppresses auto-collapse on window blur.
|
|
5054
|
+
* Used when payment flows open external popups (e.g. Klarna).
|
|
5055
|
+
*/
|
|
5056
|
+
suppressBlurCollapse: boolean;
|
|
5057
|
+
connectedCallback(): void;
|
|
5058
|
+
disconnectedCallback(): void;
|
|
5059
|
+
private _handleDocumentClick;
|
|
5060
|
+
private _handleWindowBlur;
|
|
5061
|
+
private _collapseFromOutsideInteraction;
|
|
5062
|
+
private _handleButtonClick;
|
|
5063
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5064
|
+
}
|
|
5065
|
+
declare global {
|
|
5066
|
+
interface HTMLElementTagNameMap {
|
|
5067
|
+
"primer-payment-method-accordion": PaymentMethodAccordionComponent;
|
|
5068
|
+
}
|
|
5069
|
+
}
|
|
5070
|
+
declare class PaymentMethodAccordionConfirmButtonComponent extends LitElement {
|
|
5071
|
+
static styles: import("lit").CSSResult[];
|
|
5072
|
+
disabled: boolean;
|
|
5073
|
+
loading: boolean;
|
|
5074
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
5075
|
+
}
|
|
5076
|
+
declare global {
|
|
5077
|
+
interface HTMLElementTagNameMap {
|
|
5078
|
+
"primer-payment-method-accordion-confirm-button": PaymentMethodAccordionConfirmButtonComponent;
|
|
5079
|
+
}
|
|
5080
|
+
}
|
|
5300
5081
|
declare class PrimerCheckoutCompleteComponent extends LitElement {
|
|
5301
5082
|
render(): import("lit-html").TemplateResult<1>;
|
|
5302
5083
|
}
|
|
@@ -5306,7 +5087,7 @@ declare global {
|
|
|
5306
5087
|
}
|
|
5307
5088
|
}
|
|
5308
5089
|
declare class PrimerCheckoutErrorComponent extends LitElement {
|
|
5309
|
-
|
|
5090
|
+
primerContext?: ContextType;
|
|
5310
5091
|
render(): import("lit-html").TemplateResult<1>;
|
|
5311
5092
|
}
|
|
5312
5093
|
declare global {
|
|
@@ -5325,10 +5106,10 @@ declare global {
|
|
|
5325
5106
|
declare class ErrorMessageContainerComponent extends LitElement {
|
|
5326
5107
|
static styles: import("lit").CSSResult[];
|
|
5327
5108
|
/**
|
|
5328
|
-
* Consume the
|
|
5109
|
+
* Consume the unified context
|
|
5329
5110
|
* This automatically subscribes to changes in the SDK state
|
|
5330
5111
|
*/
|
|
5331
|
-
|
|
5112
|
+
primerContext?: ContextType;
|
|
5332
5113
|
showProcessingErrors: boolean;
|
|
5333
5114
|
/**
|
|
5334
5115
|
* Determine if an error should be shown
|
|
@@ -5352,9 +5133,7 @@ declare class PrimerMainComponent extends LitElement {
|
|
|
5352
5133
|
* Uses assignedNodes with flatten to detect if the slot has any nodes.
|
|
5353
5134
|
*/
|
|
5354
5135
|
private onSlotChange;
|
|
5355
|
-
|
|
5356
|
-
sdkState: SdkStateContextType;
|
|
5357
|
-
clientOptions: ClientOptionsContextType;
|
|
5136
|
+
primerContext?: ContextType;
|
|
5358
5137
|
render(): import("lit-html").TemplateResult<1>;
|
|
5359
5138
|
}
|
|
5360
5139
|
declare global {
|
|
@@ -5368,7 +5147,6 @@ declare global {
|
|
|
5368
5147
|
export declare function loadPrimer(): void;
|
|
5369
5148
|
|
|
5370
5149
|
export {
|
|
5371
|
-
AchPaymentComponent as AchPayment,
|
|
5372
5150
|
ApplePayComponent as ApplePay,
|
|
5373
5151
|
BillingAddressComponent as BillingAddress,
|
|
5374
5152
|
BlikComponent as Blik,
|
|
@@ -5378,7 +5156,6 @@ export {
|
|
|
5378
5156
|
CardNetworkSelectorComponent as CardFormCardNetworkSelector,
|
|
5379
5157
|
CollapsableComponent as Collapsable,
|
|
5380
5158
|
DialogComponent as Dialog,
|
|
5381
|
-
DynamicPaymentComponent as DynamicPayment,
|
|
5382
5159
|
ErrorMessageComponent as ErrorMessage,
|
|
5383
5160
|
ErrorMessageContainerComponent as ErrorMessageContainer,
|
|
5384
5161
|
GooglePayComponent as GooglePay,
|
|
@@ -5391,9 +5168,11 @@ export {
|
|
|
5391
5168
|
InputLabelComponent as InputLabel,
|
|
5392
5169
|
InputWrapperComponent as InputWrapper,
|
|
5393
5170
|
PayPalComponent as PayPal,
|
|
5171
|
+
PaymentMethodAccordionComponent as PaymentMethodAccordion,
|
|
5172
|
+
PaymentMethodAccordionConfirmButtonComponent as PaymentMethodAccordionConfirmButton,
|
|
5173
|
+
PaymentMethodButtonComponent as PaymentMethodButton,
|
|
5394
5174
|
PaymentMethodComponent as PaymentMethod,
|
|
5395
5175
|
PaymentMethodContainerComponent as PaymentMethodContainer,
|
|
5396
|
-
PortalComponent as Portal,
|
|
5397
5176
|
PortalDialogComponent as PortalDialog,
|
|
5398
5177
|
PrimerCheckoutCompleteComponent as PrimerCheckoutComplete,
|
|
5399
5178
|
PrimerCheckoutErrorComponent as PrimerCheckoutFailure,
|