@forgeroute/ui 0.4.3 → 0.4.5

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.
@@ -0,0 +1,1144 @@
1
+ import * as i0 from "@angular/core";
2
+ import { InjectionToken, Provider } from "@angular/core";
3
+ /**
4
+ * The small part of Stripe.js the library calls, written as plain structural types so the library has NO compile-time or run-time
5
+ * dependency on `@stripe/stripe-js` outside of the lazy loader (`stripe-loader.ts`). The real `Stripe` object satisfies these; so does a hand-written fake.
6
+ */
7
+ /** A Stripe.js error object (`result.error`). */
8
+ interface StripeErrorLike {
9
+ type?: string;
10
+ code?: string;
11
+ decline_code?: string;
12
+ message?: string;
13
+ }
14
+ /** The `next_action` of an intent that needs the customer to verify a bank account with micro-deposits. */
15
+ interface StripeMicrodepositNextAction {
16
+ arrival_date?: number;
17
+ hosted_verification_url?: string;
18
+ microdeposit_type?: string;
19
+ }
20
+ /** A PaymentIntent or a SetupIntent as returned by Stripe.js (only the fields the library reads). */
21
+ interface StripeIntentLike {
22
+ id: string;
23
+ status: string;
24
+ client_secret?: string | null;
25
+ amount?: number;
26
+ payment_method?: string | {
27
+ id: string;
28
+ } | null;
29
+ next_action?: {
30
+ type?: string;
31
+ verify_with_microdeposits?: StripeMicrodepositNextAction;
32
+ } | null;
33
+ }
34
+ interface StripePaymentElementLike {
35
+ mount(target: string | HTMLElement): void;
36
+ destroy(): void;
37
+ on(event: string, handler: (event: any) => void): void;
38
+ update?(options: Record<string, unknown>): void;
39
+ }
40
+ interface StripeElementsLike {
41
+ create(type: 'payment', options?: Record<string, unknown>): StripePaymentElementLike;
42
+ submit(): Promise<{
43
+ error?: StripeErrorLike;
44
+ }>;
45
+ update?(options: Record<string, unknown>): void;
46
+ fetchUpdates?(): Promise<{
47
+ error?: StripeErrorLike;
48
+ }>;
49
+ }
50
+ interface StripeConfirmResult<I> {
51
+ error?: StripeErrorLike;
52
+ paymentIntent?: I;
53
+ setupIntent?: I;
54
+ }
55
+ /** The Stripe.js object (`Stripe`). Methods the library calls only in some flows are optional so a fake can leave them out. */
56
+ interface StripeLike {
57
+ elements(options?: Record<string, unknown>): StripeElementsLike;
58
+ confirmPayment(params: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;
59
+ confirmSetup(params: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;
60
+ handleCardAction?(clientSecret: string): Promise<StripeConfirmResult<StripeIntentLike>>;
61
+ retrievePaymentIntent?(clientSecret: string): Promise<StripeConfirmResult<StripeIntentLike>>;
62
+ retrieveSetupIntent?(clientSecret: string): Promise<StripeConfirmResult<StripeIntentLike>>;
63
+ verifyMicrodepositsForPayment?(clientSecret: string, data?: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;
64
+ verifyMicrodepositsForSetup?(clientSecret: string, data?: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;
65
+ }
66
+ /** The second argument of `loadStripe(key, options)`. */
67
+ interface StripeLoadOptions {
68
+ /** A Stripe Connect account id (`acct_...`): direct charges / saved methods on the connected account. */
69
+ stripeAccount?: string;
70
+ locale?: string;
71
+ apiVersion?: string;
72
+ betas?: string[];
73
+ }
74
+ /**
75
+ * Loads Stripe.js: `loader(publishableKey, options)` resolves the `Stripe` object (or `null` when it could not be created).
76
+ * It is called exactly like `loadStripe(key, options)` from `@stripe/stripe-js`: the second argument is `undefined` unless a Connect
77
+ * account / locale / other option is set.
78
+ */
79
+ type StripeLoaderFn = (publishableKey: string, options?: StripeLoadOptions) => Promise<StripeLike | null>;
80
+ /** The dynamic import of the Stripe SDK, behind an object so a spec can replace it (internal: not part of the public API). */
81
+ declare const sdkImporter: {
82
+ load: () => Promise<{
83
+ loadStripe: (key: string, options?: never) => Promise<unknown>;
84
+ }>;
85
+ };
86
+ /**
87
+ * The default loader. `@stripe/stripe-js` is imported lazily (a dynamic import), so the Stripe SDK is only downloaded when a
88
+ * payment form is actually shown, and it is an optional peer dependency of the library.
89
+ */
90
+ export declare const defaultStripeLoader: StripeLoaderFn;
91
+ /** How Stripe.js is loaded. Provide your own to fake Stripe in tests or to load it differently. Defaults to `defaultStripeLoader`. */
92
+ export declare const STRIPE_LOADER: InjectionToken<StripeLoaderFn>;
93
+ /** App-wide defaults for every `ui-stripe-payment`, set once with `provideStripePayment`. A value on the component always wins. */
94
+ interface StripePaymentDefaults {
95
+ /** The publishable key (`pk_...`), used when the component has no `publishableKey` of its own. */
96
+ publishableKey?: string;
97
+ /** Stripe.js locale (`'en'`, `'es'`, ...): passed to `loadStripe` as `{ locale }`. */
98
+ locale?: string;
99
+ }
100
+ export declare const STRIPE_PAYMENT_DEFAULTS: InjectionToken<StripePaymentDefaults>;
101
+ interface ProvideStripePaymentOptions extends StripePaymentDefaults {
102
+ /** Replaces how Stripe.js is loaded (tests, a self-hosted loader). */
103
+ loader?: StripeLoaderFn;
104
+ }
105
+ /**
106
+ * Global defaults for the Stripe components:
107
+ *
108
+ * providers: [provideStripePayment({ publishableKey: environment.stripePublishableKey, locale: 'en' })]
109
+ */
110
+ export declare function provideStripePayment(options?: ProvideStripePaymentOptions): Provider[];
111
+ /** `loadStripe`'s second argument for a Connect account / locale / extra options; `undefined` when there is nothing to pass (like the apps do today). */
112
+ export declare function buildLoadOptions(stripeAccount: string | null | undefined, locale: string | null | undefined, extra?: StripeLoadOptions | null): StripeLoadOptions | undefined;
113
+ /**
114
+ * Plain-language text for the Stripe decline / error codes (https://docs.stripe.com/declines/codes). One table for every app; an app can replace single entries
115
+ * with the `errorMessages` input of `ui-stripe-payment` (or the `overrides` option of `getStripeErrorMessage`).
116
+ */
117
+ export declare const STRIPE_ERROR_MESSAGES: Readonly<Record<string, string>>;
118
+ /** Text for the Stripe error types that are about Stripe or the connection, never about the customer's input (Stripe's own text there is technical). */
119
+ export declare const STRIPE_TECHNICAL_ERROR_MESSAGES: Readonly<Record<string, string>>;
120
+ export declare const STRIPE_DEFAULT_ERROR_MESSAGE = "Payment failed. Please try again.";
121
+ declare const STRIPE_ALREADY_PROCESSED_MESSAGE = "This payment has already been processed. Please refresh the page and try again.";
122
+ declare const STRIPE_SESSION_EXPIRED_MESSAGE = "Your payment session has expired. Please refresh the page and try again.";
123
+ type StripeErrorDisplay = 'friendly' | 'table' | 'stripe';
124
+ interface StripeErrorMessageOptions {
125
+ /**
126
+ * `'friendly'` (default): the table above first, then Stripe's own text for card / validation errors (customer-facing) and plain text for technical errors.
127
+ * `'table'`: the table, then Stripe's own `message` for EVERYTHING else, technical errors included (what the cremo payment flows show today).
128
+ * `'stripe'`: Stripe's own `message` untouched (what the apps that show `error.message` do), the fallback when there is none.
129
+ */
130
+ display?: StripeErrorDisplay;
131
+ /** Text for single codes; wins over the table. */
132
+ overrides?: Readonly<Record<string, string>> | null;
133
+ /** Shown when there is nothing better. */
134
+ fallback?: string;
135
+ }
136
+ /**
137
+ * The text to show the customer for a Stripe.js error.
138
+ * Friendly mode order: decline_code, code, the two technical Stripe messages ("already succeeded" / "previously confirmed", "expired"),
139
+ * technical error types, Stripe's own message, the fallback. Table mode is the same without the technical error types.
140
+ */
141
+ export declare function getStripeErrorMessage(error: StripeErrorLike | null | undefined, options?: StripeErrorMessageOptions): string;
142
+ type StripeIntentKind = 'setup' | 'payment';
143
+ /**
144
+ * What happened, in one word:
145
+ * - `succeeded`: the intent succeeded (card charged / method saved).
146
+ * - `processing`: the payment was accepted and is settling (a bank debit takes days).
147
+ * - `requires_verification`: a bank account was entered by number; Stripe sent micro-deposits and the customer has to verify them (see `verification`).
148
+ * - `requires_action`: the intent still needs the customer to do something else (3D Secure, a redirect-less next action).
149
+ * - `requires_capture`: the payment is authorized and waits for the host to capture it (`captureMethod: 'manual'`).
150
+ * - `requires_payment_method`: Stripe sends the intent back for a new payment method (the payment failed).
151
+ * - `canceled` / `unknown`: any other status.
152
+ */
153
+ type StripeOutcome = 'succeeded' | 'processing' | 'requires_verification' | 'requires_action' | 'requires_capture' | 'requires_payment_method' | 'canceled' | 'unknown';
154
+ /** What the customer has to do to verify a bank account (`next_action.verify_with_microdeposits`). */
155
+ interface StripeVerification {
156
+ /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `null` when Stripe did not say. */
157
+ type: 'amounts' | 'descriptor_code' | null;
158
+ /** When the deposits should have arrived: Unix seconds as Stripe sends it, and the same instant as an ISO string. `null` when unknown. */
159
+ arrivalDate: number | null;
160
+ arrivalDateIso: string | null;
161
+ /** Stripe's own page where the customer can verify (https), or `null`. */
162
+ hostedVerificationUrl: string | null;
163
+ }
164
+ /** The normalised result of a confirmation (or of `handleReturn`). */
165
+ interface StripeConfirmedEvent {
166
+ kind: StripeIntentKind;
167
+ /** Stripe's own `status` of the intent. */
168
+ status: string;
169
+ outcome: StripeOutcome;
170
+ /** The intent exactly as Stripe.js returned it. */
171
+ intent: StripeIntentLike;
172
+ setupIntent?: StripeIntentLike;
173
+ paymentIntent?: StripeIntentLike;
174
+ intentId: string;
175
+ /** The payment method of the intent as an id (`pm_...`), whether Stripe sent it as a string or an object; `null` when there is none. */
176
+ paymentMethodId: string | null;
177
+ /** Set when `outcome` is `requires_verification`. */
178
+ verification: StripeVerification | null;
179
+ /** The 3D Secure step (`stripe.handleCardAction`) ran before this result (`autoHandleCardAction` / `handleNextAction`). Hosts use it for their post-3DS wording. */
180
+ actionHandled: boolean;
181
+ }
182
+ /** Why a flow stopped. */
183
+ type StripeFailureStage = 'load' | 'submit' | 'intent' | 'confirm' | 'action' | 'result' | 'verify' | 'return';
184
+ /** A failure: `message` is what to show the customer; `stripeMessage` is Stripe's own text. */
185
+ interface StripeFailure {
186
+ code: string;
187
+ message: string;
188
+ stripeMessage: string;
189
+ declineCode?: string;
190
+ type?: string;
191
+ stage: StripeFailureStage;
192
+ /** The Stripe error as returned, when there was one. */
193
+ error?: StripeErrorLike;
194
+ /** True when the failure happened in or after the 3D Secure step. */
195
+ actionHandled?: boolean;
196
+ /** Stripe's status of the intent when the failure is about the intent's status (`requires_payment_method`, `canceled`, ...). */
197
+ status?: string;
198
+ }
199
+ /** The payment method type the Payment Element currently shows (`'card'`, `'us_bank_account'`, ...) and its completeness. */
200
+ interface StripeElementChange {
201
+ complete: boolean;
202
+ empty: boolean;
203
+ /** The selected payment method type, `null` when Stripe did not send one. */
204
+ type: string | null;
205
+ /** Stripe's own validation message for the form, when it shows one. */
206
+ errorMessage: string | null;
207
+ }
208
+ declare const MSG_NOT_INITIALIZED = "Payment system not initialized";
209
+ declare const MSG_INTENT_FAILED = "Failed to create payment intent";
210
+ declare const MSG_NOT_COMPLETED = "Payment was not completed";
211
+ declare const MSG_REQUIRES_PAYMENT_METHOD = "Payment failed. Please try a different payment method.";
212
+ declare const MSG_NO_PAYMENT_METHOD = "No payment method returned from Stripe";
213
+ declare const MSG_AUTH_FAILED = "Payment authentication failed";
214
+ declare const MSG_AUTH_NOT_COMPLETED = "Payment authentication was not completed";
215
+ declare const MSG_KEY_MISSING = "A Stripe publishable key is required";
216
+ declare const MSG_LOAD_FAILED = "Failed to load Stripe";
217
+ export declare function paymentMethodIdOf(intent: StripeIntentLike | null | undefined): string | null;
218
+ /** The micro-deposit verification of an intent whose `next_action` is `verify_with_microdeposits`, else `null`. */
219
+ export declare function verificationOf(intent: StripeIntentLike | null | undefined): StripeVerification | null;
220
+ /** Stripe's intent `status` (and `next_action`) as one `StripeOutcome`. */
221
+ export declare function outcomeOf(intent: StripeIntentLike): StripeOutcome;
222
+ export declare function normalizeIntent(kind: StripeIntentKind, intent: StripeIntentLike): StripeConfirmedEvent;
223
+ /** A failure from a Stripe error, with the text to show chosen by `display` (see `getStripeErrorMessage`). */
224
+ declare function failureFromError(error: StripeErrorLike | null | undefined, stage: StripeFailureStage, options?: StripeErrorMessageOptions): StripeFailure;
225
+ /** A failure that is not a Stripe error (our own text). */
226
+ declare function failure(code: string, message: string, stage: StripeFailureStage, stripeMessage?: string): StripeFailure;
227
+ /** An error thrown by a host callback or a request: its own `error.error.message` (HTTP body), `message`, else the fallback. */
228
+ declare function messageOfThrown(err: unknown, fallback: string): string;
229
+ /** The Stripe object with `confirmUsBankAccountSetup`, for an app that keeps its own routing-number form (contractor). Use it as the type argument of `StripePaymentService.load`. */
230
+ interface StripeLikeWithBankSetup extends StripeLike {
231
+ confirmUsBankAccountSetup(clientSecret: string, data?: Record<string, unknown>): Promise<StripeConfirmResult<StripeIntentLike>>;
232
+ }
233
+ /** What `stripe.verifyMicrodepositsFor*` takes: the two deposit amounts in cents, or the 6-character code of the one deposit. */
234
+ type MicrodepositVerifyData = {
235
+ amounts: number[];
236
+ } | {
237
+ descriptor_code: string;
238
+ };
239
+ interface StripeMicrodepositResult {
240
+ /** The intent is verified (`processing` or `succeeded`). */
241
+ ok: boolean;
242
+ outcome: StripeOutcome | null;
243
+ intent: StripeIntentLike | null;
244
+ /** Set when `ok` is false. `message` is Stripe's own text (customer-facing for a wrong amount / code) or ours. */
245
+ failure: StripeFailure | null;
246
+ }
247
+ /** What Stripe appends to the return URL after a redirect (`payment_intent_client_secret` / `setup_intent_client_secret`, `redirect_status`). */
248
+ interface StripeReturnParams {
249
+ kind: StripeIntentKind;
250
+ clientSecret: string;
251
+ redirectStatus: string | null;
252
+ }
253
+ /** Reads the intent Stripe returned the customer with from a query string (`location.search`); `null` when there is none. */
254
+ export declare function readStripeReturnParams(search: string): StripeReturnParams | null;
255
+ declare const MSG_VERIFY_FAILED = "Verification failed";
256
+ declare const MSG_VERIFY_THROWN = "Verification failed. Please check the code and try again.";
257
+ declare const MSG_RETURN_FAILED = "We could not check the status of this payment. Please contact support before trying again.";
258
+ /**
259
+ * Verifies a bank account with micro-deposits through Stripe.js (`verifyMicrodepositsForPayment` / `verifyMicrodepositsForSetup`), the way the public
260
+ * "verify your bank" pages do it with the intent's client secret. The result is `ok` once the intent is `processing` or `succeeded`.
261
+ */
262
+ export declare function verifyMicrodeposits(stripe: StripeLike, flow: StripeIntentKind, clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult>;
263
+ interface StripeReturnResult {
264
+ event: StripeConfirmedEvent | null;
265
+ failure: StripeFailure | null;
266
+ }
267
+ /** Retrieves the intent after Stripe redirected the customer back (`retrievePaymentIntent` / `retrieveSetupIntent`) and normalises it. */
268
+ export declare function retrieveIntent(stripe: StripeLike, kind: StripeIntentKind, clientSecret: string): Promise<StripeReturnResult>;
269
+ interface StripeConnection {
270
+ publishableKey?: string | null;
271
+ /** A Stripe Connect account id. */
272
+ stripeAccount?: string | null;
273
+ locale?: string | null;
274
+ /** Further `loadStripe` options. */
275
+ options?: StripeLoadOptions | null;
276
+ }
277
+ interface HandleReturnOptions extends StripeConnection {
278
+ /** The client secret from the return URL. Default: read from `search`. */
279
+ clientSecret?: string;
280
+ /** Which kind of intent `clientSecret` belongs to (default: from the URL parameter name, else `'payment'`). */
281
+ kind?: StripeIntentKind;
282
+ /** The query string to read the return parameters from. Default: `window.location.search`. */
283
+ search?: string;
284
+ }
285
+ /**
286
+ * Stripe.js without a component: loads Stripe like `ui-stripe-payment` does, verifies micro-deposits and checks the intent after a redirect.
287
+ * For pages that only verify a bank account (the "verify your bank" link) or only land on the `returnUrl`.
288
+ */
289
+ export declare class StripePaymentService {
290
+ private readonly loader;
291
+ private readonly defaults;
292
+ /** Loads Stripe.js (`loadStripe(key, options)`). Pass a type for methods the library does not use: `load<StripeLikeWithBankSetup>(...)` (contractor's `confirmUsBankAccountSetup`). Throws when the key is missing or Stripe could not be created. */
293
+ load<T extends StripeLike = StripeLike>(connection?: StripeConnection): Promise<T>;
294
+ verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData, connection?: StripeConnection): Promise<StripeMicrodepositResult>;
295
+ verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData, connection?: StripeConnection): Promise<StripeMicrodepositResult>;
296
+ /** The intent the customer returned with, normalised. `{ event: null, failure: null }` when the URL carries no intent. */
297
+ handleReturn(options?: HandleReturnOptions): Promise<StripeReturnResult>;
298
+ private verify;
299
+ static ɵfac: i0.ɵɵFactoryDeclaration<StripePaymentService, never>;
300
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
301
+ }
302
+ /**
303
+ * The Payment Element `appearance` for the page's own look: Stripe's variables read from CSS custom properties at runtime, so one set of
304
+ * tokens styles the page and the payment form, in light and dark.
305
+ *
306
+ * :root { --ui-stripe-color-primary: #0d9488; --ui-stripe-border-radius: 8px; }
307
+ *
308
+ * Variables read (all optional; a missing one is left out so Stripe's default stays): `--ui-stripe-color-primary`, `--ui-stripe-color-background`,
309
+ * `--ui-stripe-color-text`, `--ui-stripe-color-danger`, `--ui-stripe-font-family`, `--ui-stripe-border-radius`, `--ui-stripe-font-size-base`.
310
+ * The theme is `night` when the page is dark (`data-theme="dark"`, or the system is dark and `data-theme` is not `light`), else `stripe`.
311
+ */
312
+ interface StripeAppearance {
313
+ theme?: 'stripe' | 'night' | 'flat';
314
+ variables?: Record<string, string>;
315
+ rules?: Record<string, Record<string, string>>;
316
+ labels?: 'above' | 'floating';
317
+ disableAnimations?: boolean;
318
+ }
319
+ /** True when the page is in dark mode: `data-theme="dark"` on the root, or the system prefers dark and the root is not forced to `light`. */
320
+ export declare function isDarkPage(doc: Document): boolean;
321
+ /** Builds the appearance from the tokens in effect on `element` (default: the document root). */
322
+ export declare function readStripeAppearance(doc: Document, element?: Element): StripeAppearance;
323
+ /** The texts of the screen-reader status region. */
324
+ interface StripeA11yMessages {
325
+ loading: string;
326
+ savingMethod: string;
327
+ processingPayment: string;
328
+ methodSaved: string;
329
+ paymentReceived: string;
330
+ paymentProcessing: string;
331
+ paymentAuthorized: string;
332
+ verificationNeeded: string;
333
+ actionRequired: string;
334
+ }
335
+ export declare const STRIPE_A11Y_MESSAGES: Readonly<StripeA11yMessages>;
336
+ /** The exact text shown while the bank-account tab is selected. */
337
+ export declare const STRIPE_ACH_NOTICE = "Signing in to your bank account lets you pay right away. Entering your routing and account numbers instead requires verification with two small deposits, which typically take a couple of days to arrive in your account.";
338
+ /**
339
+ * "Deferred intent" Elements: the form is shown first, the PaymentIntent / SetupIntent is created on the host's backend when the customer submits.
340
+ * Maps to `stripe.elements({ mode, amount, currency, setup_future_usage, payment_method_types, ... })`.
341
+ */
342
+ interface StripeDeferredIntent {
343
+ /** Default: the component's `mode`. */
344
+ mode?: 'payment' | 'setup' | 'subscription';
345
+ /** Smallest currency unit (cents). Changing it later calls `elements.update({ amount })` (no re-init). */
346
+ amount?: number;
347
+ currency: string;
348
+ setupFutureUsage?: 'on_session' | 'off_session';
349
+ captureMethod?: 'automatic' | 'automatic_async' | 'manual';
350
+ onBehalfOf?: string;
351
+ }
352
+ /** Called on submit in deferred mode: create the intent on your backend and resolve its client secret (or `{ clientSecret }`). */
353
+ type StripeCreateIntentFn = (context: {
354
+ mode: StripeIntentKind;
355
+ }) => Promise<string | {
356
+ clientSecret: string;
357
+ }>;
358
+ interface StripeBillingDetails {
359
+ name?: string;
360
+ email?: string;
361
+ phone?: string;
362
+ address?: Record<string, string | null | undefined>;
363
+ }
364
+ /**
365
+ * The live Stripe.js objects of a form, handed to the host by `(stripeReady)`: the host's own code can call `stripe.confirmPayment({ elements, ... })`,
366
+ * `elements.submit()`, `elements.update()`, `elements.fetchUpdates()` and `paymentElement.update()` with its own arguments.
367
+ */
368
+ interface StripeReadyEvent {
369
+ stripe: StripeLike;
370
+ elements: StripeElementsLike;
371
+ paymentElement: StripePaymentElementLike;
372
+ }
373
+ /**
374
+ * Stripe Payment Element: saves a payment method (`mode="setup"`, a SetupIntent) or takes a payment (`mode="payment"`, a PaymentIntent).
375
+ *
376
+ * The host app creates the intent on its backend and passes the `clientSecret` (or, for a deferred intent, `[deferred]` + `[createIntent]`).
377
+ * Stripe.js is loaded lazily through `@stripe/stripe-js` (an optional peer dependency); nothing of Stripe is in the library's static imports.
378
+ *
379
+ * <ui-stripe-payment mode="setup" [publishableKey]="key" [clientSecret]="secret()" submitLabel="Save card"
380
+ * (confirmed)="onSaved($event)" (failed)="onFailed($event)" />
381
+ *
382
+ * Every Stripe.js call and option reproduces what the CRM apps do today; see docs/stripe.md ("Parity with the existing app implementations").
383
+ */
384
+ export declare class StripePaymentComponent {
385
+ private readonly loader;
386
+ private readonly defaults;
387
+ private readonly doc;
388
+ private readonly isBrowser;
389
+ private readonly host;
390
+ /**
391
+ * Mount-only mode: the component only mounts the Payment Element. No submit button, skeleton, status text (unless `a11yMessages` is set), bank notice or error
392
+ * alert; it never submits, confirms or updates by itself; load failures go to `(loadError)` only. The host keeps its own confirm code and calls Stripe.js with the
393
+ * objects from `(stripeReady)`. `mountId` / `mountClass` still apply, and `(ready)`, `(elementChange)`, `(paymentMethodTypeChange)` still emit.
394
+ */
395
+ readonly mountOnly: import("@angular/core").InputSignal<boolean>;
396
+ /** `'setup'` saves a payment method (`confirmSetup`), `'payment'` takes a payment (`confirmPayment`). */
397
+ readonly mode: import("@angular/core").InputSignal<StripeIntentKind>;
398
+ /** The publishable key (`pk_...`). Falls back to `provideStripePayment({ publishableKey })`. */
399
+ readonly publishableKey: import("@angular/core").InputSignal<string | null>;
400
+ /** The client secret of the SetupIntent / PaymentIntent your backend created. Changing it re-creates the form. */
401
+ readonly clientSecret: import("@angular/core").InputSignal<string | null>;
402
+ /** Deferred intent: show the form first, create the intent on submit with `createIntent`. Used instead of `clientSecret`. */
403
+ readonly deferred: import("@angular/core").InputSignal<StripeDeferredIntent | null>;
404
+ /** Creates the intent on submit (deferred mode) and resolves its client secret. */
405
+ readonly createIntent: import("@angular/core").InputSignal<StripeCreateIntentFn | null>;
406
+ /** A Stripe Connect account id (`acct_...`): `loadStripe(key, { stripeAccount })`. */
407
+ readonly stripeAccount: import("@angular/core").InputSignal<string | null>;
408
+ /** Stripe.js locale. */
409
+ readonly locale: import("@angular/core").InputSignal<string | null>;
410
+ /** Further `loadStripe` options. */
411
+ readonly stripeOptions: import("@angular/core").InputSignal<StripeLoadOptions | null>;
412
+ /** Payment method types for a DEFERRED intent (`elements({ payment_method_types })`). With a client secret the intent decides, nothing is passed. */
413
+ readonly paymentMethodTypes: import("@angular/core").InputSignal<string[] | null>;
414
+ /** Extra `stripe.elements()` options, merged last. */
415
+ readonly elementsOptions: import("@angular/core").InputSignal<Record<string, unknown> | null>;
416
+ /** `'tabs'` (default), `'accordion'`, an object, or `null` to pass no layout. */
417
+ readonly layout: import("@angular/core").InputSignal<string | Record<string, unknown> | null>;
418
+ readonly paymentMethodOrder: import("@angular/core").InputSignal<string[] | null>;
419
+ /** `{ applePay: 'never', googlePay: 'never' }` hides the wallets. */
420
+ readonly wallets: import("@angular/core").InputSignal<Record<string, string> | null>;
421
+ /** `{ billingDetails: { email: 'never', phone: 'never', address: 'auto' } }` etc. */
422
+ readonly fields: import("@angular/core").InputSignal<Record<string, unknown> | null>;
423
+ /** Pre-filled values: `{ billingDetails: { name, email, address: { country: 'US' } } }`. A later change updates the element in place. */
424
+ readonly defaultValues: import("@angular/core").InputSignal<Record<string, unknown> | null>;
425
+ readonly business: import("@angular/core").InputSignal<{
426
+ name: string;
427
+ } | null>;
428
+ readonly terms: import("@angular/core").InputSignal<Record<string, string> | null>;
429
+ /** Extra Payment Element options, merged last (readOnly, fields, ...). */
430
+ readonly paymentElementOptions: import("@angular/core").InputSignal<Record<string, unknown> | null>;
431
+ /** The Elements appearance. */
432
+ readonly appearance: import("@angular/core").InputSignal<StripeAppearance | null>;
433
+ /** Derive the appearance from the `--ui-stripe-*` CSS tokens (light / dark) when no `appearance` is set. */
434
+ readonly appearanceFromTokens: import("@angular/core").InputSignal<boolean>;
435
+ /** Where Stripe sends the customer back after a redirect. Unset = the current page (`window.location.href`); `null` = pass no `return_url`. */
436
+ readonly returnUrl: import("@angular/core").InputSignal<string | null | undefined>;
437
+ /** Billing details sent on confirm (`confirmParams.payment_method_data.billing_details`), needed for fields hidden with `'never'`. */
438
+ readonly billingDetails: import("@angular/core").InputSignal<StripeBillingDetails | null>;
439
+ /** Extra `confirmParams`, merged last. */
440
+ readonly confirmParams: import("@angular/core").InputSignal<Record<string, unknown> | null>;
441
+ /** `'if_required'` (default) keeps the customer on the page unless the method needs a redirect. */
442
+ readonly redirect: import("@angular/core").InputSignal<"if_required" | "always">;
443
+ /** Call `elements.submit()` before confirming. Unset = automatic: yes for a deferred intent (Stripe requires it), no with a client secret. */
444
+ readonly submitBeforeConfirm: import("@angular/core").InputSignal<boolean | null>;
445
+ /** After a payment comes back `requires_action` (not a bank verification), run `stripe.handleCardAction` (3D Secure) before reporting. */
446
+ readonly autoHandleCardAction: import("@angular/core").InputSignal<boolean>;
447
+ readonly submitLabel: import("@angular/core").InputSignal<string>;
448
+ /** Show the built-in submit button; turn off to use your own and call `confirm()`. */
449
+ readonly showSubmit: import("@angular/core").InputSignal<boolean>;
450
+ readonly disabled: import("@angular/core").InputSignal<boolean>;
451
+ /** The host is still creating the intent: show the loading skeleton. */
452
+ readonly pending: import("@angular/core").InputSignal<boolean>;
453
+ /** Accessible name of the payment form. */
454
+ readonly label: import("@angular/core").InputSignal<string>;
455
+ /** The `id` of the element container (an app's e2e selector such as `#payment-element`). */
456
+ readonly mountId: import("@angular/core").InputSignal<string>;
457
+ /** Extra CSS classes on the element container. */
458
+ readonly mountClass: import("@angular/core").InputSignal<string>;
459
+ /** Show the bank-account notice while that tab is selected. */
460
+ readonly showAchNotice: import("@angular/core").InputSignal<boolean>;
461
+ readonly achNotice: import("@angular/core").InputSignal<string>;
462
+ /** The `data-testid` of the notice (an app's existing e2e selector, e.g. `ach-setup-notice`). */
463
+ readonly achNoticeTestId: import("@angular/core").InputSignal<string>;
464
+ /** The payment method type the host shows before Stripe reports one (cremo: `'card'`); `paymentMethodTypeChange` fires only when the reported type differs from it (or from the last report). */
465
+ readonly initialPaymentMethodType: import("@angular/core").InputSignal<string>;
466
+ /** Show failures in the built-in alert. Turn off when the host shows `(failed)` itself. */
467
+ readonly showErrors: import("@angular/core").InputSignal<boolean>;
468
+ /** `'friendly'` (default), `'table'` (table text, else Stripe's own message: the cremo payment flows) or `'stripe'` (Stripe's own message). See `getStripeErrorMessage`. */
469
+ readonly errorDisplay: import("@angular/core").InputSignal<StripeErrorDisplay>;
470
+ /** Different error display for single steps (e.g. `{ submit: 'stripe', action: 'stripe' }`: raw Stripe text for the validation and 3DS steps, `errorDisplay` for the rest). */
471
+ readonly errorDisplayByStage: import("@angular/core").InputSignal<Partial<Record<StripeFailureStage, StripeErrorDisplay>> | null>;
472
+ /** The text when Stripe sends an error with no message (default: "Payment failed. Please try again."). */
473
+ readonly errorFallback: import("@angular/core").InputSignal<string>;
474
+ /** The same per step (Settings: `{ submit: 'Failed to submit payment information', confirm: 'Failed to confirm payment method' }`); wins over `errorFallback`. */
475
+ readonly errorFallbackByStage: import("@angular/core").InputSignal<Partial<Record<StripeFailureStage, string>> | null>;
476
+ /** Replacement texts by code: Stripe error codes AND the library's own failure codes (`not_initialized`, `no_payment_method`, `requires_payment_method`, `not_completed`, `authentication_failed`, ...). `{status}` in a text becomes Stripe's status of the intent ("Unexpected payment status: {status}"). */
477
+ readonly errorMessages: import("@angular/core").InputSignal<Record<string, string> | null>;
478
+ readonly loadErrorMessage: import("@angular/core").InputSignal<string>;
479
+ /** Texts of the screen-reader status region (translate them); missing keys keep the English defaults. */
480
+ readonly a11yMessages: import("@angular/core").InputSignal<Partial<StripeA11yMessages> | null>;
481
+ /**
482
+ * The live Stripe.js objects, emitted once each time the Elements are created: right after `elements.create('payment')` and `mount()` succeeded, before `(ready)`
483
+ * (the moment the old inline code had `this.stripe` / `this.elements` / `this.paymentElement` assigned). `null` is emitted when they go away (the form is re-created for new
484
+ * inputs, or `destroyElements()`): drop your references. Destroying the component itself emits nothing (the host owns that moment).
485
+ */
486
+ readonly stripeReady: import("@angular/core").OutputEmitterRef<StripeReadyEvent | null>;
487
+ /** The Payment Element finished loading. */
488
+ readonly ready: import("@angular/core").OutputEmitterRef<void>;
489
+ /** The customer picked another payment method type (`'card'`, `'us_bank_account'`, ...). */
490
+ readonly paymentMethodTypeChange: import("@angular/core").OutputEmitterRef<string>;
491
+ /** Every change of the form: completeness and the selected type. */
492
+ readonly elementChange: import("@angular/core").OutputEmitterRef<StripeElementChange>;
493
+ /** The intent was confirmed (succeeded, processing, needs bank verification, or needs a further action). */
494
+ readonly confirmed: import("@angular/core").OutputEmitterRef<StripeConfirmedEvent>;
495
+ /** A step failed (validation, intent creation, confirmation). `message` is ready to show. */
496
+ readonly failed: import("@angular/core").OutputEmitterRef<StripeFailure>;
497
+ /** Stripe.js or the Payment Element could not be loaded. */
498
+ readonly loadError: import("@angular/core").OutputEmitterRef<StripeFailure>;
499
+ readonly loading: import("@angular/core").WritableSignal<boolean>;
500
+ readonly isReady: import("@angular/core").WritableSignal<boolean>;
501
+ readonly submitting: import("@angular/core").WritableSignal<boolean>;
502
+ readonly complete: import("@angular/core").WritableSignal<boolean>;
503
+ /** The selected payment method type, `null` until Stripe reports one. */
504
+ readonly selectedType: import("@angular/core").WritableSignal<string | null>;
505
+ readonly errorText: import("@angular/core").WritableSignal<string>;
506
+ readonly loadErrorText: import("@angular/core").WritableSignal<string>;
507
+ private readonly announcement;
508
+ protected readonly errorId: string;
509
+ private readonly mountRef;
510
+ protected readonly mountHidden: import("@angular/core").Signal<boolean>;
511
+ protected readonly achNoticeVisible: import("@angular/core").Signal<boolean>;
512
+ protected readonly effectiveSubmitLabel: import("@angular/core").Signal<string>;
513
+ protected readonly submitDisabled: import("@angular/core").Signal<boolean>;
514
+ private readonly messages;
515
+ protected readonly statusText: import("@angular/core").Signal<string>;
516
+ /** How `loadStripe` is called: key + options. Re-creates everything when it changes. */
517
+ private readonly connection;
518
+ /** The `stripe.elements()` options without the deferred amount (that one is updated in place); `null` while there is no intent to show. */
519
+ private readonly elementsConfig;
520
+ /** The Payment Element options that need a new element when they change (default values and read-only are updated in place). */
521
+ private readonly elementConfig;
522
+ private stripe;
523
+ private stripeSignature;
524
+ private elements;
525
+ private element;
526
+ private generation;
527
+ private lastType;
528
+ private lastAmount;
529
+ private lastFailure;
530
+ private destroyed;
531
+ /** What the element was last given, so a change made while it loaded is applied once it is ready. */
532
+ private appliedDefaultValues;
533
+ private appliedDisabled;
534
+ constructor();
535
+ /**
536
+ * Submits the form: `elements.submit()` (when required), the deferred intent, then `confirmSetup` / `confirmPayment`.
537
+ * Resolves the normalised result (also emitted as `confirmed`), or `null` after a failure (emitted as `failed`) or when nothing was started
538
+ * (already submitting, or disabled). Never rejects: anything Stripe.js throws becomes a `failed` event.
539
+ *
540
+ * `useExistingIntent`: the intent already exists (a retry after a failed attempt, or one created earlier): no `elements.submit()`, no `createIntent`,
541
+ * and `confirmPayment` / `confirmSetup` is called WITHOUT a client secret, exactly like cremo's intake retry. Pass `clientSecret` (the one you stored) to send it.
542
+ */
543
+ confirm(options?: {
544
+ useExistingIntent?: boolean;
545
+ clientSecret?: string;
546
+ }): Promise<StripeConfirmedEvent | null>;
547
+ /**
548
+ * Runs `stripe.handleCardAction(clientSecret)` (3D Secure) for a payment that came back `requires_action`, and reports the result like `confirm()`.
549
+ * Use it when `autoHandleCardAction` is off and the host handles `outcome: 'requires_action'` itself.
550
+ */
551
+ handleNextAction(clientSecret: string): Promise<StripeConfirmedEvent | null>;
552
+ /**
553
+ * `elements.fetchUpdates()`: after your backend changed the amount of the intent this form was created with (cremo intake: fees differ per payment method),
554
+ * so the form shows the new amount. Resolves `null` when it worked, else the failure (returned only, not emitted: the host decides, cremo ignores it).
555
+ */
556
+ fetchUpdates(): Promise<StripeFailure | null>;
557
+ /** `elements.update(options)`: change the deferred amount, appearance or locale without re-creating the form. */
558
+ updateElements(options: Record<string, unknown>): void;
559
+ /** `paymentElement.update(options)`. */
560
+ updatePaymentElement(options: Record<string, unknown>): void;
561
+ /** Removes the Payment Element (host teardown on cancel). The component re-creates it when its inputs change. */
562
+ destroyElements(): void;
563
+ /** Verify a bank account with the two micro-deposit amounts / the descriptor code of a PaymentIntent (the public "verify your bank" page). */
564
+ verifyMicrodepositsForPayment(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult>;
565
+ /** Same for a SetupIntent. */
566
+ verifyMicrodepositsForSetup(clientSecret: string, data: MicrodepositVerifyData): Promise<StripeMicrodepositResult>;
567
+ /**
568
+ * After Stripe redirected the customer back to `returnUrl`: retrieves the intent (client secret from the URL by default) and reports it like `confirm()`
569
+ * (`confirmed` for succeeded / processing / needs verification / needs action, `failed` otherwise). `{ event: null, failure: null }` when the URL has no intent.
570
+ */
571
+ handleReturn(options?: {
572
+ clientSecret?: string;
573
+ kind?: StripeIntentKind;
574
+ search?: string;
575
+ }): Promise<StripeReturnResult>;
576
+ private errorOptions;
577
+ /** Something Stripe.js threw (an IntegrationError, a network failure) as a failure, with the text chosen like any Stripe error. */
578
+ private thrownFailure;
579
+ private buildConfirmParams;
580
+ private fail;
581
+ private finish;
582
+ private announce;
583
+ private runCardAction;
584
+ private ensureStripe;
585
+ private verifyWith;
586
+ private disposeElements;
587
+ private loadFailed;
588
+ private init;
589
+ private applyDefaultValues;
590
+ private applyDisabled;
591
+ private onChange;
592
+ static ɵfac: i0.ɵɵFactoryDeclaration<StripePaymentComponent, never>;
593
+ static ɵcmp: i0.ɵɵComponentDeclaration<StripePaymentComponent, "ui-stripe-payment", never, {
594
+ "mountOnly": {
595
+ "alias": "mountOnly";
596
+ "required": false;
597
+ "isSignal": true;
598
+ };
599
+ "mode": {
600
+ "alias": "mode";
601
+ "required": false;
602
+ "isSignal": true;
603
+ };
604
+ "publishableKey": {
605
+ "alias": "publishableKey";
606
+ "required": false;
607
+ "isSignal": true;
608
+ };
609
+ "clientSecret": {
610
+ "alias": "clientSecret";
611
+ "required": false;
612
+ "isSignal": true;
613
+ };
614
+ "deferred": {
615
+ "alias": "deferred";
616
+ "required": false;
617
+ "isSignal": true;
618
+ };
619
+ "createIntent": {
620
+ "alias": "createIntent";
621
+ "required": false;
622
+ "isSignal": true;
623
+ };
624
+ "stripeAccount": {
625
+ "alias": "stripeAccount";
626
+ "required": false;
627
+ "isSignal": true;
628
+ };
629
+ "locale": {
630
+ "alias": "locale";
631
+ "required": false;
632
+ "isSignal": true;
633
+ };
634
+ "stripeOptions": {
635
+ "alias": "stripeOptions";
636
+ "required": false;
637
+ "isSignal": true;
638
+ };
639
+ "paymentMethodTypes": {
640
+ "alias": "paymentMethodTypes";
641
+ "required": false;
642
+ "isSignal": true;
643
+ };
644
+ "elementsOptions": {
645
+ "alias": "elementsOptions";
646
+ "required": false;
647
+ "isSignal": true;
648
+ };
649
+ "layout": {
650
+ "alias": "layout";
651
+ "required": false;
652
+ "isSignal": true;
653
+ };
654
+ "paymentMethodOrder": {
655
+ "alias": "paymentMethodOrder";
656
+ "required": false;
657
+ "isSignal": true;
658
+ };
659
+ "wallets": {
660
+ "alias": "wallets";
661
+ "required": false;
662
+ "isSignal": true;
663
+ };
664
+ "fields": {
665
+ "alias": "fields";
666
+ "required": false;
667
+ "isSignal": true;
668
+ };
669
+ "defaultValues": {
670
+ "alias": "defaultValues";
671
+ "required": false;
672
+ "isSignal": true;
673
+ };
674
+ "business": {
675
+ "alias": "business";
676
+ "required": false;
677
+ "isSignal": true;
678
+ };
679
+ "terms": {
680
+ "alias": "terms";
681
+ "required": false;
682
+ "isSignal": true;
683
+ };
684
+ "paymentElementOptions": {
685
+ "alias": "paymentElementOptions";
686
+ "required": false;
687
+ "isSignal": true;
688
+ };
689
+ "appearance": {
690
+ "alias": "appearance";
691
+ "required": false;
692
+ "isSignal": true;
693
+ };
694
+ "appearanceFromTokens": {
695
+ "alias": "appearanceFromTokens";
696
+ "required": false;
697
+ "isSignal": true;
698
+ };
699
+ "returnUrl": {
700
+ "alias": "returnUrl";
701
+ "required": false;
702
+ "isSignal": true;
703
+ };
704
+ "billingDetails": {
705
+ "alias": "billingDetails";
706
+ "required": false;
707
+ "isSignal": true;
708
+ };
709
+ "confirmParams": {
710
+ "alias": "confirmParams";
711
+ "required": false;
712
+ "isSignal": true;
713
+ };
714
+ "redirect": {
715
+ "alias": "redirect";
716
+ "required": false;
717
+ "isSignal": true;
718
+ };
719
+ "submitBeforeConfirm": {
720
+ "alias": "submitBeforeConfirm";
721
+ "required": false;
722
+ "isSignal": true;
723
+ };
724
+ "autoHandleCardAction": {
725
+ "alias": "autoHandleCardAction";
726
+ "required": false;
727
+ "isSignal": true;
728
+ };
729
+ "submitLabel": {
730
+ "alias": "submitLabel";
731
+ "required": false;
732
+ "isSignal": true;
733
+ };
734
+ "showSubmit": {
735
+ "alias": "showSubmit";
736
+ "required": false;
737
+ "isSignal": true;
738
+ };
739
+ "disabled": {
740
+ "alias": "disabled";
741
+ "required": false;
742
+ "isSignal": true;
743
+ };
744
+ "pending": {
745
+ "alias": "pending";
746
+ "required": false;
747
+ "isSignal": true;
748
+ };
749
+ "label": {
750
+ "alias": "label";
751
+ "required": false;
752
+ "isSignal": true;
753
+ };
754
+ "mountId": {
755
+ "alias": "mountId";
756
+ "required": false;
757
+ "isSignal": true;
758
+ };
759
+ "mountClass": {
760
+ "alias": "mountClass";
761
+ "required": false;
762
+ "isSignal": true;
763
+ };
764
+ "showAchNotice": {
765
+ "alias": "showAchNotice";
766
+ "required": false;
767
+ "isSignal": true;
768
+ };
769
+ "achNotice": {
770
+ "alias": "achNotice";
771
+ "required": false;
772
+ "isSignal": true;
773
+ };
774
+ "achNoticeTestId": {
775
+ "alias": "achNoticeTestId";
776
+ "required": false;
777
+ "isSignal": true;
778
+ };
779
+ "initialPaymentMethodType": {
780
+ "alias": "initialPaymentMethodType";
781
+ "required": false;
782
+ "isSignal": true;
783
+ };
784
+ "showErrors": {
785
+ "alias": "showErrors";
786
+ "required": false;
787
+ "isSignal": true;
788
+ };
789
+ "errorDisplay": {
790
+ "alias": "errorDisplay";
791
+ "required": false;
792
+ "isSignal": true;
793
+ };
794
+ "errorDisplayByStage": {
795
+ "alias": "errorDisplayByStage";
796
+ "required": false;
797
+ "isSignal": true;
798
+ };
799
+ "errorFallback": {
800
+ "alias": "errorFallback";
801
+ "required": false;
802
+ "isSignal": true;
803
+ };
804
+ "errorFallbackByStage": {
805
+ "alias": "errorFallbackByStage";
806
+ "required": false;
807
+ "isSignal": true;
808
+ };
809
+ "errorMessages": {
810
+ "alias": "errorMessages";
811
+ "required": false;
812
+ "isSignal": true;
813
+ };
814
+ "loadErrorMessage": {
815
+ "alias": "loadErrorMessage";
816
+ "required": false;
817
+ "isSignal": true;
818
+ };
819
+ "a11yMessages": {
820
+ "alias": "a11yMessages";
821
+ "required": false;
822
+ "isSignal": true;
823
+ };
824
+ }, {
825
+ "stripeReady": "stripeReady";
826
+ "ready": "ready";
827
+ "paymentMethodTypeChange": "paymentMethodTypeChange";
828
+ "elementChange": "elementChange";
829
+ "confirmed": "confirmed";
830
+ "failed": "failed";
831
+ "loadError": "loadError";
832
+ }, never, never, true, never>;
833
+ }
834
+ /** How a bank account added with micro-deposits is verified: two deposit amounts, the code of one deposit, or the bank is still confirming it. */
835
+ type MicrodepositType = 'amounts' | 'descriptor_code' | 'processing';
836
+ /** The text of the pending-verification card, in one place for the component and its tests. */
837
+ export declare const MICRODEPOSIT_COPY: {
838
+ readonly title: "Bank account waiting for verification";
839
+ readonly processingTitle: "Bank account being confirmed";
840
+ readonly processing: "Your bank is confirming this account; this usually takes up to a few business days. We will email you when it is ready.";
841
+ readonly cannotPay: "Until then this account can't be used to pay invoices.";
842
+ readonly readOnly: "An administrator of your organization can finish the verification.";
843
+ readonly keepsActive: "Your current payment method stays active until the new bank account is verified.";
844
+ readonly cancelTitle: "Cancel verification";
845
+ readonly verifyLabel: "Verify bank account";
846
+ readonly cancelBase: "Cancel the verification of this bank account? It will not be saved as a payment method and you can add it again later.";
847
+ readonly cancelKeepsActive: " Your current payment method stays active.";
848
+ readonly cancelNoOther: " You have no other payment method saved.";
849
+ readonly tooManyAttempts: "Too many failed attempts. Please try again later or contact support.";
850
+ readonly codeRequired: "Enter the 6-character code.";
851
+ };
852
+ /** "June 5, 2026" in UTC: the arrival date is a calendar day. Empty for no / an invalid date. */
853
+ export declare function microdepositArrivalText(iso: string | null | undefined): string;
854
+ /** Amounts: two whole numbers of cents from 1 to 99 (Stripe's micro-deposits are 1 to 99 cents). Empty text = nothing to say yet. */
855
+ export declare function depositAmountError(value: unknown): string;
856
+ /** The code as sent to Stripe: trimmed, upper case. */
857
+ export declare const normalizeDescriptorCode: (value: string | null | undefined) => string;
858
+ /** The descriptor code: 6 letters or numbers; with `requireSmPrefix` (Stripe's codes look like SMXXXX) it must start with "SM". Empty = nothing to say yet. */
859
+ export declare function descriptorCodeError(value: string | null | undefined, requireSmPrefix?: boolean): string;
860
+ /** Only an https link is offered as Stripe's hosted verification page. */
861
+ declare function safeHostedUrl(url: string | null | undefined): string | null;
862
+ /** What `(verify)` emits: the two amounts in cents, or the code. */
863
+ type MicrodepositVerifyEvent = {
864
+ amounts: [number, number];
865
+ } | {
866
+ descriptorCode: string;
867
+ };
868
+ /** Who started a pending verification, from the point of view of the user looking at it (a partner page): this user, the partner, or somebody else. */
869
+ type MicrodepositStartedBy = 'you' | 'partner' | 'other' | '';
870
+ interface MicrodepositStepsContext {
871
+ type: Exclude<MicrodepositType, 'processing'>;
872
+ /** ISO timestamp of the day the deposits should arrive. */
873
+ arrivalDate?: string | null;
874
+ /** Set when the user looks at ANOTHER party's account (a crematory looking at a partner): "{partner}'s account", "Ask {partner} for ...". */
875
+ partnerName?: string;
876
+ /** The user cannot finish it (no form on the card). */
877
+ readOnly?: boolean;
878
+ /** Read-only: who started it. */
879
+ startedBy?: MicrodepositStartedBy;
880
+ /** Read-only: replaces ONLY the middle sentence ("An administrator of your organization can finish the verification." by default). */
881
+ readOnlyText?: string;
882
+ }
883
+ /**
884
+ * The explanation under the bank account: the deposits clause, then what to do (or, with no form, who can finish it), then
885
+ * "Until then this account can't be used to pay invoices." The exact strings of the cremo Settings / Partners cards.
886
+ */
887
+ export declare function microdepositStepsText(ctx: MicrodepositStepsContext): string;
888
+ /** While the bank is still confirming the account. */
889
+ export declare function microdepositProcessingText(partnerName?: string): string;
890
+ /** The note under the steps when a payment method is already saved. */
891
+ export declare function microdepositKeepsActiveText(partnerName?: string): string;
892
+ /** The message of the cancel confirm: the saved method stays active only when one is saved. */
893
+ export declare function microdepositCancelMessage(options?: {
894
+ partnerName?: string;
895
+ hasSavedMethod?: boolean;
896
+ }): string;
897
+ /**
898
+ * "Bank account waiting for verification": explains the steps in plain words, takes the two deposit amounts (or the 6-character code),
899
+ * links to Stripe's own verification page, and lets the user cancel. Read-only users see the card but no form and no buttons.
900
+ *
901
+ * Two ways to verify, same screen:
902
+ * - Host verifies (default): `(verify)` emits `{ amounts: [a, b] }` or `{ descriptorCode }`; the host calls its backend and shows
903
+ * `[verifying]` / `[errorText]` (your API owns the rules and the attempts).
904
+ * - Stripe.js verifies (public "verify your bank" page): pass `[clientSecret]` (+ `[publishableKey]`, `[stripeAccount]`, `[flow]`); the component calls
905
+ * `verifyMicrodepositsForPayment/Setup` itself, counts failed attempts (`[maxAttempts]`) and emits `(verified)`.
906
+ *
907
+ * <ui-microdeposit-verify type="amounts" bankName="Chase" last4="6789" arrivalDate="2026-06-05T00:00:00Z"
908
+ * [verifying]="busy()" [errorText]="error()" (verify)="verify($event)" (cancelVerification)="cancel()" />
909
+ */
910
+ export declare class MicrodepositVerifyComponent {
911
+ private readonly service;
912
+ /** `'amounts'` (two deposits), `'descriptor_code'` (one deposit with a code) or `'processing'` (the bank is still confirming; nothing to enter). */
913
+ readonly type: import("@angular/core").InputSignal<MicrodepositType>;
914
+ readonly bankName: import("@angular/core").InputSignal<string>;
915
+ readonly last4: import("@angular/core").InputSignal<string>;
916
+ /** The day the deposits should have arrived (ISO timestamp); empty when unknown. See `StripeVerification.arrivalDateIso`. */
917
+ readonly arrivalDate: import("@angular/core").InputSignal<string | null>;
918
+ /** Stripe's own verification page; only an https link is shown. */
919
+ readonly hostedVerificationUrl: import("@angular/core").InputSignal<string | null>;
920
+ /** Read-only users see the card with `readOnlyText` but no form, link or buttons. */
921
+ readonly readOnly: import("@angular/core").InputSignal<boolean>;
922
+ /** Show the card as plain status: no form, link or buttons, and the steps text is yours (`stepsText`). For a page where someone else finishes the verification. */
923
+ readonly statusOnly: import("@angular/core").InputSignal<boolean>;
924
+ /** Replaces the card heading (default: "Bank account waiting for verification" / "Bank account being confirmed"). */
925
+ readonly title: import("@angular/core").InputSignal<string>;
926
+ /** Replaces the whole steps text (the sentences about the deposits and what to enter). Use it for wording the library cannot know (a partner's name, who started it). */
927
+ readonly stepsText: import("@angular/core").InputSignal<string>;
928
+ /** Read-only / status-only: replaces ONLY the middle sentence of the steps text (the deposits clause before it and "Until then this account can't be used ..." after it stay). */
929
+ readonly readOnlyText: import("@angular/core").InputSignal<string>;
930
+ /** Hide Stripe's hosted-page link even for users who could use it. */
931
+ readonly hideHostedLink: import("@angular/core").InputSignal<boolean>;
932
+ readonly cancelLabel: import("@angular/core").InputSignal<string>;
933
+ readonly verifyLabel: import("@angular/core").InputSignal<string>;
934
+ /** Replaces "Your current payment method stays active until the new bank account is verified." */
935
+ readonly keepsActiveText: import("@angular/core").InputSignal<string>;
936
+ /** Replaces the cancel confirm's message. */
937
+ readonly cancelMessageText: import("@angular/core").InputSignal<string>;
938
+ /** A payment method is already saved (it stays active until the new bank account is verified). */
939
+ readonly hasSavedMethod: import("@angular/core").InputSignal<boolean>;
940
+ /** Host mode: the host's verify request is running. */
941
+ readonly verifying: import("@angular/core").InputSignal<boolean>;
942
+ /** Host mode: the host's cancel request is running. */
943
+ readonly cancelling: import("@angular/core").InputSignal<boolean>;
944
+ /** Host mode: the verification failed; shown above the button. */
945
+ readonly errorText: import("@angular/core").InputSignal<string>;
946
+ /** Offer "Cancel verification" (with its confirm). */
947
+ readonly allowCancel: import("@angular/core").InputSignal<boolean>;
948
+ /** Descriptor codes must look like Stripe's (`SMXXXX`). */
949
+ readonly requireSmPrefix: import("@angular/core").InputSignal<boolean>;
950
+ readonly clientSecret: import("@angular/core").InputSignal<string | null>;
951
+ readonly publishableKey: import("@angular/core").InputSignal<string | null>;
952
+ readonly stripeAccount: import("@angular/core").InputSignal<string | null>;
953
+ /** Which kind of intent `clientSecret` belongs to. */
954
+ readonly flow: import("@angular/core").InputSignal<StripeIntentKind>;
955
+ /** Stripe.js mode: stop sending after this many failed attempts (0 = no limit here). */
956
+ readonly maxAttempts: import("@angular/core").InputSignal<number>;
957
+ /** Host mode: the amounts / code to verify. */
958
+ readonly verify$: import("@angular/core").OutputEmitterRef<MicrodepositVerifyEvent>;
959
+ /** The user confirmed cancelling the verification. */
960
+ readonly cancelVerification: import("@angular/core").OutputEmitterRef<void>;
961
+ /** Stripe.js mode: the bank account is verified. */
962
+ readonly verified: import("@angular/core").OutputEmitterRef<StripeMicrodepositResult>;
963
+ /** Stripe.js mode: a verification attempt failed (the text is already shown). */
964
+ readonly verifyFailed: import("@angular/core").OutputEmitterRef<StripeMicrodepositResult>;
965
+ readonly copy: {
966
+ readonly title: "Bank account waiting for verification";
967
+ readonly processingTitle: "Bank account being confirmed";
968
+ readonly processing: "Your bank is confirming this account; this usually takes up to a few business days. We will email you when it is ready.";
969
+ readonly cannotPay: "Until then this account can't be used to pay invoices.";
970
+ readonly readOnly: "An administrator of your organization can finish the verification.";
971
+ readonly keepsActive: "Your current payment method stays active until the new bank account is verified.";
972
+ readonly cancelTitle: "Cancel verification";
973
+ readonly verifyLabel: "Verify bank account";
974
+ readonly cancelBase: "Cancel the verification of this bank account? It will not be saved as a payment method and you can add it again later.";
975
+ readonly cancelKeepsActive: " Your current payment method stays active.";
976
+ readonly cancelNoOther: " You have no other payment method saved.";
977
+ readonly tooManyAttempts: "Too many failed attempts. Please try again later or contact support.";
978
+ readonly codeRequired: "Enter the 6-character code.";
979
+ };
980
+ readonly first: import("@angular/core").WritableSignal<string | number>;
981
+ readonly second: import("@angular/core").WritableSignal<string | number>;
982
+ readonly code: import("@angular/core").WritableSignal<string>;
983
+ readonly touched: import("@angular/core").WritableSignal<boolean>;
984
+ readonly showCancelConfirm: import("@angular/core").WritableSignal<boolean>;
985
+ private readonly stripeBusy;
986
+ private readonly stripeError;
987
+ private failedAttempts;
988
+ readonly formHidden: import("@angular/core").Signal<boolean>;
989
+ readonly heading: import("@angular/core").Signal<string>;
990
+ /** "Chase ····6789"; nothing when neither the bank nor the last 4 digits are known. */
991
+ readonly bankLine: import("@angular/core").Signal<string>;
992
+ readonly busy: import("@angular/core").Signal<boolean>;
993
+ readonly shownError: import("@angular/core").Signal<string>;
994
+ readonly isProcessing: import("@angular/core").Signal<boolean>;
995
+ readonly safeUrl: import("@angular/core").Signal<string | null>;
996
+ /** The built-in steps text: deposits clause + what to do, or with no form the `readOnlyText` sentence, + "Until then this account can't be used to pay invoices." */
997
+ readonly defaultSteps: import("@angular/core").Signal<string>;
998
+ readonly amountError: typeof depositAmountError;
999
+ readonly codeError: import("@angular/core").Signal<string>;
1000
+ readonly hasInvalid: import("@angular/core").Signal<boolean>;
1001
+ /** The cancel confirm tells the truth: the saved method stays active only when one is saved. */
1002
+ readonly cancelMessage: import("@angular/core").Signal<string>;
1003
+ verify(): Promise<void>;
1004
+ confirmCancel(): void;
1005
+ static ɵfac: i0.ɵɵFactoryDeclaration<MicrodepositVerifyComponent, never>;
1006
+ static ɵcmp: i0.ɵɵComponentDeclaration<MicrodepositVerifyComponent, "ui-microdeposit-verify", never, {
1007
+ "type": {
1008
+ "alias": "type";
1009
+ "required": false;
1010
+ "isSignal": true;
1011
+ };
1012
+ "bankName": {
1013
+ "alias": "bankName";
1014
+ "required": false;
1015
+ "isSignal": true;
1016
+ };
1017
+ "last4": {
1018
+ "alias": "last4";
1019
+ "required": false;
1020
+ "isSignal": true;
1021
+ };
1022
+ "arrivalDate": {
1023
+ "alias": "arrivalDate";
1024
+ "required": false;
1025
+ "isSignal": true;
1026
+ };
1027
+ "hostedVerificationUrl": {
1028
+ "alias": "hostedVerificationUrl";
1029
+ "required": false;
1030
+ "isSignal": true;
1031
+ };
1032
+ "readOnly": {
1033
+ "alias": "readOnly";
1034
+ "required": false;
1035
+ "isSignal": true;
1036
+ };
1037
+ "statusOnly": {
1038
+ "alias": "statusOnly";
1039
+ "required": false;
1040
+ "isSignal": true;
1041
+ };
1042
+ "title": {
1043
+ "alias": "title";
1044
+ "required": false;
1045
+ "isSignal": true;
1046
+ };
1047
+ "stepsText": {
1048
+ "alias": "stepsText";
1049
+ "required": false;
1050
+ "isSignal": true;
1051
+ };
1052
+ "readOnlyText": {
1053
+ "alias": "readOnlyText";
1054
+ "required": false;
1055
+ "isSignal": true;
1056
+ };
1057
+ "hideHostedLink": {
1058
+ "alias": "hideHostedLink";
1059
+ "required": false;
1060
+ "isSignal": true;
1061
+ };
1062
+ "cancelLabel": {
1063
+ "alias": "cancelLabel";
1064
+ "required": false;
1065
+ "isSignal": true;
1066
+ };
1067
+ "verifyLabel": {
1068
+ "alias": "verifyLabel";
1069
+ "required": false;
1070
+ "isSignal": true;
1071
+ };
1072
+ "keepsActiveText": {
1073
+ "alias": "keepsActiveText";
1074
+ "required": false;
1075
+ "isSignal": true;
1076
+ };
1077
+ "cancelMessageText": {
1078
+ "alias": "cancelMessageText";
1079
+ "required": false;
1080
+ "isSignal": true;
1081
+ };
1082
+ "hasSavedMethod": {
1083
+ "alias": "hasSavedMethod";
1084
+ "required": false;
1085
+ "isSignal": true;
1086
+ };
1087
+ "verifying": {
1088
+ "alias": "verifying";
1089
+ "required": false;
1090
+ "isSignal": true;
1091
+ };
1092
+ "cancelling": {
1093
+ "alias": "cancelling";
1094
+ "required": false;
1095
+ "isSignal": true;
1096
+ };
1097
+ "errorText": {
1098
+ "alias": "errorText";
1099
+ "required": false;
1100
+ "isSignal": true;
1101
+ };
1102
+ "allowCancel": {
1103
+ "alias": "allowCancel";
1104
+ "required": false;
1105
+ "isSignal": true;
1106
+ };
1107
+ "requireSmPrefix": {
1108
+ "alias": "requireSmPrefix";
1109
+ "required": false;
1110
+ "isSignal": true;
1111
+ };
1112
+ "clientSecret": {
1113
+ "alias": "clientSecret";
1114
+ "required": false;
1115
+ "isSignal": true;
1116
+ };
1117
+ "publishableKey": {
1118
+ "alias": "publishableKey";
1119
+ "required": false;
1120
+ "isSignal": true;
1121
+ };
1122
+ "stripeAccount": {
1123
+ "alias": "stripeAccount";
1124
+ "required": false;
1125
+ "isSignal": true;
1126
+ };
1127
+ "flow": {
1128
+ "alias": "flow";
1129
+ "required": false;
1130
+ "isSignal": true;
1131
+ };
1132
+ "maxAttempts": {
1133
+ "alias": "maxAttempts";
1134
+ "required": false;
1135
+ "isSignal": true;
1136
+ };
1137
+ }, {
1138
+ "verify$": "verify";
1139
+ "cancelVerification": "cancelVerification";
1140
+ "verified": "verified";
1141
+ "verifyFailed": "verifyFailed";
1142
+ }, never, never, true, never>;
1143
+ }
1144
+ export type { HandleReturnOptions, MicrodepositStartedBy, MicrodepositStepsContext, MicrodepositType, MicrodepositVerifyData, MicrodepositVerifyEvent, ProvideStripePaymentOptions, StripeA11yMessages, StripeAppearance, StripeBillingDetails, StripeConfirmResult, StripeConfirmedEvent, StripeConnection, StripeCreateIntentFn, StripeDeferredIntent, StripeElementChange, StripeElementsLike, StripeErrorDisplay, StripeErrorLike, StripeErrorMessageOptions, StripeFailure, StripeFailureStage, StripeIntentKind, StripeIntentLike, StripeLike, StripeLikeWithBankSetup, StripeLoadOptions, StripeLoaderFn, StripeMicrodepositNextAction, StripeMicrodepositResult, StripeOutcome, StripePaymentDefaults, StripePaymentElementLike, StripeReadyEvent, StripeReturnParams, StripeReturnResult, StripeVerification };