@primer-io/primer-js 0.0.3 → 0.1.1

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.
@@ -1,13 +1,56 @@
1
+ /**
2
+ * Injects the CSS loader styles into the page
3
+ * These styles display a loading indicator before JavaScript initializes
4
+ *
5
+ * Unlike theme styles, loader styles should take precedence over merchant styles
6
+ * to ensure the loading indicator is visible. We append them to the end of the head.
7
+ */
8
+ export declare function injectLoaderStyles(): void;
9
+ /**
10
+ * Injects all required theme CSS variables into the page
11
+ * This should be called before components are rendered to ensure
12
+ * they have access to all design tokens
13
+ *
14
+ * Theme styles are prepended to the document head to allow merchant styles
15
+ * to override our default variables.
16
+ */
17
+ export declare function injectThemeStyles(): void;
18
+ /**
19
+ * Utility function to inject only the light theme CSS variables
20
+ * @returns {void}
21
+ */
22
+ export declare function injectLightTheme(): void;
23
+ /**
24
+ * Utility function to inject only the dark theme CSS variables
25
+ * @returns {void}
26
+ */
27
+ export declare function injectDarkTheme(): void;
28
+ /**
29
+ * Main function to load the Primer SDK with all required dependencies and styles
30
+ * @returns {Promise<void>} A promise that resolves when loading is complete
31
+ */
32
+ export declare function loadPrimer(): Promise<void>;
1
33
  export type CardNetwork = {
2
34
  displayName: string;
3
35
  network: string;
4
- iconUrl: string;
5
36
  };
6
37
  export type CardNetworksContext = {
7
38
  detectedCardNetwork: CardNetwork | null;
8
39
  selectableCardNetworks: CardNetwork[];
9
40
  isLoading: boolean;
41
+ } | null;
42
+ export type SdkState = {
43
+ isSuccessful: boolean;
44
+ isProcessing: boolean;
45
+ error: Error | null;
46
+ isLoading: boolean;
47
+ failure: {
48
+ code: string;
49
+ message: string;
50
+ details?: Record<string, unknown>;
51
+ } | null;
10
52
  };
53
+ export type SdkStateContext = SdkState | null;
11
54
  /**
12
55
  * A CSSResult or native CSSStyleSheet.
13
56
  *
@@ -883,6 +926,152 @@ export interface RenderOptions {
883
926
  * ensuring backward compatibility.
884
927
  */
885
928
  export type APIVersionOption = "legacy" | "2.4";
929
+ declare enum ImplementationType {
930
+ WEB_REDIRECT = "WEB_REDIRECT",
931
+ NATIVE_SDK = "NATIVE_SDK"
932
+ }
933
+ declare enum ProductType {
934
+ DIGITAL = "DIGITAL",
935
+ PHYSICAL = "PHYSICAL",
936
+ SHIPPING_FEE = "SHIPPING_FEE"
937
+ }
938
+ export interface ClientSessionLineItem {
939
+ amount: number;
940
+ description: string;
941
+ discountAmount?: number;
942
+ itemId: string;
943
+ name?: string;
944
+ productType?: ProductType;
945
+ quantity: number;
946
+ taxAmount?: number;
947
+ taxCode?: string;
948
+ }
949
+ export interface ClientSessionShipping {
950
+ amount: number;
951
+ methodId?: string;
952
+ methodName?: string;
953
+ methodDescription?: string;
954
+ }
955
+ export interface ClientSessionFeeItem {
956
+ type?: string;
957
+ description?: string;
958
+ amount: number;
959
+ }
960
+ export interface ClientSessionAddress {
961
+ firstName?: string;
962
+ lastName?: string;
963
+ addressLine1?: string;
964
+ addressLine2?: string;
965
+ city?: string;
966
+ state?: string;
967
+ countryCode?: string;
968
+ postalCode?: string;
969
+ }
970
+ export interface ClientSession {
971
+ orderId?: string;
972
+ currencyCode?: string;
973
+ lineItems?: ClientSessionLineItem[];
974
+ totalAmount?: number;
975
+ customerId?: string;
976
+ orderDetails?: {
977
+ countryCode?: string;
978
+ shipping?: ClientSessionShipping;
979
+ fees?: ClientSessionFeeItem[];
980
+ };
981
+ customer?: {
982
+ emailAddress?: string;
983
+ mobileNumber?: string;
984
+ firstName?: string;
985
+ lastName?: string;
986
+ billingAddress?: ClientSessionAddress;
987
+ shippingAddress?: ClientSessionAddress;
988
+ taxId?: string;
989
+ nationalDocumentId?: string;
990
+ };
991
+ paymentMethod?: {
992
+ options?: Record<string, any>;
993
+ orderedAllowedCardNetworks?: string[];
994
+ vaultOnSuccess?: boolean;
995
+ };
996
+ }
997
+ export interface PaymentMethodDisplayMetadata {
998
+ button: {
999
+ backgroundColor: BackgroundColor;
1000
+ borderColor: BorderColor;
1001
+ borderWidth: BorderWidth;
1002
+ cornerRadius: number;
1003
+ iconPositionRelativeToText?: "START" | "END";
1004
+ iconUrl: IconUrl;
1005
+ text?: string;
1006
+ textColor?: TextColor;
1007
+ };
1008
+ overlay: {
1009
+ logo: IconUrl;
1010
+ backgroundColor: BackgroundColor;
1011
+ };
1012
+ popup: {
1013
+ width: number;
1014
+ height: number;
1015
+ };
1016
+ }
1017
+ export interface BackgroundColor {
1018
+ colored: string;
1019
+ dark: string;
1020
+ light: string;
1021
+ }
1022
+ export interface BorderColor {
1023
+ dark: string;
1024
+ light: string;
1025
+ }
1026
+ export interface BorderWidth {
1027
+ colored: number;
1028
+ dark: number;
1029
+ light: number;
1030
+ }
1031
+ export interface IconUrl {
1032
+ colored: string;
1033
+ dark: string;
1034
+ light: string;
1035
+ }
1036
+ export interface TextColor {
1037
+ dark: string;
1038
+ light: string;
1039
+ }
1040
+ export interface PaymentMethodConfig {
1041
+ id: string;
1042
+ type: PaymentMethodType;
1043
+ name: string;
1044
+ implementationType: ImplementationType;
1045
+ displayMetadata: PaymentMethodDisplayMetadata;
1046
+ options: {
1047
+ captureVaultedCardCvv?: boolean;
1048
+ clientId?: string;
1049
+ threeDSecureToken?: string;
1050
+ threeDSecureInitUrl?: string;
1051
+ threeDSecureProvider?: string;
1052
+ threeDSecureEnabled?: boolean;
1053
+ };
1054
+ forceRedirect?: boolean;
1055
+ }
1056
+ export type GoatBrand = {
1057
+ assets: {
1058
+ icon: string;
1059
+ };
1060
+ colors: {
1061
+ background: string;
1062
+ main: string;
1063
+ };
1064
+ description: string | null;
1065
+ is_primer_app: boolean;
1066
+ name: string;
1067
+ website: string | null;
1068
+ };
1069
+ export type GoatBrandWithCdn = GoatBrand & {
1070
+ /**
1071
+ * The full CDN URL that can be used directly in applications
1072
+ */
1073
+ goatCdnUrl: string;
1074
+ };
886
1075
  declare const PaymentInstrumentType: {
887
1076
  readonly WORLDPAY_IDEAL: "WORLDPAY_IDEAL";
888
1077
  readonly AUTOMATED_CLEARING_HOUSE: "AUTOMATED_CLEARING_HOUSE";
@@ -1196,98 +1385,95 @@ export interface CheckoutStyle {
1196
1385
  processingIndicator?: ProcessingIndicatorStyle;
1197
1386
  focusCheckoutOnInit?: boolean;
1198
1387
  }
1199
- export interface IVaultedPaymentMethod<T, U extends PaymentInstrumentType> {
1200
- id: string;
1201
- analyticsId: string;
1202
- paymentInstrumentData: T;
1203
- paymentInstrumentType: U;
1204
- threeDSecureAuthentication: ThreeDSAuthenticationData | null;
1205
- vaultData: VaultData | null;
1206
- userDescription?: string;
1207
- }
1208
- export type VaultedPaymentMethod = IVaultedPaymentMethod<any, any>;
1209
- declare enum ProductType {
1210
- DIGITAL = "DIGITAL",
1211
- PHYSICAL = "PHYSICAL",
1212
- SHIPPING_FEE = "SHIPPING_FEE"
1213
- }
1214
- export interface ClientSessionLineItem {
1215
- amount: number;
1216
- description: string;
1217
- discountAmount?: number;
1218
- itemId: string;
1219
- name?: string;
1220
- productType?: ProductType;
1221
- quantity: number;
1222
- taxAmount?: number;
1223
- taxCode?: string;
1224
- }
1225
- export interface ClientSessionShipping {
1226
- amount: number;
1227
- methodId?: string;
1228
- methodName?: string;
1229
- methodDescription?: string;
1230
- }
1231
- export interface ClientSessionFeeItem {
1232
- type?: string;
1233
- description?: string;
1234
- amount: number;
1388
+ declare enum CheckoutUXFlow {
1389
+ CHECKOUT = "CHECKOUT",
1390
+ HEADLESS_CHECKOUT = "HEADLESS_CHECKOUT",
1391
+ MANAGE_PAYMENT_METHODS = "MANAGE_PAYMENT_METHODS"
1235
1392
  }
1236
- export interface ClientSessionAddress {
1237
- firstName?: string;
1238
- lastName?: string;
1239
- addressLine1?: string;
1240
- addressLine2?: string;
1241
- city?: string;
1242
- state?: string;
1243
- countryCode?: string;
1244
- postalCode?: string;
1393
+ export interface BasePaymentInstrumentData {
1394
+ [key: string]: unknown;
1245
1395
  }
1246
- export interface ClientSession {
1247
- orderId?: string;
1248
- currencyCode?: string;
1249
- lineItems?: ClientSessionLineItem[];
1250
- totalAmount?: number;
1251
- customerId?: string;
1252
- orderDetails?: {
1253
- countryCode?: string;
1254
- shipping?: ClientSessionShipping;
1255
- fees?: ClientSessionFeeItem[];
1396
+ export interface PaymentCardInstrumentData extends BasePaymentInstrumentData {
1397
+ last4Digits: string;
1398
+ first6Digits: string;
1399
+ expirationMonth: string;
1400
+ expirationYear: string;
1401
+ cardholderName: string;
1402
+ network: string;
1403
+ isNetworkTokenized: boolean;
1404
+ binData?: {
1405
+ network: string;
1406
+ issuerCountryCode: string;
1407
+ issuerName: string;
1408
+ issuerCurrencyCode: string;
1409
+ regionalRestriction: string;
1410
+ accountNumberType: string;
1411
+ accountFundingType: string;
1412
+ prepaidReloadableIndicator: string;
1413
+ productUsageType: string;
1414
+ productCode: string;
1415
+ productName: string;
1256
1416
  };
1257
- customer?: {
1258
- emailAddress?: string;
1259
- mobileNumber?: string;
1417
+ }
1418
+ export interface PayPalInstrumentData extends BasePaymentInstrumentData {
1419
+ externalPayerInfo?: {
1420
+ externalPayerId?: string;
1260
1421
  firstName?: string;
1261
1422
  lastName?: string;
1262
- billingAddress?: ClientSessionAddress;
1263
- shippingAddress?: ClientSessionAddress;
1264
- taxId?: string;
1265
- nationalDocumentId?: string;
1423
+ email?: string;
1266
1424
  };
1267
- paymentMethod?: {
1268
- options?: Record<string, any>;
1269
- orderedAllowedCardNetworks?: string[];
1270
- vaultOnSuccess?: boolean;
1425
+ shippingAddress?: {
1426
+ firstName?: string;
1427
+ lastName?: string;
1428
+ addressLine1?: string;
1429
+ addressLine2?: string;
1430
+ city?: string;
1431
+ state?: string;
1432
+ countryCode?: string;
1433
+ postalCode?: string;
1271
1434
  };
1272
1435
  }
1273
- export interface BackgroundColor {
1274
- colored: string;
1275
- dark: string;
1276
- light: string;
1436
+ export interface KlarnaInstrumentData extends BasePaymentInstrumentData {
1437
+ sessionData?: {
1438
+ billingAddress?: {
1439
+ firstName?: string;
1440
+ lastName?: string;
1441
+ email?: string;
1442
+ phoneNumber?: string;
1443
+ addressLine1?: string;
1444
+ addressLine2?: string;
1445
+ city?: string;
1446
+ state?: string;
1447
+ countryCode?: string;
1448
+ postalCode?: string;
1449
+ };
1450
+ };
1277
1451
  }
1278
- export interface IconUrl {
1279
- colored: string;
1280
- dark: string;
1281
- light: string;
1452
+ export interface ACHInstrumentData extends BasePaymentInstrumentData {
1453
+ accountNumberLastFourDigits: string;
1454
+ bankName: string;
1455
+ accountType?: string;
1456
+ routingNumber?: string;
1282
1457
  }
1283
- declare enum CheckoutUXFlow {
1284
- CHECKOUT = "CHECKOUT",
1285
- HEADLESS_CHECKOUT = "HEADLESS_CHECKOUT",
1286
- MANAGE_PAYMENT_METHODS = "MANAGE_PAYMENT_METHODS"
1458
+ export interface IVaultedPaymentMethod<B extends BasePaymentInstrumentData = BasePaymentInstrumentData, I extends PaymentInstrumentType = PaymentInstrumentType, T extends PaymentMethodType = PaymentMethodType> {
1459
+ id: string;
1460
+ analyticsId: string;
1461
+ paymentInstrumentData: B;
1462
+ paymentInstrumentType: I;
1463
+ paymentMethodType: T;
1464
+ threeDSecureAuthentication?: ThreeDSAuthenticationData | null;
1465
+ vaultData?: VaultData | null;
1466
+ userDescription?: string;
1467
+ isVaulted?: boolean;
1287
1468
  }
1469
+ export type PaymentCardVaultedMethod = IVaultedPaymentMethod<PaymentCardInstrumentData, typeof PaymentInstrumentType.CARD, typeof PaymentMethodType.PAYMENT_CARD>;
1470
+ export type PayPalVaultedMethod = IVaultedPaymentMethod<PayPalInstrumentData, typeof PaymentInstrumentType.PAYPAL_VAULTED, typeof PaymentMethodType.PAYPAL>;
1471
+ export type KlarnaVaultedMethod = IVaultedPaymentMethod<KlarnaInstrumentData, typeof PaymentInstrumentType.KLARNA_CUSTOMER_TOKEN, typeof PaymentMethodType.KLARNA>;
1472
+ export type ACHVaultedMethod = IVaultedPaymentMethod<ACHInstrumentData, typeof PaymentInstrumentType.AUTOMATED_CLEARING_HOUSE, typeof PaymentMethodType.STRIPE_ACH>;
1473
+ export type VaultedPaymentMethod = PaymentCardVaultedMethod | PayPalVaultedMethod | KlarnaVaultedMethod | ACHVaultedMethod | IVaultedPaymentMethod;
1288
1474
  export type SecureInputOptions = {
1289
1475
  ariaLabel?: string;
1290
- container: string;
1476
+ container: string | Element | HTMLElement;
1291
1477
  id?: string;
1292
1478
  name: string;
1293
1479
  placeholder?: string;
@@ -1397,13 +1583,6 @@ export interface CardMetadata {
1397
1583
  cvvLength: number;
1398
1584
  cardNumberLength: number;
1399
1585
  }
1400
- export type PaymentMethodData$1 = AdyenMultibancoPaymentData;
1401
- export type AdyenMultibancoPaymentData = {
1402
- paymentMethodType: typeof PaymentMethodType.ADYEN_MULTIBANCO;
1403
- reference: string;
1404
- expiresAt: string;
1405
- entity: string;
1406
- };
1407
1586
  export interface PositionalConfig {
1408
1587
  container: string | Element;
1409
1588
  }
@@ -1589,6 +1768,15 @@ export interface Validation {
1589
1768
  validationErrors: InputValidationError[];
1590
1769
  error?: string;
1591
1770
  }
1771
+ export interface InputMetadata {
1772
+ errorCode: string | null;
1773
+ error: string | null;
1774
+ valid: boolean;
1775
+ active: boolean;
1776
+ dirty: boolean;
1777
+ touched: boolean;
1778
+ submitted: boolean;
1779
+ }
1592
1780
  export interface ExternalPayerInfo {
1593
1781
  externalPayerId: string;
1594
1782
  firstName?: string;
@@ -1634,20 +1822,21 @@ export interface ThreeDSAuthenticationData {
1634
1822
  export interface VaultData {
1635
1823
  customerId: string;
1636
1824
  }
1637
- export interface PaymentCardDetails {
1825
+ export type PaymentCardDetails = {
1638
1826
  last4Digits: string;
1639
1827
  cardholderName: string;
1640
1828
  network: string;
1641
- }
1642
- export interface PayPalBillingAgreementDetails {
1829
+ };
1830
+ export type PayPalBillingAgreementDetails = {
1643
1831
  paypalBillingAgreementId: string;
1644
1832
  externalPayerInfo?: ExternalPayerInfo;
1645
1833
  shippingAddress?: CustomerAddress;
1646
- }
1647
- export interface GoCardlessDetails {
1834
+ };
1835
+ export type GoCardlessDetails = {
1648
1836
  gocardlessMandateId: string;
1649
- }
1650
- export interface IPaymentMethodToken<T, U extends PaymentInstrumentType> {
1837
+ };
1838
+ export type BasePaymentInstrumentData$1 = Record<string, unknown>;
1839
+ export interface IPaymentMethodToken<T extends BasePaymentInstrumentData$1 = BasePaymentInstrumentData$1, U extends PaymentInstrumentType = PaymentInstrumentType> {
1651
1840
  token: string;
1652
1841
  analyticsId: string;
1653
1842
  tokenType: TokenType;
@@ -1656,11 +1845,12 @@ export interface IPaymentMethodToken<T, U extends PaymentInstrumentType> {
1656
1845
  threeDSecureAuthentication: ThreeDSAuthenticationData | null;
1657
1846
  vaultData: VaultData | null;
1658
1847
  }
1848
+ export type UnknownPaymentMethodToken = IPaymentMethodToken<BasePaymentInstrumentData$1, PaymentInstrumentType>;
1659
1849
  export type PaymentCardToken = IPaymentMethodToken<PaymentCardDetails, typeof PaymentInstrumentType.CARD>;
1660
1850
  export type PayPalBillingAgreementToken = IPaymentMethodToken<PayPalBillingAgreementDetails, typeof PaymentInstrumentType.PAYPAL_VAULTED>;
1661
1851
  export type GoCardlessToken = IPaymentMethodToken<GoCardlessDetails, typeof PaymentInstrumentType.GO_CARDLESS>;
1662
1852
  export type IdealPayToken = IPaymentMethodToken<Record<string, never>, typeof PaymentInstrumentType.PAY_NL_IDEAL>;
1663
- export type PaymentMethodToken = PaymentCardToken | PayPalBillingAgreementToken | GoCardlessToken | IdealPayToken | IPaymentMethodToken<any, any>;
1853
+ export type PaymentMethodToken = PaymentCardToken | PayPalBillingAgreementToken | GoCardlessToken | IdealPayToken | UnknownPaymentMethodToken;
1664
1854
  export type CheckSuccessScreenOptions = {
1665
1855
  type: SuccessScreenType.CHECK;
1666
1856
  title: Label;
@@ -1695,6 +1885,13 @@ export type AdvancedOptions = {
1695
1885
  };
1696
1886
  export type PaymentMethodAction = "PAYMENT_METHOD_SELECTED" | "PAYMENT_METHOD_UNSELECTED";
1697
1887
  export type PaymentHandling = "AUTO" | "MANUAL";
1888
+ export type PaymentMethodData$1 = AdyenMultibancoPaymentData;
1889
+ export type AdyenMultibancoPaymentData = {
1890
+ paymentMethodType: typeof PaymentMethodType.ADYEN_MULTIBANCO;
1891
+ reference: string;
1892
+ expiresAt: string;
1893
+ entity: string;
1894
+ };
1698
1895
  export type Payment = {
1699
1896
  id: string;
1700
1897
  orderId: string;
@@ -1759,6 +1956,7 @@ export interface ClientSessionHandlers {
1759
1956
  onBeforeClientSessionUpdate?: () => void;
1760
1957
  }
1761
1958
  export interface VaultManagerOptions extends WithAllowedCardNetworks {
1959
+ uxFlow?: CheckoutUXFlow.MANAGE_PAYMENT_METHODS;
1762
1960
  container: string | Element;
1763
1961
  locale?: SupportedLocale;
1764
1962
  vaultOnly?: boolean;
@@ -1772,7 +1970,9 @@ export interface VaultManagerOptions extends WithAllowedCardNetworks {
1772
1970
  card?: CheckoutCardOptions;
1773
1971
  threeDSecure?: ThreeDSVerificationOptions;
1774
1972
  giftCard?: CustomizablePaymentMethodButton;
1973
+ googlePay?: Omit<GooglePayOptions, "container">;
1775
1974
  directDebit?: DirectDebitOptions;
1975
+ stripe?: StripeOptionsDropIn;
1776
1976
  paypal?: Omit<PayPalOptions, "container">;
1777
1977
  onTokenizeShouldStart?: OnTokenizeShouldStart;
1778
1978
  onTokenizeDidNotStart?: OnTokenizeDidNotStart;
@@ -1849,7 +2049,11 @@ declare enum EventTypes {
1849
2049
  FOCUS = "focus",
1850
2050
  BLUR = "blur",
1851
2051
  CLICK = "click",
1852
- CLOSE = "close"
2052
+ CLOSE = "close",
2053
+ CONFIRMED_KLARNA_CATEGORY = "CONFIRMED_KLARNA_CATEGORY",
2054
+ CONFIRMED_KLARNA_CATEGORY_ERROR = "CONFIRMED_KLARNA_CATEGORY_ERROR",
2055
+ KLARNA_SESSION_UPDATE = "KLARNA_SESSION_UPDATE",
2056
+ KLARNA_SESSION_REFRESH_ERROR = "KLARNA_SESSION_REFRESH_ERROR"
1853
2057
  }
1854
2058
  export interface HeadlessHostedInputOptions {
1855
2059
  placeholder?: string;
@@ -1916,10 +2120,6 @@ export interface IRedirectPaymentMethodManager {
1916
2120
  start(): Promise<void>;
1917
2121
  addEventListener(event: EventTypes, callback: EventListener$1): void;
1918
2122
  }
1919
- export interface IFormWithRedirectPaymentMethodManager<T> {
1920
- start(): any;
1921
- submit(data: T): any;
1922
- }
1923
2123
  export interface IKlarnaPaymentMethodManager {
1924
2124
  start(paymentPayload: KlarnaPaymentPayload): Promise<KlarnaPaymentResponse>;
1925
2125
  renderCategory(renderCategoryDetails: RenderCategoryDetails): Promise<void>;
@@ -1937,7 +2137,6 @@ declare enum HeadlessManagerType {
1937
2137
  CARD = "CARD",
1938
2138
  NATIVE = "NATIVE",
1939
2139
  REDIRECT = "REDIRECT",
1940
- FORM_WITH_REDIRECT = "FORM_WITH_REDIRECT",
1941
2140
  KLARNA = "KLARNA",
1942
2141
  ACH = "ACH"
1943
2142
  }
@@ -2000,6 +2199,10 @@ export interface FormWithRedirectPaymentMethodManagerOptions {
2000
2199
  }
2001
2200
  export interface KlarnaPaymentMethodManagerOptions {
2002
2201
  onPaymentMethodCategoriesChange?: (paymentMethodCategories: KlarnaPaymentMethodCategory[]) => void;
2202
+ onPaymentMethodAction?: (action: string, data: {
2203
+ paymentMethodType: string;
2204
+ category: string;
2205
+ }) => void;
2003
2206
  }
2004
2207
  export interface AchPaymentMethodManagerOptions {
2005
2208
  onCollectBankAccountDetailsComplete?: () => void;
@@ -2021,15 +2224,24 @@ export type RenderCategoryDetails = {
2021
2224
  paymentMethodCategoryId: string;
2022
2225
  onHeightChange: (height: number) => void;
2023
2226
  };
2227
+ export interface HeadlessSDKUtilities {
2228
+ getCardNetworkAsset(network: string): {
2229
+ cardUrl: string;
2230
+ displayName: string;
2231
+ };
2232
+ getUIOrderAmount(): string | null;
2233
+ getCDNAssets(paymentMethodType: PaymentMethodType): Promise<GoatBrandWithCdn | undefined>;
2234
+ getPaymentMethodConfiguration(paymentMethodType: PaymentMethodType): PaymentMethodConfig | undefined;
2235
+ }
2024
2236
  export type PaymentMethodManagerOptions = CardPaymentMethodManagerOptions | FormWithRedirectPaymentMethodManagerOptions | KlarnaPaymentMethodManagerOptions;
2025
2237
  export interface PrimerHeadlessCheckout {
2026
2238
  createPaymentMethodManager(type: "PAYMENT_CARD", options?: PaymentMethodManagerOptions): Promise<ICardPaymentMethodManager | null>;
2027
2239
  createPaymentMethodManager(type: "PAYPAL" | "GOOGLE_PAY" | "APPLE_PAY", options?: PaymentMethodManagerOptions): Promise<INativePaymentMethodManager | null>;
2028
- createPaymentMethodManager(type: "ADYEN_IDEAL", options?: FormWithRedirectPaymentMethodManagerOptions): Promise<IFormWithRedirectPaymentMethodManager<BankIssuer> | null>;
2029
2240
  createPaymentMethodManager(type: "STRIPE_ACH", options?: AchPaymentMethodManagerOptions): Promise<IAchPaymentMethodManager | null>;
2030
2241
  createPaymentMethodManager(type: "KLARNA", options?: PaymentMethodManagerOptions): Promise<IKlarnaPaymentMethodManager | null>;
2031
2242
  createPaymentMethodManager(type: PaymentMethodType, options?: PaymentMethodManagerOptions): Promise<IRedirectPaymentMethodManager | null>;
2032
2243
  createVaultManager(): HeadlessVaultManager;
2244
+ getSDKUtilities(): HeadlessSDKUtilities;
2033
2245
  /**
2034
2246
  * @deprecated
2035
2247
  * The options should be set on the `createHeadless` second parameter instead:
@@ -2056,18 +2268,19 @@ declare const Primer: {
2056
2268
  export type JSONSafe<T> = T extends (...args: any[]) => any ? never : T extends symbol ? never : T extends bigint ? never : T extends Array<infer U> ? JSONSafe<U>[] : T extends object ? {
2057
2269
  [K in keyof T as JSONSafe<T[K]> extends never ? never : K]: JSONSafe<T[K]>;
2058
2270
  } : T;
2059
- export type PrimerCheckoutOptions = JSONSafe<HeadlessUniversalCheckoutOptions>;
2271
+ export type PrimerCheckoutOptions = JSONSafe<HeadlessUniversalCheckoutOptions> & {
2272
+ vault?: {
2273
+ enabled: boolean;
2274
+ };
2275
+ submitButton?: {
2276
+ amountVisible?: boolean;
2277
+ };
2278
+ };
2060
2279
  declare global {
2061
2280
  interface Window {
2062
2281
  Primer: typeof Primer;
2063
2282
  }
2064
2283
  }
2065
- export type InitializedPaymentAssets = {
2066
- displayName: string;
2067
- backgroundColor?: BackgroundColor;
2068
- buttonText: string;
2069
- iconUrl?: IconUrl;
2070
- };
2071
2284
  export type InitializedManager = {
2072
2285
  type: typeof PaymentMethodType.STRIPE_ACH;
2073
2286
  manager: IAchPaymentMethodManager;
@@ -2094,32 +2307,25 @@ export type RedirectPaymentMethodTypes = Exclude<PaymentMethodType, typeof Payme
2094
2307
  export type RedirectPaymentMethod = {
2095
2308
  type: RedirectPaymentMethodTypes;
2096
2309
  managerType: HeadlessManagerType.REDIRECT;
2097
- assets: InitializedPaymentAssets;
2098
2310
  };
2099
2311
  export type InitializedPaymentMethod = {
2100
2312
  type: typeof PaymentMethodType.STRIPE_ACH;
2101
2313
  managerType: HeadlessManagerType.ACH;
2102
- assets: InitializedPaymentAssets;
2103
2314
  } | {
2104
2315
  type: typeof PaymentMethodType.PAYMENT_CARD;
2105
2316
  managerType: HeadlessManagerType.CARD;
2106
- assets: null;
2107
2317
  } | {
2108
2318
  type: typeof PaymentMethodType.KLARNA;
2109
2319
  managerType: HeadlessManagerType.KLARNA;
2110
- assets: InitializedPaymentAssets;
2111
2320
  } | {
2112
2321
  type: typeof PaymentMethodType.PAYPAL;
2113
2322
  managerType: HeadlessManagerType.NATIVE;
2114
- assets: null;
2115
2323
  } | {
2116
2324
  type: typeof PaymentMethodType.GOOGLE_PAY;
2117
2325
  managerType: HeadlessManagerType.NATIVE;
2118
- assets: null;
2119
2326
  } | {
2120
2327
  type: typeof PaymentMethodType.APPLE_PAY;
2121
2328
  managerType: HeadlessManagerType.NATIVE;
2122
- assets: null;
2123
2329
  } | RedirectPaymentMethod;
2124
2330
  export type PaymentMethodByType<T extends PaymentMethodType> = Extract<InitializedPaymentMethod, {
2125
2331
  type: T;
@@ -2127,7 +2333,7 @@ export type PaymentMethodByType<T extends PaymentMethodType> = Extract<Initializ
2127
2333
  export interface InitializedPaymentMethodMap extends Map<PaymentMethodType, InitializedPaymentMethod> {
2128
2334
  get<T extends PaymentMethodType>(key: T): PaymentMethodByType<T> | undefined;
2129
2335
  }
2130
- declare class PaymentsObject {
2336
+ declare class InitializedPayments {
2131
2337
  private readonly _methods;
2132
2338
  constructor(map: InitializedPaymentMethodMap);
2133
2339
  get<T extends RedirectPaymentMethodTypes>(type: T): RedirectPaymentMethod | undefined;
@@ -2135,17 +2341,6 @@ declare class PaymentsObject {
2135
2341
  toArray(): InitializedPaymentMethod[];
2136
2342
  size(): number;
2137
2343
  }
2138
- export type SdkStateContext = {
2139
- isSuccessful: boolean;
2140
- isProcessing: boolean;
2141
- error?: Error;
2142
- isLoading?: boolean;
2143
- failure?: {
2144
- code: string;
2145
- message: string;
2146
- details?: Record<string, unknown>;
2147
- };
2148
- };
2149
2344
  export interface CardSubmitSuccessPayload {
2150
2345
  result: unknown;
2151
2346
  }
@@ -2154,7 +2349,7 @@ export interface CardSubmitErrorsPayload {
2154
2349
  }
2155
2350
  export interface PrimerEvents {
2156
2351
  "primer-state-changed": CustomEvent<SdkStateContext>;
2157
- "primer-payment-methods-updated": CustomEvent<PaymentsObject>;
2352
+ "primer-payment-methods-updated": CustomEvent<InitializedPayments>;
2158
2353
  "primer-checkout-initialized": CustomEvent<PrimerHeadlessCheckout>;
2159
2354
  "primer-card-network-change": CustomEvent<CardNetworksContext>;
2160
2355
  "primer-card-submit-success": CustomEvent<CardSubmitSuccessPayload>;
@@ -2173,27 +2368,167 @@ declare class PrimerEventsController implements ReactiveController {
2173
2368
  */
2174
2369
  dispatchEvent<K extends keyof PrimerEvents>(type: K, detail: PrimerEvents[K]["detail"]): void;
2175
2370
  dispatchSdkState(sdkState: SdkStateContext): void;
2176
- dispatchPaymentMethods(paymentMethods: PaymentsObject): void;
2371
+ dispatchPaymentMethods(paymentMethods: InitializedPayments): void;
2177
2372
  dispatchCheckoutInitialized(checkoutInstance: PrimerHeadlessCheckout): void;
2178
2373
  dispatchCardNetworkChange(network: CardNetworksContext): void;
2179
2374
  dispatchFormSubmitSuccess(result: unknown): void;
2180
2375
  dispatchFormSubmitErrors(errors: unknown): void;
2181
2376
  }
2182
- declare class SdkStateController implements ReactiveController {
2183
- host: PrimerCheckoutType;
2184
- private _state;
2185
- constructor(host: PrimerCheckoutType);
2377
+ export type HeadlessUnitilsContext = HeadlessSDKUtilities | null;
2378
+ export type KlarnaCategoriesContext = {
2379
+ categories: KlarnaPaymentMethodCategory[];
2380
+ isLoading: boolean;
2381
+ };
2382
+ /**
2383
+ * Options for initializing the Vault Manager
2384
+ */
2385
+ export interface VaultManagerInitOptions {
2386
+ vaultEnabled?: boolean;
2387
+ captureVaultedCardCvv?: boolean;
2388
+ }
2389
+ /**
2390
+ * Core state interface for vault manager
2391
+ * Contains properties related to vault functionality that don't change frequently
2392
+ */
2393
+ export interface VaultManagerState {
2394
+ enabled: boolean;
2395
+ isLoading: boolean;
2396
+ vaultedPaymentMethods: VaultedPaymentMethod[];
2397
+ cvvRecapture: boolean;
2398
+ createCvvInput?: (options: CardSecurityCodeInputOptions) => Promise<CvvInput | null>;
2399
+ deleteVaultedPaymentMethod: (paymentMethodId: string) => Promise<void>;
2400
+ startVaultedPaymentFlow: (options?: {
2401
+ cvv?: string;
2402
+ }) => Promise<void>;
2403
+ }
2404
+ /**
2405
+ * CVV-specific state interface
2406
+ * Contains properties specifically related to CVV input functionality
2407
+ */
2408
+ export interface VaultManagerItemState {
2409
+ formIsDirty: boolean;
2410
+ cvvInput: CvvInput | null;
2411
+ setCvvInput: (metadata: CvvInput | null) => void;
2412
+ selectedVaultedPaymentMethod: VaultedPaymentMethod | null;
2413
+ setSelectedVaultedPaymentMethod: (paymentMethod: VaultedPaymentMethod | null) => void;
2414
+ }
2415
+ declare class VaultManagerController implements ReactiveController {
2416
+ host: PrimerCheckoutType;
2417
+ private _vaultManagerState;
2418
+ private _vaultItemState;
2419
+ private _vaultManager;
2420
+ private _options;
2421
+ constructor(host: PrimerCheckoutType);
2422
+ /**
2423
+ * Initialize the vault manager with additional options
2424
+ * @param vaultManager - The HeadlessVaultManager instance
2425
+ * @param options - Additional initialization options
2426
+ */
2427
+ initializeVaultManager(vaultManager: HeadlessVaultManager, options?: VaultManagerInitOptions): void;
2428
+ get vaultManager(): HeadlessVaultManager | null;
2429
+ set vaultManager(vaultManager: HeadlessVaultManager | null);
2430
+ get options(): VaultManagerInitOptions | null;
2431
+ set options(options: VaultManagerInitOptions | null);
2432
+ /**
2433
+ * Lifecycle method called when the host disconnects
2434
+ */
2435
+ hostDisconnected(): void;
2436
+ /**
2437
+ * Dispatches an action to update the core vault state
2438
+ */
2439
+ private dispatchVaultManager;
2440
+ /**
2441
+ * Dispatches an action to update the CVV state
2442
+ * Separate dispatch method to handle CVV state independently
2443
+ */
2444
+ private dispatchVaultItem;
2445
+ /**
2446
+ * Fetch vaulted payment methods from the server
2447
+ */
2448
+ fetchVaultedPaymentMethods(): Promise<VaultedPaymentMethod[]>;
2449
+ /**
2450
+ * Delete a vaulted payment method by ID
2451
+ */
2452
+ deleteVaultedPaymentMethod: (paymentMethodId: string) => Promise<void>;
2453
+ /**
2454
+ * Set the CVV metadata - updates CVV state only
2455
+ * Moved to the separate CVV context
2456
+ */
2457
+ setCvvInput: (metadata: CvvInput | null) => void;
2458
+ /**
2459
+ * Start the vaulted payment flow
2460
+ * Verifies form state validity before processing
2461
+ */
2462
+ startVaultedPaymentFlow: () => Promise<void>;
2463
+ /**
2464
+ * Set the selected vaulted payment method - updates form state only
2465
+ */
2466
+ setSelectedVaultedPaymentMethod: (paymentMethod: VaultedPaymentMethod | null) => void;
2467
+ }
2468
+ /**
2469
+ * Context for core vault manager functionality
2470
+ * Contains properties that don't change frequently and relate to vault functionality
2471
+ */
2472
+ export type VaultManagerContext = VaultManagerState | null;
2473
+ /**
2474
+ * Context for vault manager CVV-specific state
2475
+ * Contains properties specifically related to CVV input functionality
2476
+ * Further separated to minimize re-renders related to frequently changing CVV input state
2477
+ */
2478
+ export type VaultItemContext = VaultManagerItemState | null;
2479
+ declare class SDKContextController implements ReactiveController {
2480
+ host: PrimerCheckoutType;
2481
+ private sdkStateProvider;
2482
+ private paymentMethodsProvider;
2483
+ private paymentManagerProvider;
2484
+ private cardNetworksContext;
2485
+ private vaultManagerProvider;
2486
+ private vaultManagerCvvProvider;
2487
+ private clientOptionsContext;
2488
+ private headlessUtilsProvider;
2489
+ private klarnaCategoriesProvider;
2490
+ private computedStylesProvider;
2491
+ constructor(host: PrimerCheckoutType);
2492
+ hostConnected(): void;
2493
+ /**
2494
+ * Updates the SDK state context.
2495
+ * @param value The new SDK state.
2496
+ */
2497
+ setSdkState(value: SdkStateContext): void;
2498
+ /**
2499
+ * Updates the payment methods context.
2500
+ * @param value The new payment methods data.
2501
+ */
2502
+ setPaymentMethods(value: InitializedPayments): void;
2503
+ /**
2504
+ * Updates the payment manager context.
2505
+ * @param value The new payment manager mapping.
2506
+ */
2507
+ setPaymentManagers(value: InitializedManagersMap): void;
2508
+ setCardNetworks(value: CardNetworksContext): void;
2509
+ setVaultManager(value: VaultManagerContext): void;
2510
+ setKlarnaCategories(value: KlarnaCategoriesContext): void;
2511
+ setClientOptions(value: PrimerCheckoutOptions | null): void;
2512
+ setHeadlessUtils(value: HeadlessUnitilsContext): void;
2513
+ setComputedStyles(value: CSSStyleDeclaration): void;
2514
+ setVaultManagerCvv(value: VaultItemContext): void;
2515
+ }
2516
+ declare class SdkStateController implements ReactiveController {
2517
+ host: PrimerCheckoutType;
2518
+ private _state;
2519
+ constructor(host: PrimerCheckoutType);
2186
2520
  hostConnected(): void;
2187
2521
  private reducer;
2188
2522
  private dispatch;
2189
2523
  startLoading(): void;
2190
2524
  startProcessing(): void;
2525
+ stopProcessing(): void;
2191
2526
  completeProcessing(): void;
2192
2527
  completeLoading(): void;
2193
2528
  setError(error: Error): void;
2194
2529
  setFailure(code: string, message: string, details?: Record<string, unknown>): void;
2195
2530
  reset(): void;
2196
- get state(): SdkStateContext;
2531
+ get state(): SdkState;
2197
2532
  }
2198
2533
  export interface PrimerCheckoutType extends ReactiveControllerHost, LitElement {
2199
2534
  requestUpdate: ReactiveControllerHost["requestUpdate"];
@@ -2203,31 +2538,29 @@ export interface PrimerCheckoutType extends ReactiveControllerHost, LitElement {
2203
2538
  sdkContextController: SDKContextController;
2204
2539
  sdkStateController: SdkStateController;
2205
2540
  primerEventsController: PrimerEventsController;
2541
+ vaultManagerController: VaultManagerController;
2542
+ cardNetworkController: CardNetworkController;
2206
2543
  }
2207
- declare class SDKContextController implements ReactiveController {
2208
- host: PrimerCheckoutType;
2209
- private sdkStateProvider;
2210
- private paymentMethodsProvider;
2211
- private paymentManagerProvider;
2212
- private cardNetworksContext;
2544
+ declare class CardNetworkController implements ReactiveController {
2545
+ private host;
2213
2546
  constructor(host: PrimerCheckoutType);
2214
2547
  hostConnected(): void;
2215
2548
  /**
2216
- * Updates the SDK state context.
2217
- * @param value The new SDK state.
2549
+ * Sets the card networks to loading state
2218
2550
  */
2219
- setSdkState(value: SdkStateContext): void;
2551
+ setCardNetworksLoading(): void;
2220
2552
  /**
2221
- * Updates the payment methods context.
2222
- * @param value The new payment methods data.
2553
+ * Updates card networks state and dispatches events
2554
+ *
2555
+ * @param cardNetworks - The new card networks context
2223
2556
  */
2224
- setPaymentMethods(value: PaymentsObject): void;
2557
+ private updateCardNetworksState;
2225
2558
  /**
2226
- * Updates the payment manager context.
2227
- * @param value The new payment manager mapping.
2559
+ * Processes a card network change event
2560
+ *
2561
+ * @param event - The card network change event
2228
2562
  */
2229
- setPaymentManagers(value: InitializedManagersMap): void;
2230
- setCardNetworks(value: CardNetworksContext): void;
2563
+ processCardNetworkChangeEvent(event: CardNetworkChangeEvent): Promise<void>;
2231
2564
  }
2232
2565
  declare class StyleProcessingController implements ReactiveController {
2233
2566
  host: ReactiveControllerHost & LitElement;
@@ -2335,12 +2668,20 @@ declare const targetLocales = [
2335
2668
  ] as const;
2336
2669
  export type LocaleCode = typeof sourceLocale | (typeof targetLocales)[number];
2337
2670
  declare class PrimerCheckoutComponent extends LitElement implements PrimerCheckoutType {
2671
+ set jsInitialized(value: boolean);
2672
+ get jsInitialized(): boolean;
2338
2673
  static styles: CSSResult[];
2339
2674
  customStyles: string;
2340
2675
  clientToken: string;
2341
2676
  options: PrimerCheckoutOptions;
2342
- disableLoader: boolean;
2677
+ /**
2678
+ * Whether the component has completed initialization and loading
2679
+ * This is used to control the CSS-only loader visibility
2680
+ * @private
2681
+ */
2682
+ private _jsInitialized;
2343
2683
  defaultSlot: HTMLSlotElement;
2684
+ private previousLoadingState;
2344
2685
  private hasAssignedContent;
2345
2686
  locale?: LocaleCode;
2346
2687
  private onSlotChange;
@@ -2348,9 +2689,17 @@ declare class PrimerCheckoutComponent extends LitElement implements PrimerChecko
2348
2689
  sdkStateController: SdkStateController;
2349
2690
  primerEventsController: PrimerEventsController;
2350
2691
  styleProcessingController: StyleProcessingController;
2692
+ vaultManagerController: VaultManagerController;
2693
+ cardNetworkController: CardNetworkController;
2351
2694
  constructor();
2352
2695
  attributeChangedCallback(attrName: string, oldVal: string, newVal: string): void;
2353
2696
  willUpdate(changedProperties: PropertyValues): void;
2697
+ updated(): void;
2698
+ /**
2699
+ * Check if the loading state has changed and update the CSS loader visibility accordingly.
2700
+ * This method is called after each update cycle to detect when loading is complete.
2701
+ */
2702
+ private checkLoadingStateChange;
2354
2703
  render(): TemplateResult;
2355
2704
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: PrimerCheckoutComponent, ev: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
2356
2705
  addEventListener<K extends keyof ShadowRootEventMap>(type: K, listener: (this: PrimerCheckoutComponent, ev: ShadowRootEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
@@ -2430,11 +2779,43 @@ declare global {
2430
2779
  "primer-input-label": InputLabelComponent;
2431
2780
  }
2432
2781
  }
2782
+ /**
2783
+ * Simplified selection state for buttons
2784
+ */
2785
+ export type ButtonSelectionState = "default" | "checked";
2433
2786
  declare class ButtonComponent extends LitElement {
2434
2787
  static styles: CSSResult[];
2435
2788
  variant: "primary" | "secondary" | "tertiary";
2436
2789
  disabled: boolean;
2790
+ /**
2791
+ * Loading state of the button
2792
+ * When true, the button will display a spinner and be disabled
2793
+ */
2794
+ loading: boolean;
2437
2795
  buttonType: "button" | "submit" | "reset";
2796
+ /**
2797
+ * Selection state of the button
2798
+ * - default: Not checked
2799
+ * - checked: Button is checked
2800
+ */
2801
+ selectionState: ButtonSelectionState;
2802
+ /**
2803
+ * Indicates if this button is selectable/checkable
2804
+ */
2805
+ selectable: boolean;
2806
+ /**
2807
+ * Event handler for button click
2808
+ * If selectable, it will toggle between checked and default states
2809
+ */
2810
+ private handleClick;
2811
+ /**
2812
+ * Renders the checkmark icon when checked
2813
+ */
2814
+ private renderCheckmark;
2815
+ /**
2816
+ * Renders the spinner when in loading state
2817
+ */
2818
+ private renderSpinner;
2438
2819
  render(): TemplateResult<1>;
2439
2820
  }
2440
2821
  declare global {
@@ -2464,7 +2845,7 @@ declare const icons: Record<string, SVGTemplateResult>;
2464
2845
  declare class PrimerIconComponent extends LitElement {
2465
2846
  static styles: CSSResult[];
2466
2847
  color: string;
2467
- size: "lg" | "sm";
2848
+ size: "lg" | "md" | "sm";
2468
2849
  /** The name of the icon to draw - available names can be found under library.ts file */
2469
2850
  name?: IconName;
2470
2851
  render(): TemplateResult<1>;
@@ -2588,11 +2969,130 @@ declare global {
2588
2969
  "primer-input": InputComponent;
2589
2970
  }
2590
2971
  }
2972
+ /**
2973
+ * Button variant types
2974
+ */
2975
+ export type ButtonVariant = "primary" | "secondary" | "tertiary";
2976
+ declare class CollapsableComponent extends LitElement {
2977
+ static styles: CSSResult[];
2978
+ /**
2979
+ * The header text for the collapsable
2980
+ */
2981
+ header: string;
2982
+ /**
2983
+ * Whether the collapsable is expanded by default
2984
+ */
2985
+ expanded: boolean;
2986
+ /**
2987
+ * Text for expand button (for accessibility)
2988
+ */
2989
+ expandText: string;
2990
+ /**
2991
+ * Text for collapse button (for accessibility)
2992
+ */
2993
+ collapseText: string;
2994
+ /**
2995
+ * ARIA label for the collapsable header
2996
+ */
2997
+ ariaLabel: string;
2998
+ /**
2999
+ * The button variant to use
3000
+ */
3001
+ buttonVariant: ButtonVariant;
3002
+ /**
3003
+ * Internal state to track expanded state
3004
+ */
3005
+ private isExpanded;
3006
+ /**
3007
+ * Hook into the component lifecycle to set the initial expanded state
3008
+ */
3009
+ connectedCallback(): void;
3010
+ /**
3011
+ * Dispatch the expanded-changed event
3012
+ */
3013
+ private dispatchExpandedChangedEvent;
3014
+ /**
3015
+ * Toggle the expanded state
3016
+ */
3017
+ private toggleExpanded;
3018
+ /**
3019
+ * Expand the collapsable programmatically
3020
+ */
3021
+ expand(): void;
3022
+ /**
3023
+ * Collapse the collapsable programmatically
3024
+ */
3025
+ collapse(): void;
3026
+ render(): TemplateResult<1>;
3027
+ }
3028
+ declare global {
3029
+ interface HTMLElementTagNameMap {
3030
+ "primer-collapsable": CollapsableComponent;
3031
+ }
3032
+ }
3033
+ declare class ErrorMessageComponent extends LitElement {
3034
+ static styles: CSSResult[];
3035
+ /**
3036
+ * The error message text to display
3037
+ */
3038
+ message: string;
3039
+ /**
3040
+ * Whether the error message is visible
3041
+ */
3042
+ visible: boolean;
3043
+ /**
3044
+ * Accessibility role for the error message
3045
+ * Defaults to "alert" for proper screen reader announcements
3046
+ */
3047
+ role: string;
3048
+ /**
3049
+ * Internal state to track animation state
3050
+ * This helps manage proper animations with DOM presence/absence
3051
+ */
3052
+ private showMessage;
3053
+ protected updated(changedProperties: Map<PropertyKey, unknown>): void;
3054
+ /**
3055
+ * Handle visibility changes with proper animation timing
3056
+ */
3057
+ private handleVisibilityChange;
3058
+ render(): typeof nothing | TemplateResult<1>;
3059
+ }
3060
+ declare global {
3061
+ interface HTMLElementTagNameMap {
3062
+ "primer-error-message": ErrorMessageComponent;
3063
+ }
3064
+ }
3065
+ declare class PrimerKlarnaComponent extends LitElement {
3066
+ static styles: CSSResult[];
3067
+ paymentManagers: InitializedManagersMap;
3068
+ sdkState: SdkStateContext;
3069
+ headlessUtils: HeadlessUnitilsContext;
3070
+ klarnaCategories: KlarnaCategoriesContext | null;
3071
+ private selectedCategory;
3072
+ private isExpanded;
3073
+ private headerAriaLabel;
3074
+ private klarnaContainer;
3075
+ private _paymentMethodManagerTask;
3076
+ toggleExpand(): void;
3077
+ startKlarnaPayment(): Promise<void>;
3078
+ renderSelectedCategory(): Promise<void>;
3079
+ selectCategory(category: string): void;
3080
+ updated(changedProperties: Map<string, unknown>): void;
3081
+ renderCategorySelection(): typeof nothing | TemplateResult<1>;
3082
+ renderExpandedContent(): TemplateResult<1>;
3083
+ render(): typeof nothing | TemplateResult<1> | undefined;
3084
+ }
3085
+ declare global {
3086
+ interface HTMLElementTagNameMap {
3087
+ "primer-klarna": PrimerKlarnaComponent;
3088
+ }
3089
+ }
3090
+ export type PaymentMethodsContext = InitializedPayments | null;
2591
3091
  declare class PaymentMethodComponent extends LitElement {
2592
3092
  static styles: CSSResult[];
2593
3093
  type: PaymentMethodType | undefined;
2594
- paymentMethods: PaymentsObject | null;
2595
- render(): TemplateResult<1> | typeof nothing;
3094
+ paymentMethods: PaymentMethodsContext;
3095
+ render(): typeof nothing | TemplateResult<1>;
2596
3096
  }
2597
3097
  declare global {
2598
3098
  interface HTMLElementTagNameMap {
@@ -2603,8 +3103,11 @@ declare class RedirectPaymentComponent extends LitElement {
2603
3103
  static styles: CSSResult[];
2604
3104
  paymentMethod: InitializedPaymentMethod | undefined;
2605
3105
  paymentManagers: InitializedManagersMap;
2606
- sdkState: SdkStateContext | undefined;
3106
+ sdkState: SdkStateContext;
3107
+ headlessUtils: HeadlessUnitilsContext;
2607
3108
  private _paymentMethodManagerTask;
3109
+ private _getAssetsTask;
3110
+ private _setupTasks;
2608
3111
  startRedirectPayment(): void;
2609
3112
  render(): symbol | TemplateResult<1> | undefined;
2610
3113
  }
@@ -2621,8 +3124,8 @@ declare class PrimerMainComponent extends LitElement {
2621
3124
  * Uses assignedNodes with flatten to detect if the slot has any nodes.
2622
3125
  */
2623
3126
  private onSlotChange;
2624
- paymentMethods: PaymentsObject | null;
2625
- sdkState: SdkStateContext | undefined;
3127
+ paymentMethods: PaymentMethodsContext;
3128
+ sdkState: SdkStateContext;
2626
3129
  render(): TemplateResult<1>;
2627
3130
  }
2628
3131
  declare global {
@@ -2634,6 +3137,7 @@ declare class NativePaymentComponent extends LitElement {
2634
3137
  static styles: CSSResult[];
2635
3138
  paymentMethod: InitializedPaymentMethod | undefined;
2636
3139
  paymentManagers: InitializedManagersMap;
3140
+ computedStyles: CSSStyleDeclaration | null;
2637
3141
  private _buttonId;
2638
3142
  private loadManagerTask;
2639
3143
  constructor();
@@ -2707,7 +3211,7 @@ declare class CardFormComponent extends LitElement {
2707
3211
  * Handles both native form submissions and custom events
2708
3212
  */
2709
3213
  private handleFormSubmit;
2710
- render(): TemplateResult<1> | typeof nothing;
3214
+ render(): typeof nothing | TemplateResult<1>;
2711
3215
  }
2712
3216
  export interface CardFormContext {
2713
3217
  cardNumberInput: IHeadlessHostedInput;
@@ -2725,6 +3229,7 @@ export interface CardFormContext {
2725
3229
  */
2726
3230
  export interface HostedInputHost extends ReactiveControllerHost, LitElement {
2727
3231
  cardFormContext: CardFormContext | null;
3232
+ computedStyles: CSSStyleDeclaration | null;
2728
3233
  /** A string for the input placeholder. */
2729
3234
  placeholder: string;
2730
3235
  /** An accessible label for the input. */
@@ -2912,6 +3417,7 @@ export interface HostedInputConfig {
2912
3417
  export type InputSource = IHeadlessHostedInput | "cardholderName" | undefined;
2913
3418
  declare class HostedInputController<T extends HostedInputHost> implements ReactiveController {
2914
3419
  private _isFocused;
3420
+ private _meta;
2915
3421
  private _hostedInput;
2916
3422
  private _standardInput;
2917
3423
  private readonly host;
@@ -2956,6 +3462,8 @@ declare class HostedInputController<T extends HostedInputHost> implements Reacti
2956
3462
  private setupHostedIframeInput;
2957
3463
  /** Exposes the current focus state. */
2958
3464
  get isFocused(): boolean;
3465
+ /** Exposes the current metadata state. */
3466
+ get meta(): InputMetadata;
2959
3467
  hostConnected(): void;
2960
3468
  hostDisconnected(): void;
2961
3469
  }
@@ -2987,6 +3495,7 @@ export interface InputComponentConfig {
2987
3495
  }
2988
3496
  declare abstract class AbstractCardInputComponent extends LitElement implements HostedInputHost {
2989
3497
  cardFormContext: CardFormContext | null;
3498
+ computedStyles: CSSStyleDeclaration | null;
2990
3499
  /** Tracks which properties were explicitly set by the user */
2991
3500
  protected readonly _userAssignedProps: Set<string>;
2992
3501
  /** Internal storage for property values */
@@ -3031,10 +3540,19 @@ declare abstract class AbstractCardInputComponent extends LitElement implements
3031
3540
  * This is still needed for hosted iframe inputs
3032
3541
  */
3033
3542
  private handleWrapperClick;
3543
+ /**
3544
+ * Get the error code from the hosted input controller when the input is submitted or touched
3545
+ *
3546
+ * Can be used instead of the error returned by the `validate()` method since internally `primer-sdk-web`
3547
+ * uses the same logic to compute the error code
3548
+ *
3549
+ * @returns {string|null}
3550
+ */
3551
+ getError(): string | null;
3034
3552
  /**
3035
3553
  * Common rendering logic for all card input components
3036
3554
  */
3037
- protected renderInput(): TemplateResult<1> | typeof nothing;
3555
+ protected renderInput(): typeof nothing | TemplateResult<1>;
3038
3556
  }
3039
3557
  declare class InputCardNumberComponent extends AbstractCardInputComponent {
3040
3558
  static styles: CSSResult[];
@@ -3050,8 +3568,8 @@ declare class InputCardNumberComponent extends AbstractCardInputComponent {
3050
3568
  /**
3051
3569
  * Override the renderInput method to include the network selector
3052
3570
  */
3053
- protected renderInput(): TemplateResult<1> | typeof nothing;
3054
- render(): TemplateResult<1> | typeof nothing;
3571
+ protected renderInput(): typeof nothing | TemplateResult<1>;
3572
+ render(): typeof nothing | TemplateResult<1>;
3055
3573
  }
3056
3574
  declare global {
3057
3575
  interface HTMLElementTagNameMap {
@@ -3062,7 +3580,7 @@ declare class InputCvvComponent extends AbstractCardInputComponent {
3062
3580
  static styles: CSSResult[];
3063
3581
  protected readonly config: InputComponentConfig;
3064
3582
  constructor();
3065
- render(): TemplateResult<1> | typeof nothing;
3583
+ render(): typeof nothing | TemplateResult<1>;
3066
3584
  }
3067
3585
  declare global {
3068
3586
  interface HTMLElementTagNameMap {
@@ -3073,7 +3591,7 @@ declare class InputCardExpiryComponent extends AbstractCardInputComponent {
3073
3591
  static styles: CSSResult[];
3074
3592
  protected readonly config: InputComponentConfig;
3075
3593
  constructor();
3076
- render(): TemplateResult<1> | typeof nothing;
3594
+ render(): typeof nothing | TemplateResult<1>;
3077
3595
  }
3078
3596
  declare global {
3079
3597
  interface HTMLElementTagNameMap {
@@ -3085,13 +3603,14 @@ declare class InputCardHolderNameComponent extends AbstractCardInputComponent {
3085
3603
  protected readonly config: InputComponentConfig;
3086
3604
  constructor();
3087
3605
  private handleInput;
3088
- render(): TemplateResult<1> | typeof nothing;
3606
+ render(): typeof nothing | TemplateResult<1>;
3089
3607
  }
3090
3608
  declare global {
3091
3609
  interface HTMLElementTagNameMap {
3092
3610
  "primer-input-card-holder-name": InputCardHolderNameComponent;
3093
3611
  }
3094
3612
  }
3613
+ export type ClientOptionsContext = PrimerCheckoutOptions | null;
3095
3614
  declare class CardFormSubmitComponent extends LitElement {
3096
3615
  static styles: CSSResult[];
3097
3616
  private readonly _userAssignedProps;
@@ -3102,6 +3621,9 @@ declare class CardFormSubmitComponent extends LitElement {
3102
3621
  */
3103
3622
  get buttonText(): string;
3104
3623
  set buttonText(value: string);
3624
+ headlessInstance: HeadlessUnitilsContext;
3625
+ clientOptions: ClientOptionsContext;
3626
+ sdkState: SdkStateContext;
3105
3627
  /**
3106
3628
  * The button variant to use.
3107
3629
  * @default "primary"
@@ -3125,7 +3647,8 @@ declare class CardNetworkSelectorComponent extends LitElement {
3125
3647
  /**
3126
3648
  * Card networks context from provider
3127
3649
  */
3128
- cardNetworks: CardNetworksContext | null;
3650
+ cardNetworks: CardNetworksContext;
3651
+ headlessUtils: HeadlessUnitilsContext;
3129
3652
  private selectedCardNetwork;
3130
3653
  /**
3131
3654
  * Internal state to track if dropdown is open
@@ -3155,6 +3678,7 @@ declare class CardNetworkSelectorComponent extends LitElement {
3155
3678
  * Toggle the dropdown state
3156
3679
  */
3157
3680
  private toggleDropdown;
3681
+ private getNetworkIconUrl;
3158
3682
  /**
3159
3683
  * Get selectable networks from context
3160
3684
  */
@@ -3192,11 +3716,17 @@ declare class CardNetworkSelectorComponent extends LitElement {
3192
3716
  */
3193
3717
  private setNetworkOptionRef;
3194
3718
  /**
3195
- * Lifecycle: Add document event listener when connected
3719
+ * Attach event listener to the component for keydown events
3720
+ * and to document for click outside and mousemove
3196
3721
  */
3197
3722
  connectedCallback(): void;
3198
3723
  /**
3199
- * Lifecycle: Remove document event listener when disconnected
3724
+ * Handle document-level keydown events, but only when dropdown is open
3725
+ * This allows keyboard navigation to continue working
3726
+ */
3727
+ private handleDocumentKeyDown;
3728
+ /**
3729
+ * Lifecycle: Remove all event listeners when disconnected
3200
3730
  */
3201
3731
  disconnectedCallback(): void;
3202
3732
  render(): TemplateResult<1>;
@@ -3211,6 +3741,358 @@ declare global {
3211
3741
  "primer-card-form": CardFormComponent;
3212
3742
  }
3213
3743
  }
3744
+ /**
3745
+ * Events emitted by the vault manager components
3746
+ */
3747
+ export interface VaultManagerEvents {
3748
+ deletePaymentMethod: CustomEvent<string>;
3749
+ cancelDelete: CustomEvent<void>;
3750
+ confirmDelete: CustomEvent<void>;
3751
+ toggleEditMode: CustomEvent<boolean>;
3752
+ closeError: CustomEvent<void>;
3753
+ vaultPaymentError: CustomEvent<{
3754
+ error: Error | unknown;
3755
+ }>;
3756
+ }
3757
+ /**
3758
+ * Declare the event map for strict typing of events
3759
+ */
3760
+ export interface VaultManagerEventMap {
3761
+ "delete-payment-method": VaultManagerEvents["deletePaymentMethod"];
3762
+ "cancel-delete": VaultManagerEvents["cancelDelete"];
3763
+ "confirm-delete": VaultManagerEvents["confirmDelete"];
3764
+ "toggle-edit-mode": VaultManagerEvents["toggleEditMode"];
3765
+ "close-error": VaultManagerEvents["closeError"];
3766
+ "primer-vault-payment-error": VaultManagerEvents["vaultPaymentError"];
3767
+ }
3768
+ declare class VaultManagerComponent extends LitElement {
3769
+ static styles: CSSResult[];
3770
+ /**
3771
+ * Strongly typed event declarations
3772
+ */
3773
+ addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3774
+ removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3775
+ /**
3776
+ * The vault manager core context from the SDK
3777
+ * Contains vault-related functionality and state
3778
+ */
3779
+ vaultManagerContext: VaultManagerContext;
3780
+ /**
3781
+ * Whether we're in edit mode
3782
+ */
3783
+ private isEditMode;
3784
+ /**
3785
+ * Payment method being deleted
3786
+ */
3787
+ private deletePaymentMethodId;
3788
+ /**
3789
+ * Whether a delete operation is in progress
3790
+ */
3791
+ private isDeleting;
3792
+ /**
3793
+ * Error message if something goes wrong
3794
+ */
3795
+ private errorMessage;
3796
+ /**
3797
+ * Toggle edit mode handler
3798
+ */
3799
+ private handleToggleEditMode;
3800
+ /**
3801
+ * Handle delete click from payment method item
3802
+ */
3803
+ private handleDeletePaymentMethod;
3804
+ /**
3805
+ * Cancel delete operation
3806
+ */
3807
+ private handleCancelDelete;
3808
+ /**
3809
+ * Confirm and process payment method deletion
3810
+ */
3811
+ private handleConfirmDelete;
3812
+ /**
3813
+ * Handle payment error events
3814
+ */
3815
+ private handlePaymentError;
3816
+ /**
3817
+ * Handle closing error message
3818
+ */
3819
+ private handleCloseError;
3820
+ /**
3821
+ * Get payment method display name for the given ID
3822
+ */
3823
+ private getPaymentMethodName;
3824
+ /**
3825
+ * Render the delete confirmation for the current payment method
3826
+ */
3827
+ private renderDeleteConfirmation;
3828
+ /**
3829
+ * Render a payment method item
3830
+ */
3831
+ private renderPaymentMethodItem;
3832
+ render(): typeof nothing | TemplateResult<1>;
3833
+ }
3834
+ declare class VaultPaymentMethodItemComponent extends LitElement {
3835
+ static styles: CSSResult[];
3836
+ /**
3837
+ * Strongly typed event declarations
3838
+ */
3839
+ addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3840
+ removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3841
+ /**
3842
+ * Consume the vault manager context
3843
+ */
3844
+ vaultManagerContext: VaultManagerContext;
3845
+ vaultItemContext: VaultItemContext;
3846
+ headlessUtils: HeadlessUnitilsContext;
3847
+ /**
3848
+ * The payment method to display
3849
+ */
3850
+ paymentMethod: VaultedPaymentMethod | null;
3851
+ /**
3852
+ * Whether the component is in edit mode
3853
+ */
3854
+ isEditMode: boolean;
3855
+ private _getAssetsTask;
3856
+ /**
3857
+ * Check if this payment method is currently selected in the context
3858
+ */
3859
+ private isSelected;
3860
+ /**
3861
+ * Handle when the button is clicked
3862
+ * This is used to select the payment method and deselect others
3863
+ */
3864
+ private handleClick;
3865
+ /**
3866
+ * Dispatch delete event
3867
+ */
3868
+ private handleDeleteClick;
3869
+ /**
3870
+ * Builds the common content template shared between modes
3871
+ */
3872
+ private renderPaymentMethodContent;
3873
+ /**
3874
+ * Render method
3875
+ */
3876
+ render(): symbol | TemplateResult<1> | undefined;
3877
+ }
3878
+ declare global {
3879
+ interface HTMLElementTagNameMap {
3880
+ "primer-vault-payment-method-item": VaultPaymentMethodItemComponent;
3881
+ }
3882
+ }
3883
+ declare class VaultManagerHeaderComponent extends LitElement {
3884
+ static styles: CSSResult[];
3885
+ /**
3886
+ * Strongly typed event declarations
3887
+ */
3888
+ addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3889
+ removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3890
+ /**
3891
+ * Whether we're in edit mode
3892
+ */
3893
+ isEditMode: boolean;
3894
+ /**
3895
+ * Whether we have payment methods to edit
3896
+ */
3897
+ hasPaymentMethods: boolean;
3898
+ /**
3899
+ * Toggle edit mode
3900
+ */
3901
+ private toggleEditMode;
3902
+ /**
3903
+ * Render method
3904
+ */
3905
+ protected render(): TemplateResult<1>;
3906
+ }
3907
+ declare global {
3908
+ interface HTMLElementTagNameMap {
3909
+ "primer-vault-manager-header": VaultManagerHeaderComponent;
3910
+ }
3911
+ }
3912
+ declare class VaultDeleteConfirmationComponent extends LitElement {
3913
+ static styles: CSSResult[];
3914
+ /**
3915
+ * Strongly typed event declarations
3916
+ */
3917
+ addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3918
+ removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3919
+ /**
3920
+ * Whether a delete operation is in progress
3921
+ */
3922
+ isDeleting: boolean;
3923
+ /**
3924
+ * The ID of the payment method being deleted
3925
+ */
3926
+ paymentMethodId: string;
3927
+ /**
3928
+ * Payment method name to display in confirmation
3929
+ */
3930
+ paymentMethodName: string;
3931
+ /**
3932
+ * Consume the vault manager context to access payment method info
3933
+ */
3934
+ vaultManager: VaultManagerContext;
3935
+ /**
3936
+ * Handle confirm click
3937
+ */
3938
+ private handleConfirmClick;
3939
+ /**
3940
+ * Handle cancel click
3941
+ */
3942
+ private handleCancelClick;
3943
+ /**
3944
+ * Render method
3945
+ */
3946
+ protected render(): TemplateResult<1>;
3947
+ }
3948
+ declare global {
3949
+ interface HTMLElementTagNameMap {
3950
+ "primer-vault-delete-confirmation": VaultDeleteConfirmationComponent;
3951
+ }
3952
+ }
3953
+ declare class VaultEmptyStateComponent extends LitElement {
3954
+ static styles: CSSResult[];
3955
+ /**
3956
+ * Render method
3957
+ */
3958
+ protected render(): TemplateResult<1>;
3959
+ }
3960
+ declare global {
3961
+ interface HTMLElementTagNameMap {
3962
+ "primer-vault-empty-state": VaultEmptyStateComponent;
3963
+ }
3964
+ }
3965
+ declare class VaultErrorMessageComponent extends LitElement {
3966
+ static styles: CSSResult[];
3967
+ /**
3968
+ * Strongly typed event declarations
3969
+ */
3970
+ addEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3971
+ removeEventListener: <K extends keyof VaultManagerEventMap>(type: K, listener: (ev: VaultManagerEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void;
3972
+ /**
3973
+ * The error message to display
3974
+ */
3975
+ errorMessage: string;
3976
+ /**
3977
+ * Handle dismiss click
3978
+ */
3979
+ private handleDismiss;
3980
+ /**
3981
+ * Render method
3982
+ */
3983
+ protected render(): TemplateResult<1>;
3984
+ }
3985
+ declare global {
3986
+ interface HTMLElementTagNameMap {
3987
+ "primer-vault-error-message": VaultErrorMessageComponent;
3988
+ }
3989
+ }
3990
+ declare class VaultPaymentSubmitComponent extends LitElement {
3991
+ static styles: CSSResult[];
3992
+ private readonly _userAssignedProps;
3993
+ private _internalButtonText;
3994
+ /**
3995
+ * The button text to display.
3996
+ * Falls back to localized default if not explicitly set.
3997
+ */
3998
+ get buttonText(): string;
3999
+ set buttonText(value: string);
4000
+ headlessInstance: HeadlessUnitilsContext;
4001
+ sdkState: SdkStateContext;
4002
+ vaultItemContext: VaultItemContext;
4003
+ vaultManager: VaultManagerContext;
4004
+ clientOptions: PrimerCheckoutOptions | null;
4005
+ /**
4006
+ * The button variant to use.
4007
+ * @default "primary"
4008
+ */
4009
+ variant: string;
4010
+ /**
4011
+ * Whether the button is disabled.
4012
+ * This property allows external disabling of the button
4013
+ * regardless of the context state.
4014
+ * @default false
4015
+ */
4016
+ disabled: boolean;
4017
+ /**
4018
+ * Handle button click event.
4019
+ * Prevents default form submission and triggers the vault payment flow.
4020
+ */
4021
+ private handleClick;
4022
+ /**
4023
+ * Computed property to determine if the button should be disabled
4024
+ */
4025
+ private get isButtonDisabled();
4026
+ render(): TemplateResult<1>;
4027
+ }
4028
+ declare global {
4029
+ interface HTMLElementTagNameMap {
4030
+ "primer-vault-payment-submit": VaultPaymentSubmitComponent;
4031
+ }
4032
+ }
4033
+ declare class VaultCvvInputComponent extends LitElement {
4034
+ static styles: CSSResult[];
4035
+ /**
4036
+ * Form context for checking form dirty state
4037
+ */
4038
+ vaultManagerFormContext: VaultManagerContext;
4039
+ /**
4040
+ * CVV-specific context for dedicated CVV handling
4041
+ * Separated to minimize re-renders on frequent CVV input changes
4042
+ */
4043
+ vaultManagerCvvContext: VaultItemContext;
4044
+ computedStyles: CSSStyleDeclaration | null;
4045
+ paymentMethod: PaymentCardVaultedMethod | null;
4046
+ private cvvError;
4047
+ private cvvInputIsDirty;
4048
+ private cvvInputIsBlurred;
4049
+ private cvvInput;
4050
+ /**
4051
+ * Unique ID for the CVV input container
4052
+ */
4053
+ private readonly cvvContainerId;
4054
+ private _setupCVVIframe;
4055
+ constructor();
4056
+ disconnectedCallback(): void;
4057
+ /**
4058
+ * Update CVV metadata in the context when input changes
4059
+ */
4060
+ onCvvInputChange(): void;
4061
+ onBlur(): void;
4062
+ /**
4063
+ * Main render method
4064
+ */
4065
+ protected render(): symbol | TemplateResult<1> | undefined;
4066
+ }
4067
+ declare global {
4068
+ interface HTMLElementTagNameMap {
4069
+ "primer-vault-cvv-input": VaultCvvInputComponent;
4070
+ }
4071
+ }
4072
+ declare global {
4073
+ interface HTMLElementTagNameMap {
4074
+ "primer-vault-manager": VaultManagerComponent;
4075
+ }
4076
+ }
4077
+ declare class ShowOtherPaymentsComponent extends LitElement {
4078
+ static styles: CSSResult[];
4079
+ private isShowingOtherPayments;
4080
+ /**
4081
+ * Consume the vault manager context to interact with vault state
4082
+ */
4083
+ vaultManager: VaultManagerContext;
4084
+ /**
4085
+ * Handle expanded state change events from the collapsable component
4086
+ * Syncs the collapsable UI state with the vault manager state
4087
+ */
4088
+ private handleExpandedChanged;
4089
+ render(): typeof nothing | TemplateResult<1>;
4090
+ }
4091
+ declare global {
4092
+ interface HTMLElementTagNameMap {
4093
+ "primer-show-other-payments": ShowOtherPaymentsComponent;
4094
+ }
4095
+ }
3214
4096
  declare class PrimerCheckoutCompleteComponent extends LitElement {
3215
4097
  render(): TemplateResult<1>;
3216
4098
  }
@@ -3219,19 +4101,35 @@ declare global {
3219
4101
  "primer-checkout-complete": PrimerCheckoutCompleteComponent;
3220
4102
  }
3221
4103
  }
3222
- export interface HeadlessSDKState {
3223
- isProcessing: boolean;
3224
- isSuccessful: boolean;
3225
- isFailure: boolean;
3226
- error?: Error | undefined;
3227
- }
3228
- declare class PrimerCheckoutFailureComponent extends LitElement {
3229
- sdkState: HeadlessSDKState | undefined;
4104
+ declare class PrimerCheckoutErrorComponent extends LitElement {
4105
+ sdkState: SdkStateContext;
3230
4106
  render(): TemplateResult<1>;
3231
4107
  }
3232
4108
  declare global {
3233
4109
  interface HTMLElementTagNameMap {
3234
- "primer-checkout-failure": PrimerCheckoutFailureComponent;
4110
+ "primer-checkout-error": PrimerCheckoutErrorComponent;
4111
+ }
4112
+ }
4113
+ declare class ErrorMessageContainerComponent extends LitElement {
4114
+ static styles: CSSResult[];
4115
+ /**
4116
+ * Consume the SDK state context
4117
+ * This automatically subscribes to changes in the SDK state
4118
+ */
4119
+ protected sdkState?: SdkStateContext;
4120
+ showProcessingErrors: boolean;
4121
+ /**
4122
+ * Determine if an error should be shown
4123
+ * Takes into account the current SDK state and component configuration
4124
+ *
4125
+ * @returns Boolean indicating whether an error should be shown
4126
+ */
4127
+ private get shouldShowError();
4128
+ render(): typeof nothing | TemplateResult<1>;
4129
+ }
4130
+ declare global {
4131
+ interface HTMLElementTagNameMap {
4132
+ "primer-error-message-container": ErrorMessageContainerComponent;
3235
4133
  }
3236
4134
  }
3237
4135
  declare global {
@@ -3239,11 +4137,5 @@ declare global {
3239
4137
  "primer-checkout": PrimerCheckoutComponent;
3240
4138
  }
3241
4139
  }
3242
- type PaymentsObject$1 = PaymentsObject;
3243
- export declare function loadPrimer(): Promise<void>;
3244
-
3245
- export {
3246
- PaymentsObject$1 as PaymentsObject,
3247
- };
3248
4140
 
3249
4141
  export {};