@forgeroute/ui 0.4.99 → 0.5.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.
- package/fesm2022/forgeroute-ui-offline.mjs +18 -2
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs +4953 -0
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-square.mjs +4315 -0
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -0
- package/fesm2022/forgeroute-ui-stripe.mjs +1209 -77
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/{forgeroute-ui-ui-labels.es-Bdh64Ql6.mjs → forgeroute-ui-ui-labels.es-C1Meg25h.mjs} +271 -2
- package/fesm2022/{forgeroute-ui-ui-labels.es-Bdh64Ql6.mjs.map → forgeroute-ui-ui-labels.es-C1Meg25h.mjs.map} +1 -1
- package/fesm2022/forgeroute-ui.mjs +1845 -5
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +9 -1
- package/types/forgeroute-ui-offline.d.ts +20 -0
- package/types/forgeroute-ui-quickbooks.d.ts +1482 -0
- package/types/forgeroute-ui-square.d.ts +1376 -0
- package/types/forgeroute-ui-stripe.d.ts +421 -4
- package/types/forgeroute-ui.d.ts +857 -2
|
@@ -0,0 +1,1376 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { DestroyRef, InjectionToken, Provider, TemplateRef, WritableSignal } from "@angular/core";
|
|
3
|
+
import { CheckPaymentStatusFn, HostResult, PaymentAllocation, PaymentAttempt, PaymentAttemptControls, PaymentAttemptOutcome, PaymentMethodBodyContext, PaymentMethodPlugin, PaymentPluginMethod, PaymentReadiness, PaymentReadinessResult, PillTab, ReadinessCheckFn, UiLabelKey, UiLabelsService } from "@forgeroute/ui";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
/**
|
|
6
|
+
* The small part of the Square Web Payments SDK the library calls, written as plain structural types so the library has NO compile-time or run-time
|
|
7
|
+
* dependency on Square outside of the lazy loader (`square-loader.ts`). The real `Square.payments(...)` object satisfies these; so does a hand-written fake.
|
|
8
|
+
* (Square ships its SDK as a script from its own CDN, not as an npm package: there is nothing to install.)
|
|
9
|
+
*/
|
|
10
|
+
/** Which Square host the SDK script is loaded from. */
|
|
11
|
+
type SquareEnvironment = 'sandbox' | 'production';
|
|
12
|
+
/** One entry of `TokenResult.errors`. */
|
|
13
|
+
interface SquareTokenError {
|
|
14
|
+
/** `'VALIDATION_ERROR'`, `'UNSUPPORTED_CARD_BRAND'`, ... */
|
|
15
|
+
type?: string;
|
|
16
|
+
/** The card field the error is about: `'cardNumber'`, `'expirationDate'`, `'cvv'`, `'postalCode'`. */
|
|
17
|
+
field?: string;
|
|
18
|
+
code?: string;
|
|
19
|
+
message?: string;
|
|
20
|
+
detail?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `TokenResult.details`. A card token answers `details.card`; an ACH token answers the bank fields (the shape differs between SDK releases, so the library reads
|
|
24
|
+
* both the flat form the CRM apps read today and a nested `ach` object, and `cardType` / `prepaidType` only when the SDK sends them).
|
|
25
|
+
*/
|
|
26
|
+
interface SquareTokenDetailsLike {
|
|
27
|
+
method?: string;
|
|
28
|
+
card?: {
|
|
29
|
+
brand?: string;
|
|
30
|
+
last4?: string;
|
|
31
|
+
expMonth?: number;
|
|
32
|
+
expYear?: number;
|
|
33
|
+
/** `'CREDIT'` / `'DEBIT'` / `'UNKNOWN'`: only present when the SDK knows it (it usually does not at tokenization time). */
|
|
34
|
+
cardType?: string;
|
|
35
|
+
/** `'PREPAID'` / `'NOT_PREPAID'` / `'UNKNOWN'`. */
|
|
36
|
+
prepaidType?: string;
|
|
37
|
+
};
|
|
38
|
+
bankName?: string;
|
|
39
|
+
lastFour?: string;
|
|
40
|
+
accountType?: string;
|
|
41
|
+
ach?: {
|
|
42
|
+
bankName?: string;
|
|
43
|
+
lastFour?: string;
|
|
44
|
+
accountType?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The result of `card.tokenize()` / `ach.tokenize()`. `status` is `'OK'` on success (`'Cancel'`, `'Error'`, `'Invalid'`, `'Unknown'`, `'Abort'` otherwise). */
|
|
48
|
+
interface SquareTokenResultLike {
|
|
49
|
+
status: string;
|
|
50
|
+
token?: string;
|
|
51
|
+
errors?: SquareTokenError[];
|
|
52
|
+
details?: SquareTokenDetailsLike;
|
|
53
|
+
}
|
|
54
|
+
interface SquareCardLike {
|
|
55
|
+
attach(target: HTMLElement | string): Promise<void>;
|
|
56
|
+
tokenize(): Promise<SquareTokenResultLike>;
|
|
57
|
+
destroy(): Promise<void> | void;
|
|
58
|
+
}
|
|
59
|
+
interface SquareAchLike {
|
|
60
|
+
/** Opens the bank authorization window; call it from the click that starts the payment (popup rules). */
|
|
61
|
+
tokenize(options: {
|
|
62
|
+
accountHolderName: string;
|
|
63
|
+
}): Promise<SquareTokenResultLike>;
|
|
64
|
+
destroy?(): Promise<void> | void;
|
|
65
|
+
}
|
|
66
|
+
/** What `payments.verifyBuyer(token, details)` is asked (Strong Customer Authentication / 3-D Secure). */
|
|
67
|
+
interface SquareVerifyBuyerDetails {
|
|
68
|
+
/** `'CHARGE'` for a payment, `'STORE'` to keep the card on file. */
|
|
69
|
+
intent: 'CHARGE' | 'STORE';
|
|
70
|
+
/** Decimal string in major units (`'12.50'`), required for `'CHARGE'`. */
|
|
71
|
+
amount?: string;
|
|
72
|
+
currencyCode?: string;
|
|
73
|
+
billingContact?: SquareBillingContact;
|
|
74
|
+
customerInitiated: boolean;
|
|
75
|
+
sellerKeyedIn: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** The buyer's billing contact, in the SDK's own names. */
|
|
78
|
+
interface SquareBillingContact {
|
|
79
|
+
givenName?: string;
|
|
80
|
+
familyName?: string;
|
|
81
|
+
email?: string;
|
|
82
|
+
phone?: string;
|
|
83
|
+
addressLines?: string[];
|
|
84
|
+
city?: string;
|
|
85
|
+
state?: string;
|
|
86
|
+
postalCode?: string;
|
|
87
|
+
countryCode?: string;
|
|
88
|
+
}
|
|
89
|
+
interface SquarePaymentsLike {
|
|
90
|
+
card(options?: Record<string, unknown>): Promise<SquareCardLike>;
|
|
91
|
+
ach(options?: Record<string, unknown>): Promise<SquareAchLike>;
|
|
92
|
+
/** Resolves `{ token }` (the verification token), or `null` / `undefined` when the buyer could not be verified. */
|
|
93
|
+
verifyBuyer?(sourceId: string, details: SquareVerifyBuyerDetails): Promise<{
|
|
94
|
+
token?: string;
|
|
95
|
+
} | null | undefined>;
|
|
96
|
+
}
|
|
97
|
+
/** What identifies the seller's Square application and location. */
|
|
98
|
+
interface SquareConnectionConfig {
|
|
99
|
+
applicationId: string;
|
|
100
|
+
locationId: string;
|
|
101
|
+
environment: SquareEnvironment;
|
|
102
|
+
}
|
|
103
|
+
/** The only addresses the SDK script is ever loaded from (Square's own CDN; never an address an answer or an input made up). */
|
|
104
|
+
export declare const SQUARE_SDK_URL = "https://web.squarecdn.com/v1/square.js";
|
|
105
|
+
export declare const SQUARE_SANDBOX_SDK_URL = "https://sandbox.web.squarecdn.com/v1/square.js";
|
|
106
|
+
/** How long a script that is already in the page may take to define `window.Square` before the load is reported as failed. */
|
|
107
|
+
declare const SQUARE_SCRIPT_WAIT_MS = 15000;
|
|
108
|
+
/** How long a script this loader inserted (or a form's `card()` / `attach()` / `ach()`) may stay silent before the load is reported as failed: a hung CDN must not leave a skeleton forever. */
|
|
109
|
+
declare const SQUARE_LOAD_TIMEOUT_MS = 20000;
|
|
110
|
+
/**
|
|
111
|
+
* Races a step of the form (`loader`, `card()`, `attach()`, `ach()`) against {@link SQUARE_LOAD_TIMEOUT_MS}: a promise that never settles becomes the error `makeError()` builds, so the
|
|
112
|
+
* form shows its load error instead of a skeleton forever. The timer is always cleared (nothing is left pending).
|
|
113
|
+
*/
|
|
114
|
+
declare function withSquareTimeout<T>(step: Promise<T> | T, makeError: () => Error): Promise<T>;
|
|
115
|
+
/** Why the SDK could not be loaded; `code` is `'script_failed'` (the script did not load or never defined `window.Square`) or `'sdk_missing'`. */
|
|
116
|
+
export declare class SquareLoadError extends Error {
|
|
117
|
+
readonly code: 'script_failed' | 'sdk_missing';
|
|
118
|
+
constructor(code: 'script_failed' | 'sdk_missing');
|
|
119
|
+
}
|
|
120
|
+
/** Loads the Web Payments SDK and resolves the payments object: `loader({ applicationId, locationId, environment })`. */
|
|
121
|
+
type SquareLoaderFn = (config: SquareConnectionConfig) => Promise<SquarePaymentsLike>;
|
|
122
|
+
/**
|
|
123
|
+
* The script tag handling, behind an object so a spec can watch it (internal: not part of the public API).
|
|
124
|
+
*
|
|
125
|
+
* The sandbox and the production SDK are two different scripts that BOTH define `window.Square`, so `window.Square` alone says nothing about which one it is. `active` remembers
|
|
126
|
+
* the address of the script whose `window.Square` is current: when a payment form asks for the OTHER environment, the old object is set aside, the other script is loaded fresh and
|
|
127
|
+
* its `window.Square` wins (a form that already has its payments object keeps working: it holds its own reference). A `window.Square` this loader did not load (`active` is `null`)
|
|
128
|
+
* is trusted as it is. One page normally uses one environment; switching is supported but not a hot path.
|
|
129
|
+
*/
|
|
130
|
+
declare const squareScript: {
|
|
131
|
+
/** One load per address at a time; a failed load is forgotten so the next call retries with a fresh script. */
|
|
132
|
+
pending: Map<string, Promise<void>>;
|
|
133
|
+
/** The address of the script whose `window.Square` is current; `null` = unknown (nothing loaded yet, or the SDK came from the host page). */
|
|
134
|
+
active: string | null;
|
|
135
|
+
/** The load that currently OWNS an address: a callback of any other load (an older one, a timer that fires late) never touches `pending`, `active` or `window.Square`. */
|
|
136
|
+
owners: Map<string, object>;
|
|
137
|
+
load(url: string): Promise<void>;
|
|
138
|
+
};
|
|
139
|
+
export declare const squareSdkUrl: (environment: SquareEnvironment) => string;
|
|
140
|
+
/**
|
|
141
|
+
* The default loader: adds the SDK script from Square's CDN (production or sandbox host by `environment`) once, then calls `Square.payments(applicationId, locationId)`.
|
|
142
|
+
* Nothing is fetched until a payment form is shown.
|
|
143
|
+
*/
|
|
144
|
+
export declare const defaultSquareLoader: SquareLoaderFn;
|
|
145
|
+
/** How the Web Payments SDK is loaded. Provide your own to fake Square in tests or to load it differently. Defaults to `defaultSquareLoader`. */
|
|
146
|
+
export declare const SQUARE_LOADER: InjectionToken<SquareLoaderFn>;
|
|
147
|
+
/** App-wide defaults for every Square component, set once with `provideSquarePayment`. A value on the component always wins. */
|
|
148
|
+
interface SquarePaymentDefaults {
|
|
149
|
+
/** The Square application id (`sq0idp-...` / `sandbox-sq0idb-...`). */
|
|
150
|
+
applicationId?: string;
|
|
151
|
+
/** The seller's Square location id. */
|
|
152
|
+
locationId?: string;
|
|
153
|
+
/** `'production'` or `'sandbox'` (default `'sandbox'`: a forgotten setting never charges real cards). */
|
|
154
|
+
environment?: SquareEnvironment;
|
|
155
|
+
}
|
|
156
|
+
export declare const SQUARE_PAYMENT_DEFAULTS: InjectionToken<SquarePaymentDefaults>;
|
|
157
|
+
interface ProvideSquarePaymentOptions extends SquarePaymentDefaults {
|
|
158
|
+
/** Replaces how the SDK is loaded (tests, a self-hosted loader). */
|
|
159
|
+
loader?: SquareLoaderFn;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Global defaults for the Square components:
|
|
163
|
+
*
|
|
164
|
+
* providers: [provideSquarePayment({ applicationId: env.squareApplicationId, locationId: env.squareLocationId, environment: 'production' })]
|
|
165
|
+
*/
|
|
166
|
+
export declare function provideSquarePayment(options?: ProvideSquarePaymentOptions): Provider[];
|
|
167
|
+
/**
|
|
168
|
+
* Plain-language text for the codes Square's Payments API answers when a payment is refused (https://developer.squareup.com/reference/square/objects/Error).
|
|
169
|
+
* The Web Payments SDK never sees these (it only tokenizes); they come back from the host's backend after it created the payment, which is why the table is
|
|
170
|
+
* public: `getSquarePaymentErrorMessage(code)` words them in the app's active language. Values are label keys; the English text lives in the dictionary.
|
|
171
|
+
*/
|
|
172
|
+
export declare const SQUARE_PAYMENT_ERROR_KEYS: Readonly<Record<string, UiLabelKey>>;
|
|
173
|
+
/** The card fields the SDK names in a validation error. */
|
|
174
|
+
export declare const SQUARE_FIELD_ERROR_KEYS: Readonly<Record<string, UiLabelKey>>;
|
|
175
|
+
/** The SDK's own error types. */
|
|
176
|
+
export declare const SQUARE_TYPE_ERROR_KEYS: Readonly<Record<string, UiLabelKey>>;
|
|
177
|
+
/**
|
|
178
|
+
* `'friendly'` (default): the code table (`overrides` first), then the validation field, then the SDK error type, then Square's own text for a validation error
|
|
179
|
+
* (customer-facing), then the fallback. `'square'`: Square's own `message` untouched, the fallback when there is none.
|
|
180
|
+
*/
|
|
181
|
+
type SquareErrorDisplay = 'friendly' | 'square';
|
|
182
|
+
interface SquareErrorMessageOptions {
|
|
183
|
+
display?: SquareErrorDisplay;
|
|
184
|
+
/** Text for single codes (a payment code, an SDK error type, a card field name); wins over the tables. */
|
|
185
|
+
overrides?: Readonly<Record<string, string>> | null;
|
|
186
|
+
/** Shown when there is nothing better. */
|
|
187
|
+
fallback?: string;
|
|
188
|
+
}
|
|
189
|
+
/** The text for a payment error code the host's backend got back from Square (`'GENERIC_DECLINE'`, ...), in the app's active language. */
|
|
190
|
+
export declare function getSquarePaymentErrorMessage(code: string | null | undefined, options?: Pick<SquareErrorMessageOptions, 'overrides' | 'fallback'>): string;
|
|
191
|
+
/** The text to show the customer for an error of the Web Payments SDK (`result.errors[n]`). */
|
|
192
|
+
export declare function getSquareErrorMessage(error: SquareTokenError | null | undefined, options?: SquareErrorMessageOptions): string;
|
|
193
|
+
/** `'card'` = the Web Payments SDK card form, `'ach'` = Square's bank-account authorization window. */
|
|
194
|
+
type SquareMethod = 'card' | 'ach';
|
|
195
|
+
/** `'payment'` takes a payment (single-use token), `'setup'` saves the method on file (the token is used to create a card / bank account on file). */
|
|
196
|
+
type SquareIntentKind = 'payment' | 'setup';
|
|
197
|
+
type SquareCardType = 'CREDIT' | 'DEBIT' | 'UNKNOWN';
|
|
198
|
+
type SquarePrepaidType = 'PREPAID' | 'NOT_PREPAID' | 'UNKNOWN';
|
|
199
|
+
/**
|
|
200
|
+
* What the SDK told about the tokenized method. Every field is `null` when the SDK did not send it. `cardType` / `prepaidType` (the funding of the card) are
|
|
201
|
+
* only filled when the SDK returns them in `details.card`, which it usually does NOT at tokenization time: Square's own `card_type` / `prepaid_type` are
|
|
202
|
+
* read on the server after the card exists (a card on file, or the payment), so a backend that needs the funding must read it there.
|
|
203
|
+
*/
|
|
204
|
+
interface SquareTokenDetails {
|
|
205
|
+
brand: string | null;
|
|
206
|
+
last4: string | null;
|
|
207
|
+
expMonth: number | null;
|
|
208
|
+
expYear: number | null;
|
|
209
|
+
cardType: SquareCardType | null;
|
|
210
|
+
prepaidType: SquarePrepaidType | null;
|
|
211
|
+
bankName: string | null;
|
|
212
|
+
accountType: string | null;
|
|
213
|
+
}
|
|
214
|
+
/** A successful tokenization. The component NEVER talks to your backend: send `token` (single use) to it, together with `attemptKey` (never the deprecated per-token `idempotencyKey`). */
|
|
215
|
+
interface SquareTokenizedEvent {
|
|
216
|
+
/** The single-use source id (`cnon:...` for a card, `bnon:...` for a bank account). */
|
|
217
|
+
token: string;
|
|
218
|
+
method: SquareMethod;
|
|
219
|
+
kind: SquareIntentKind;
|
|
220
|
+
details: SquareTokenDetails;
|
|
221
|
+
/** The buyer-verification (SCA / 3-D Secure) token, when `payments.verifyBuyer` ran (card, `amount` + `billingContact` given); `null` otherwise. */
|
|
222
|
+
verificationToken: string | null;
|
|
223
|
+
/**
|
|
224
|
+
* @deprecated A new id per tokenization: do NOT use it as the charge's idempotency key (a retry with a new token would then be a second payment). Derive Square's `idempotency_key` from
|
|
225
|
+
* `attemptKey`, and look the attempt up by `attemptKey` before calling Square.
|
|
226
|
+
*/
|
|
227
|
+
idempotencyKey: string;
|
|
228
|
+
/**
|
|
229
|
+
* The key of this PAYMENT ATTEMPT (stable across retries after a timeout, a reload and a second tab; renewed only after a definitive failure or success): send it to your backend with the
|
|
230
|
+
* charge, which derives the processor's idempotency key from it. `idempotencyKey` above is new per tokenization; the attempt key is the one that prevents a duplicate charge.
|
|
231
|
+
*/
|
|
232
|
+
attemptKey: string;
|
|
233
|
+
/** The amount the attempt STARTED with (pinned when the click began; the buyer verification asked for exactly this). `null` for a saved card or when the form has no `amount`. */
|
|
234
|
+
amount: number | null;
|
|
235
|
+
/** The payable the attempt started for (the form's `payableRef` at the click): send it with the charge; the backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key. */
|
|
236
|
+
payableRef: string | null;
|
|
237
|
+
}
|
|
238
|
+
type SquareFailureStage = 'load' | 'validate' | 'tokenize' | 'verify';
|
|
239
|
+
/** A failure: `message` is what to show the customer; `squareMessage` is Square's own text. */
|
|
240
|
+
interface SquareFailure {
|
|
241
|
+
code: string;
|
|
242
|
+
message: string;
|
|
243
|
+
squareMessage: string;
|
|
244
|
+
stage: SquareFailureStage;
|
|
245
|
+
/** The SDK's `status` (`'Cancel'`, `'Invalid'`, ...) for a tokenization failure. */
|
|
246
|
+
status?: string;
|
|
247
|
+
/** The card field a validation error is about. */
|
|
248
|
+
field?: string;
|
|
249
|
+
/** The SDK errors as returned. */
|
|
250
|
+
errors?: SquareTokenError[];
|
|
251
|
+
}
|
|
252
|
+
declare function squareFailure(code: string, message: string, stage: SquareFailureStage, squareMessage?: string): SquareFailure;
|
|
253
|
+
/** An error thrown by the SDK, the loader or a host callback: its own `error.error.message` (HTTP body), `message`, else the fallback. */
|
|
254
|
+
declare function messageOfThrown(err: unknown, fallback: string): string;
|
|
255
|
+
/** `details` of a token result as the fixed shape (see {@link SquareTokenDetails}); an unreadable field is `null`. */
|
|
256
|
+
export declare function normalizeSquareDetails(details: SquareTokenDetailsLike | null | undefined): SquareTokenDetails;
|
|
257
|
+
/** The failure of a `tokenize()` that did not answer `status: 'OK'` with a token. The text is chosen by `options` (see `getSquareErrorMessage`). */
|
|
258
|
+
export declare function failureFromTokenResult(result: SquareTokenResultLike, method: SquareMethod, options?: SquareErrorMessageOptions): SquareFailure;
|
|
259
|
+
/** A new idempotency key (a UUID, with a time + random fallback for a browser without `crypto.randomUUID`). */
|
|
260
|
+
export declare function newIdempotencyKey(): string;
|
|
261
|
+
/**
|
|
262
|
+
* The `style` option of `payments.card({ style })`: the card form's look read from CSS custom properties at runtime, so one set of tokens styles the page and
|
|
263
|
+
* the Square form, in light and dark.
|
|
264
|
+
*
|
|
265
|
+
* :root { --ui-square-color-primary: #0d9488; --ui-square-border-radius: 8px; }
|
|
266
|
+
*
|
|
267
|
+
* Tokens read (all optional; a missing one is left out so Square's default stays): `--ui-square-color-primary` (the focused field's border),
|
|
268
|
+
* `--ui-square-color-text`, `--ui-square-color-background`, `--ui-square-color-border`, `--ui-square-color-danger`, `--ui-square-font-family`,
|
|
269
|
+
* `--ui-square-border-radius`, `--ui-square-font-size-base`. On a dark page (`data-theme="dark"`, or a dark system whose root is not forced to `light`) the text and
|
|
270
|
+
* background fall back to a light-on-dark pair so a form without tokens stays readable.
|
|
271
|
+
*/
|
|
272
|
+
type SquareCardStyle = Record<string, Record<string, string>>;
|
|
273
|
+
/** Builds the card style from the tokens in effect on `element` (default: the document root). */
|
|
274
|
+
export declare function readSquareCardStyle(doc: Document, element?: Element): SquareCardStyle;
|
|
275
|
+
/** The texts of the screen-reader status region. */
|
|
276
|
+
interface SquareA11yMessages {
|
|
277
|
+
loading: string;
|
|
278
|
+
processing: string;
|
|
279
|
+
tokenized: string;
|
|
280
|
+
}
|
|
281
|
+
/** The screen-reader messages of the payment form; read on every access, so they follow the app's active language. */
|
|
282
|
+
export declare const SQUARE_A11Y_MESSAGES: Readonly<SquareA11yMessages>;
|
|
283
|
+
/**
|
|
284
|
+
* The live Square objects of a form, handed to the host by `(squareReady)`: the host's own code can call `card.tokenize()`, `ach.tokenize({ accountHolderName })`,
|
|
285
|
+
* `payments.verifyBuyer(...)` and anything else the SDK offers. `card` is set for the card form, `ach` for the bank-account form (the other one is `null`).
|
|
286
|
+
*/
|
|
287
|
+
interface SquareReadyEvent {
|
|
288
|
+
payments: SquarePaymentsLike;
|
|
289
|
+
card: SquareCardLike | null;
|
|
290
|
+
ach: SquareAchLike | null;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Structural equality for option objects that may hold functions (`cardOptions`): plain values and nested objects / arrays / Maps / Sets are compared by content (a Set's members
|
|
294
|
+
* structurally and without regard to order), a Date by time, a RegExp by source and flags, a class instance by prototype AND own keys, a FUNCTION by reference, so a new callback
|
|
295
|
+
* rebuilds the card form (JSON.stringify would drop functions and `undefined` and call two different callbacks equal). A cycle never loops: a pair of objects that is already being
|
|
296
|
+
* compared (further up the same comparison) counts as equal while it is in progress.
|
|
297
|
+
*/
|
|
298
|
+
declare function structuralEqual(a: unknown, b: unknown, inProgress?: WeakMap<object, WeakSet<object>>): boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Square Web Payments SDK form: a card form or Square's bank-account (ACH) authorization, as a payment (`mode="payment"`) or to keep the method on file
|
|
301
|
+
* (`mode="setup"`).
|
|
302
|
+
*
|
|
303
|
+
* The component NEVER talks to your backend. It tokenizes in the browser and emits `(tokenized)` with the single-use token (plus the brand / last four /
|
|
304
|
+
* bank name Square returned, an optional buyer-verification token and an idempotency key); your app sends that to its backend, which creates the payment or the
|
|
305
|
+
* card on file. A failure is `(failed)` with a friendly message. The SDK script is loaded lazily from Square's CDN (nothing is fetched until a form is shown).
|
|
306
|
+
*
|
|
307
|
+
* <ui-square-payment [applicationId]="app" [locationId]="loc" environment="production" [amount]="total" [billingContact]="billing"
|
|
308
|
+
* (tokenized)="onToken($event)" (failed)="onFailed($event)" />
|
|
309
|
+
*
|
|
310
|
+
* Every behaviour of the CRM apps' Square forms is reproduced; see docs/square.md ("Parity with the existing app implementations").
|
|
311
|
+
*/
|
|
312
|
+
export declare class SquarePaymentComponent {
|
|
313
|
+
protected readonly labels: UiLabelsService;
|
|
314
|
+
private readonly loader;
|
|
315
|
+
private readonly defaults;
|
|
316
|
+
private readonly doc;
|
|
317
|
+
private readonly isBrowser;
|
|
318
|
+
private readonly host;
|
|
319
|
+
private readonly injector;
|
|
320
|
+
/**
|
|
321
|
+
* Mount-only mode: the component only creates the Square objects and mounts the card form (or creates the bank-account object). No submit button, skeleton, status text (unless
|
|
322
|
+
* `a11yMessages` is set), switcher, holder / consent fields or alerts: load failures go to `(loadError)` only. The host keeps its own tokenization code and calls the SDK with the
|
|
323
|
+
* objects from `(squareReady)`. `mountId` / `mountClass` / `mountTestId` still apply, `(ready)` still emits, and `tokenize()` stays available (the holder name then comes from
|
|
324
|
+
* `accountHolderName`, since the holder field is not drawn).
|
|
325
|
+
*/
|
|
326
|
+
readonly mountOnly: import("@angular/core").InputSignal<boolean>;
|
|
327
|
+
/** `'payment'` takes a payment, `'setup'` keeps the method on file (changes the default button text and the buyer-verification intent). */
|
|
328
|
+
readonly mode: import("@angular/core").InputSignal<SquareIntentKind>;
|
|
329
|
+
/** The method shown: `'card'` (the SDK card form) or `'ach'` (the bank-account authorization). Two-way. */
|
|
330
|
+
readonly method: import("@angular/core").ModelSignal<SquareMethod>;
|
|
331
|
+
/** The methods the customer may pick between (a switcher is shown for two or more); `null` = only the `method` above, no switcher. */
|
|
332
|
+
readonly methods: import("@angular/core").InputSignal<readonly SquareMethod[] | null>;
|
|
333
|
+
/** The Square application id. Falls back to `provideSquarePayment({ applicationId })`. */
|
|
334
|
+
readonly applicationId: import("@angular/core").InputSignal<string | null>;
|
|
335
|
+
readonly locationId: import("@angular/core").InputSignal<string | null>;
|
|
336
|
+
/** `'production'` or `'sandbox'` (default: the provider's, else `'sandbox'`). Decides which Square host the SDK script comes from. */
|
|
337
|
+
readonly environment: import("@angular/core").InputSignal<"production" | "sandbox" | null>;
|
|
338
|
+
/** The amount in major units (12.5 = $12.50), for buyer verification (SCA / 3-D Secure) of a card payment. */
|
|
339
|
+
readonly amount: import("@angular/core").InputSignal<number | null>;
|
|
340
|
+
readonly currency: import("@angular/core").InputSignal<string>;
|
|
341
|
+
/** The buyer's billing contact, for buyer verification. */
|
|
342
|
+
readonly billingContact: import("@angular/core").InputSignal<SquareBillingContact | null>;
|
|
343
|
+
/** Run `payments.verifyBuyer` after a card token. `null` (default) = automatic: for a payment when `amount` and `billingContact` are both given, for a setup when `billingContact` is given. */
|
|
344
|
+
readonly verifyBuyer: import("@angular/core").InputSignal<boolean | null>;
|
|
345
|
+
/** The account holder name of the bank account (ACH); the customer can edit it. */
|
|
346
|
+
readonly accountHolderName: import("@angular/core").InputSignal<string>;
|
|
347
|
+
/** ACH: an unticked authorization checkbox blocks the tokenization (default TRUE: a bank debit needs the holder's authorization; the wording follows `mode`: one-time payment vs agreed-upon payments for a saved account). Not applied in `mountOnly` (no checkbox is drawn: the host owns the consent). */
|
|
348
|
+
readonly requireAchConsent: import("@angular/core").InputSignal<boolean>;
|
|
349
|
+
readonly achConsentTextInput: import("@angular/core").InputSignal<string | null>;
|
|
350
|
+
readonly achConsent: import("@angular/core").Signal<string>;
|
|
351
|
+
/** `payments.ach({ redirectURI })`: where the bank sends the customer back after a redirect-based authorization. Passed only when set. */
|
|
352
|
+
readonly achRedirectUri: import("@angular/core").InputSignal<string | null>;
|
|
353
|
+
/** `payments.ach({ transactionId })`. Passed only when set. */
|
|
354
|
+
readonly achTransactionId: import("@angular/core").InputSignal<string | null>;
|
|
355
|
+
/** Extra options of `payments.card(options)`, merged over `cardStyle`. */
|
|
356
|
+
readonly cardOptions: import("@angular/core").InputSignal<Record<string, unknown> | null>;
|
|
357
|
+
/** The card form's CSS-like `style` (see Square's docs). */
|
|
358
|
+
readonly cardStyle: import("@angular/core").InputSignal<SquareCardStyle | null>;
|
|
359
|
+
/** Build the card `style` from the `--ui-square-*` CSS tokens (light / dark) when no `cardStyle` is given. */
|
|
360
|
+
readonly styleFromTokens: import("@angular/core").InputSignal<boolean>;
|
|
361
|
+
/** Show the built-in attempt / readiness status block (a payment plugin that embeds this form shows its own and turns this off). */
|
|
362
|
+
readonly showStatus: import("@angular/core").InputSignal<boolean>;
|
|
363
|
+
/**
|
|
364
|
+
* The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a
|
|
365
|
+
* SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.
|
|
366
|
+
*/
|
|
367
|
+
readonly payableRef: import("@angular/core").InputSignal<string | null>;
|
|
368
|
+
/** A key the host supplies for the charge; empty = the component generates one per payment attempt session (see `attemptKeyChange`). */
|
|
369
|
+
readonly attemptKey: import("@angular/core").InputSignal<string | null>;
|
|
370
|
+
/** The host's status check by attempt key: resolves an UNKNOWN outcome (`'succeeded' | 'failed' | 'unknown' | 'in_flight'`). */
|
|
371
|
+
readonly checkStatus: import("@angular/core").InputSignal<CheckPaymentStatusFn | null>;
|
|
372
|
+
/** The payable is paid (host re-render, back navigation): the form shows the paid state and ignores every submit for good. */
|
|
373
|
+
readonly paid: import("@angular/core").InputSignal<boolean>;
|
|
374
|
+
/** The host reports an ambiguous result of ITS charge call (its own timeout): the form goes to "Checking your payment..." while true. */
|
|
375
|
+
readonly hostPending: import("@angular/core").InputSignal<boolean>;
|
|
376
|
+
readonly statusPollMs: import("@angular/core").InputSignal<number>;
|
|
377
|
+
readonly statusPollMaxMs: import("@angular/core").InputSignal<number>;
|
|
378
|
+
/** A status check slower than this counts as unknown (ms). */
|
|
379
|
+
readonly statusCheckTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
380
|
+
/** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */
|
|
381
|
+
readonly statusFailGraceMs: import("@angular/core").InputSignal<number>;
|
|
382
|
+
/** Offer "Start over" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */
|
|
383
|
+
readonly allowStartOver: import("@angular/core").InputSignal<boolean>;
|
|
384
|
+
/** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */
|
|
385
|
+
readonly offlineOverride: import("@angular/core").InputSignal<boolean>;
|
|
386
|
+
/** A token-only form whose host never reports (markSucceeded / markFailed / markUnknown / markNotCharged) becomes unknown after this long (ms), so the status check and "Check again" engage. */
|
|
387
|
+
readonly hostSilenceMs: import("@angular/core").InputSignal<number>;
|
|
388
|
+
/** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */
|
|
389
|
+
readonly readinessCheck: import("@angular/core").InputSignal<ReadinessCheckFn | null>;
|
|
390
|
+
readonly readinessTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
391
|
+
readonly readinessEveryMs: import("@angular/core").InputSignal<number>;
|
|
392
|
+
readonly submitLabel: import("@angular/core").InputSignal<string>;
|
|
393
|
+
/** Show the built-in submit button; turn off to use your own and call `tokenize()`. */
|
|
394
|
+
readonly showSubmit: import("@angular/core").InputSignal<boolean>;
|
|
395
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
396
|
+
/** The host is still preparing the form (e.g. it fetches the amount): show the loading skeleton. */
|
|
397
|
+
readonly pending: import("@angular/core").InputSignal<boolean>;
|
|
398
|
+
/** Accessible name of the payment form. */
|
|
399
|
+
readonly labelInput: import("@angular/core").InputSignal<string | null>;
|
|
400
|
+
readonly label: import("@angular/core").Signal<string>;
|
|
401
|
+
/** The payment details are required (a required wizard step): a visible heading with a red asterisk is shown above the form. Not shown in `mountOnly` mode. */
|
|
402
|
+
readonly required: import("@angular/core").InputSignal<boolean>;
|
|
403
|
+
/** The `id` of the card container (an app's e2e selector). */
|
|
404
|
+
readonly mountId: import("@angular/core").InputSignal<string>;
|
|
405
|
+
readonly mountClass: import("@angular/core").InputSignal<string>;
|
|
406
|
+
/** `data-testid` of the card container (default `square-card-form`, the id the mfh forms had). */
|
|
407
|
+
readonly mountTestId: import("@angular/core").InputSignal<string>;
|
|
408
|
+
readonly errorTestId: import("@angular/core").InputSignal<string>;
|
|
409
|
+
readonly holderTestId: import("@angular/core").InputSignal<string>;
|
|
410
|
+
/** Show failures in the built-in alert. Turn off when the host shows `(failed)` itself. */
|
|
411
|
+
readonly showErrors: import("@angular/core").InputSignal<boolean>;
|
|
412
|
+
/** `'friendly'` (default) or `'square'` (Square's own message). See `getSquareErrorMessage`. */
|
|
413
|
+
readonly errorDisplay: import("@angular/core").InputSignal<SquareErrorDisplay>;
|
|
414
|
+
/** Replacement texts by code: Square error codes / types / card fields AND the library's own codes (`not_ready`, `holder_required`, `consent_required`, `cancelled`, `verification_failed`, ...). */
|
|
415
|
+
readonly errorMessages: import("@angular/core").InputSignal<Record<string, string> | null>;
|
|
416
|
+
/** The text when Square sends an error with no usable text. */
|
|
417
|
+
readonly errorFallback: import("@angular/core").InputSignal<string>;
|
|
418
|
+
readonly loadErrorMessageInput: import("@angular/core").InputSignal<string | null>;
|
|
419
|
+
readonly loadErrorMessage: import("@angular/core").Signal<string>;
|
|
420
|
+
/** Texts of the screen-reader status region (translate them); missing keys keep the defaults. */
|
|
421
|
+
readonly a11yMessages: import("@angular/core").InputSignal<Partial<SquareA11yMessages> | null>;
|
|
422
|
+
/**
|
|
423
|
+
* The live Square objects, emitted once each time the form is created: right after the card form was attached (or the bank-account object created), before `(ready)`.
|
|
424
|
+
* `null` is emitted when they go away (the form is re-created for new inputs, `reset()` or `destroyForm()`): drop your references. Destroying the component itself emits nothing
|
|
425
|
+
* (the host owns that moment).
|
|
426
|
+
*/
|
|
427
|
+
readonly squareReady: import("@angular/core").OutputEmitterRef<SquareReadyEvent | null>;
|
|
428
|
+
/** The card form / bank authorization is ready. */
|
|
429
|
+
readonly ready: import("@angular/core").OutputEmitterRef<void>;
|
|
430
|
+
/** A step of an attempt started / ended (the synchronous lock). */
|
|
431
|
+
readonly inFlightChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
432
|
+
/** Unified outcome of a payment attempt: `succeeded`, `failed`, `unknown`, `refused` (with `reason`), `pending`. */
|
|
433
|
+
readonly outcome: import("@angular/core").OutputEmitterRef<PaymentAttemptOutcome>;
|
|
434
|
+
/** The attempt key in effect (also on `tokenized`): send it to your backend with the charge. */
|
|
435
|
+
readonly attemptKeyChange: import("@angular/core").OutputEmitterRef<string>;
|
|
436
|
+
/** The readiness gate changed: `{ ready, reasons }`. */
|
|
437
|
+
readonly readinessChange: import("@angular/core").OutputEmitterRef<PaymentReadinessResult>;
|
|
438
|
+
/** The customer's details were tokenized: send `token` to your backend. */
|
|
439
|
+
readonly tokenized: import("@angular/core").OutputEmitterRef<SquareTokenizedEvent>;
|
|
440
|
+
/** A step failed (validation, tokenization, buyer verification). `message` is ready to show. */
|
|
441
|
+
readonly failed: import("@angular/core").OutputEmitterRef<SquareFailure>;
|
|
442
|
+
/** The SDK could not be loaded or the form could not be created. */
|
|
443
|
+
readonly loadError: import("@angular/core").OutputEmitterRef<SquareFailure>;
|
|
444
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
445
|
+
readonly isReady: import("@angular/core").WritableSignal<boolean>;
|
|
446
|
+
readonly submitting: import("@angular/core").WritableSignal<boolean>;
|
|
447
|
+
readonly errorText: import("@angular/core").WritableSignal<string>;
|
|
448
|
+
readonly loadErrorText: import("@angular/core").WritableSignal<string>;
|
|
449
|
+
protected readonly holder: import("@angular/core").WritableSignal<string>;
|
|
450
|
+
protected readonly consent: import("@angular/core").WritableSignal<boolean>;
|
|
451
|
+
protected readonly attempted: import("@angular/core").WritableSignal<boolean>;
|
|
452
|
+
private readonly announcement;
|
|
453
|
+
private readonly resetTick;
|
|
454
|
+
protected readonly errorId: string;
|
|
455
|
+
private readonly mountRef;
|
|
456
|
+
protected readonly tabs: import("@angular/core").Signal<PillTab[]>;
|
|
457
|
+
protected readonly locked: import("@angular/core").Signal<boolean>;
|
|
458
|
+
protected readonly mountHidden: import("@angular/core").Signal<boolean>;
|
|
459
|
+
/** The card form is not usable while the form is disabled or a tokenization runs (not in `mountOnly`: there the host owns the interaction). */
|
|
460
|
+
protected readonly mountLocked: import("@angular/core").Signal<boolean>;
|
|
461
|
+
protected readonly holderError: import("@angular/core").Signal<string>;
|
|
462
|
+
protected readonly effectiveSubmitLabel: import("@angular/core").Signal<string>;
|
|
463
|
+
protected readonly submitDisabled: import("@angular/core").Signal<boolean>;
|
|
464
|
+
private readonly messages;
|
|
465
|
+
protected readonly statusText: import("@angular/core").Signal<string>;
|
|
466
|
+
private readonly connection;
|
|
467
|
+
/** The options of `payments.card()`: `cardOptions` merged over the style; `null` = call `card()` with no argument (the SDK default look). */
|
|
468
|
+
private readonly cardConfig;
|
|
469
|
+
private payments;
|
|
470
|
+
private card;
|
|
471
|
+
private ach;
|
|
472
|
+
private generation;
|
|
473
|
+
private destroyed;
|
|
474
|
+
/** `(squareReady)` emitted an object set that has not been withdrawn (`null`) yet. */
|
|
475
|
+
private announced;
|
|
476
|
+
/** The duplicate-payment protection of this form: the synchronous lock, the attempt key, the unknown state. Public so a host can read `attempt.key()` / `attempt.unknown()`. */
|
|
477
|
+
readonly attempt: PaymentAttempt;
|
|
478
|
+
/** The readiness gate: `readiness.ready()` / `readiness.reasons()`. */
|
|
479
|
+
readonly readiness: PaymentReadiness;
|
|
480
|
+
constructor();
|
|
481
|
+
/**
|
|
482
|
+
* Tokenizes the entered card / bank account (the same as the built-in button). Resolves the event (also emitted as `tokenized`), or `null` after a failure (emitted
|
|
483
|
+
* as `failed`) or when nothing was started (already running, disabled, not ready). Never rejects: anything the SDK throws becomes a `failed` event.
|
|
484
|
+
*
|
|
485
|
+
* ACH opens the bank window: call this method directly from the click handler (no `await` before it), or the browser blocks the window.
|
|
486
|
+
*/
|
|
487
|
+
tokenize(): Promise<SquareTokenizedEvent | null>;
|
|
488
|
+
/** The host reports that ITS charge call timed out or is ambiguous: the form shows "Checking your payment..." and stays locked (see `checkStatus`). */
|
|
489
|
+
markUnknown(): void;
|
|
490
|
+
/** The host reports that the charge succeeded: the form locks for this payable (a success does NOT move the epoch: the same key replays the original payment; the paid lock lasts 24 hours, see `resetPaid()`). */
|
|
491
|
+
markSucceeded(): void;
|
|
492
|
+
/** The host reports a DEFINITIVE failure of the charge (declined): the form unlocks with a NEW attempt key. */
|
|
493
|
+
markFailed(): void;
|
|
494
|
+
/** The host did not use the token and nothing reached the processor (its call never left, the offline layer refused it): the form unlocks and the attempt key is KEPT. */
|
|
495
|
+
markNotCharged(): void;
|
|
496
|
+
/** The host starts a deliberate SECOND payment of this payable (an explicit "pay again" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */
|
|
497
|
+
resetPaid(): void;
|
|
498
|
+
/** Builds the form again (clears the typed card; a token is single use, so call this after the host has used one). */
|
|
499
|
+
reset(): void;
|
|
500
|
+
/** Removes the card form (host teardown). The component re-creates it when its inputs change. */
|
|
501
|
+
destroyForm(): void;
|
|
502
|
+
/** The gate before ANYTHING starts: a paid or unknown payable, offline, or a failed readiness check refuses (nothing is sent, the reason is reported). */
|
|
503
|
+
private refusedByProtection;
|
|
504
|
+
/** "Retry loading" of a blocked payment SDK: builds the form again (the loader asks Square's CDN again). */
|
|
505
|
+
protected retryLoad(): void;
|
|
506
|
+
/** After a refused submit the focus goes to the bank field the message is about (the holder name or the authorization), once the view is up to date. */
|
|
507
|
+
private focusInput;
|
|
508
|
+
private errorOptions;
|
|
509
|
+
private shouldVerify;
|
|
510
|
+
private verify;
|
|
511
|
+
private fail;
|
|
512
|
+
/** A `card()` / `ach()` that answers AFTER the form gave up on it (timeout, or the inputs changed): the late object is destroyed, never leaked. A rejection is ignored. */
|
|
513
|
+
private discardLate;
|
|
514
|
+
private disposeInstances;
|
|
515
|
+
private loadFailed;
|
|
516
|
+
private init;
|
|
517
|
+
protected onTab(key: string): void;
|
|
518
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SquarePaymentComponent, never>;
|
|
519
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SquarePaymentComponent, "ui-square-payment", never, {
|
|
520
|
+
"mountOnly": {
|
|
521
|
+
"alias": "mountOnly";
|
|
522
|
+
"required": false;
|
|
523
|
+
"isSignal": true;
|
|
524
|
+
};
|
|
525
|
+
"mode": {
|
|
526
|
+
"alias": "mode";
|
|
527
|
+
"required": false;
|
|
528
|
+
"isSignal": true;
|
|
529
|
+
};
|
|
530
|
+
"method": {
|
|
531
|
+
"alias": "method";
|
|
532
|
+
"required": false;
|
|
533
|
+
"isSignal": true;
|
|
534
|
+
};
|
|
535
|
+
"methods": {
|
|
536
|
+
"alias": "methods";
|
|
537
|
+
"required": false;
|
|
538
|
+
"isSignal": true;
|
|
539
|
+
};
|
|
540
|
+
"applicationId": {
|
|
541
|
+
"alias": "applicationId";
|
|
542
|
+
"required": false;
|
|
543
|
+
"isSignal": true;
|
|
544
|
+
};
|
|
545
|
+
"locationId": {
|
|
546
|
+
"alias": "locationId";
|
|
547
|
+
"required": false;
|
|
548
|
+
"isSignal": true;
|
|
549
|
+
};
|
|
550
|
+
"environment": {
|
|
551
|
+
"alias": "environment";
|
|
552
|
+
"required": false;
|
|
553
|
+
"isSignal": true;
|
|
554
|
+
};
|
|
555
|
+
"amount": {
|
|
556
|
+
"alias": "amount";
|
|
557
|
+
"required": false;
|
|
558
|
+
"isSignal": true;
|
|
559
|
+
};
|
|
560
|
+
"currency": {
|
|
561
|
+
"alias": "currency";
|
|
562
|
+
"required": false;
|
|
563
|
+
"isSignal": true;
|
|
564
|
+
};
|
|
565
|
+
"billingContact": {
|
|
566
|
+
"alias": "billingContact";
|
|
567
|
+
"required": false;
|
|
568
|
+
"isSignal": true;
|
|
569
|
+
};
|
|
570
|
+
"verifyBuyer": {
|
|
571
|
+
"alias": "verifyBuyer";
|
|
572
|
+
"required": false;
|
|
573
|
+
"isSignal": true;
|
|
574
|
+
};
|
|
575
|
+
"accountHolderName": {
|
|
576
|
+
"alias": "accountHolderName";
|
|
577
|
+
"required": false;
|
|
578
|
+
"isSignal": true;
|
|
579
|
+
};
|
|
580
|
+
"requireAchConsent": {
|
|
581
|
+
"alias": "requireAchConsent";
|
|
582
|
+
"required": false;
|
|
583
|
+
"isSignal": true;
|
|
584
|
+
};
|
|
585
|
+
"achConsentTextInput": {
|
|
586
|
+
"alias": "achConsentText";
|
|
587
|
+
"required": false;
|
|
588
|
+
"isSignal": true;
|
|
589
|
+
};
|
|
590
|
+
"achRedirectUri": {
|
|
591
|
+
"alias": "achRedirectUri";
|
|
592
|
+
"required": false;
|
|
593
|
+
"isSignal": true;
|
|
594
|
+
};
|
|
595
|
+
"achTransactionId": {
|
|
596
|
+
"alias": "achTransactionId";
|
|
597
|
+
"required": false;
|
|
598
|
+
"isSignal": true;
|
|
599
|
+
};
|
|
600
|
+
"cardOptions": {
|
|
601
|
+
"alias": "cardOptions";
|
|
602
|
+
"required": false;
|
|
603
|
+
"isSignal": true;
|
|
604
|
+
};
|
|
605
|
+
"cardStyle": {
|
|
606
|
+
"alias": "cardStyle";
|
|
607
|
+
"required": false;
|
|
608
|
+
"isSignal": true;
|
|
609
|
+
};
|
|
610
|
+
"styleFromTokens": {
|
|
611
|
+
"alias": "styleFromTokens";
|
|
612
|
+
"required": false;
|
|
613
|
+
"isSignal": true;
|
|
614
|
+
};
|
|
615
|
+
"showStatus": {
|
|
616
|
+
"alias": "showStatus";
|
|
617
|
+
"required": false;
|
|
618
|
+
"isSignal": true;
|
|
619
|
+
};
|
|
620
|
+
"payableRef": {
|
|
621
|
+
"alias": "payableRef";
|
|
622
|
+
"required": false;
|
|
623
|
+
"isSignal": true;
|
|
624
|
+
};
|
|
625
|
+
"attemptKey": {
|
|
626
|
+
"alias": "attemptKey";
|
|
627
|
+
"required": false;
|
|
628
|
+
"isSignal": true;
|
|
629
|
+
};
|
|
630
|
+
"checkStatus": {
|
|
631
|
+
"alias": "checkStatus";
|
|
632
|
+
"required": false;
|
|
633
|
+
"isSignal": true;
|
|
634
|
+
};
|
|
635
|
+
"paid": {
|
|
636
|
+
"alias": "paid";
|
|
637
|
+
"required": false;
|
|
638
|
+
"isSignal": true;
|
|
639
|
+
};
|
|
640
|
+
"hostPending": {
|
|
641
|
+
"alias": "hostPending";
|
|
642
|
+
"required": false;
|
|
643
|
+
"isSignal": true;
|
|
644
|
+
};
|
|
645
|
+
"statusPollMs": {
|
|
646
|
+
"alias": "statusPollMs";
|
|
647
|
+
"required": false;
|
|
648
|
+
"isSignal": true;
|
|
649
|
+
};
|
|
650
|
+
"statusPollMaxMs": {
|
|
651
|
+
"alias": "statusPollMaxMs";
|
|
652
|
+
"required": false;
|
|
653
|
+
"isSignal": true;
|
|
654
|
+
};
|
|
655
|
+
"statusCheckTimeoutMs": {
|
|
656
|
+
"alias": "statusCheckTimeoutMs";
|
|
657
|
+
"required": false;
|
|
658
|
+
"isSignal": true;
|
|
659
|
+
};
|
|
660
|
+
"statusFailGraceMs": {
|
|
661
|
+
"alias": "statusFailGraceMs";
|
|
662
|
+
"required": false;
|
|
663
|
+
"isSignal": true;
|
|
664
|
+
};
|
|
665
|
+
"allowStartOver": {
|
|
666
|
+
"alias": "allowStartOver";
|
|
667
|
+
"required": false;
|
|
668
|
+
"isSignal": true;
|
|
669
|
+
};
|
|
670
|
+
"offlineOverride": {
|
|
671
|
+
"alias": "offlineOverride";
|
|
672
|
+
"required": false;
|
|
673
|
+
"isSignal": true;
|
|
674
|
+
};
|
|
675
|
+
"hostSilenceMs": {
|
|
676
|
+
"alias": "hostSilenceMs";
|
|
677
|
+
"required": false;
|
|
678
|
+
"isSignal": true;
|
|
679
|
+
};
|
|
680
|
+
"readinessCheck": {
|
|
681
|
+
"alias": "readinessCheck";
|
|
682
|
+
"required": false;
|
|
683
|
+
"isSignal": true;
|
|
684
|
+
};
|
|
685
|
+
"readinessTimeoutMs": {
|
|
686
|
+
"alias": "readinessTimeoutMs";
|
|
687
|
+
"required": false;
|
|
688
|
+
"isSignal": true;
|
|
689
|
+
};
|
|
690
|
+
"readinessEveryMs": {
|
|
691
|
+
"alias": "readinessEveryMs";
|
|
692
|
+
"required": false;
|
|
693
|
+
"isSignal": true;
|
|
694
|
+
};
|
|
695
|
+
"submitLabel": {
|
|
696
|
+
"alias": "submitLabel";
|
|
697
|
+
"required": false;
|
|
698
|
+
"isSignal": true;
|
|
699
|
+
};
|
|
700
|
+
"showSubmit": {
|
|
701
|
+
"alias": "showSubmit";
|
|
702
|
+
"required": false;
|
|
703
|
+
"isSignal": true;
|
|
704
|
+
};
|
|
705
|
+
"disabled": {
|
|
706
|
+
"alias": "disabled";
|
|
707
|
+
"required": false;
|
|
708
|
+
"isSignal": true;
|
|
709
|
+
};
|
|
710
|
+
"pending": {
|
|
711
|
+
"alias": "pending";
|
|
712
|
+
"required": false;
|
|
713
|
+
"isSignal": true;
|
|
714
|
+
};
|
|
715
|
+
"labelInput": {
|
|
716
|
+
"alias": "label";
|
|
717
|
+
"required": false;
|
|
718
|
+
"isSignal": true;
|
|
719
|
+
};
|
|
720
|
+
"required": {
|
|
721
|
+
"alias": "required";
|
|
722
|
+
"required": false;
|
|
723
|
+
"isSignal": true;
|
|
724
|
+
};
|
|
725
|
+
"mountId": {
|
|
726
|
+
"alias": "mountId";
|
|
727
|
+
"required": false;
|
|
728
|
+
"isSignal": true;
|
|
729
|
+
};
|
|
730
|
+
"mountClass": {
|
|
731
|
+
"alias": "mountClass";
|
|
732
|
+
"required": false;
|
|
733
|
+
"isSignal": true;
|
|
734
|
+
};
|
|
735
|
+
"mountTestId": {
|
|
736
|
+
"alias": "mountTestId";
|
|
737
|
+
"required": false;
|
|
738
|
+
"isSignal": true;
|
|
739
|
+
};
|
|
740
|
+
"errorTestId": {
|
|
741
|
+
"alias": "errorTestId";
|
|
742
|
+
"required": false;
|
|
743
|
+
"isSignal": true;
|
|
744
|
+
};
|
|
745
|
+
"holderTestId": {
|
|
746
|
+
"alias": "holderTestId";
|
|
747
|
+
"required": false;
|
|
748
|
+
"isSignal": true;
|
|
749
|
+
};
|
|
750
|
+
"showErrors": {
|
|
751
|
+
"alias": "showErrors";
|
|
752
|
+
"required": false;
|
|
753
|
+
"isSignal": true;
|
|
754
|
+
};
|
|
755
|
+
"errorDisplay": {
|
|
756
|
+
"alias": "errorDisplay";
|
|
757
|
+
"required": false;
|
|
758
|
+
"isSignal": true;
|
|
759
|
+
};
|
|
760
|
+
"errorMessages": {
|
|
761
|
+
"alias": "errorMessages";
|
|
762
|
+
"required": false;
|
|
763
|
+
"isSignal": true;
|
|
764
|
+
};
|
|
765
|
+
"errorFallback": {
|
|
766
|
+
"alias": "errorFallback";
|
|
767
|
+
"required": false;
|
|
768
|
+
"isSignal": true;
|
|
769
|
+
};
|
|
770
|
+
"loadErrorMessageInput": {
|
|
771
|
+
"alias": "loadErrorMessage";
|
|
772
|
+
"required": false;
|
|
773
|
+
"isSignal": true;
|
|
774
|
+
};
|
|
775
|
+
"a11yMessages": {
|
|
776
|
+
"alias": "a11yMessages";
|
|
777
|
+
"required": false;
|
|
778
|
+
"isSignal": true;
|
|
779
|
+
};
|
|
780
|
+
}, {
|
|
781
|
+
"method": "methodChange";
|
|
782
|
+
"squareReady": "squareReady";
|
|
783
|
+
"ready": "ready";
|
|
784
|
+
"inFlightChange": "inFlightChange";
|
|
785
|
+
"outcome": "outcome";
|
|
786
|
+
"attemptKeyChange": "attemptKeyChange";
|
|
787
|
+
"readinessChange": "readinessChange";
|
|
788
|
+
"tokenized": "tokenized";
|
|
789
|
+
"failed": "failed";
|
|
790
|
+
"loadError": "loadError";
|
|
791
|
+
}, never, never, true, never>;
|
|
792
|
+
}
|
|
793
|
+
/** The state of the seller's Square connection (the shape of contractor's `GET /integrations/square/status`, with the optional names a service may add). */
|
|
794
|
+
interface SquareConnectStatus {
|
|
795
|
+
connected: boolean;
|
|
796
|
+
/** The integration is switched on for this account (informational). */
|
|
797
|
+
enabled?: boolean;
|
|
798
|
+
merchantId?: string | null;
|
|
799
|
+
merchantName?: string | null;
|
|
800
|
+
locationId?: string | null;
|
|
801
|
+
locationName?: string | null;
|
|
802
|
+
/** ISO date-time the connection was made. */
|
|
803
|
+
connectedAt?: string | null;
|
|
804
|
+
/** The access token was revoked or expired for good: the seller has to authorize again. */
|
|
805
|
+
needsReconnect?: boolean;
|
|
806
|
+
}
|
|
807
|
+
/** What the start call answers: the address of Square's authorization page (`authUrl`, or `url`). */
|
|
808
|
+
interface SquareConnectStart {
|
|
809
|
+
authUrl?: string;
|
|
810
|
+
url?: string;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* What happened after the user pressed a button or the page asked for the state. The flow never shows toasts itself (each app has its own): the host words each outcome.
|
|
814
|
+
*
|
|
815
|
+
* - `connected`: the connection is live. `source: 'check'` = after "Check Status"; `'return'` = the state was read again when the user came back to this tab (`refreshOnReturn`).
|
|
816
|
+
* - `needs-reconnect`: Square no longer accepts the saved authorization.
|
|
817
|
+
* - `not-connected`: "Check Status" found no connection (the authorization was not finished).
|
|
818
|
+
* - `disconnected`: the connection was removed.
|
|
819
|
+
* - `link-unavailable`: the answer had no https Square address; nothing was opened.
|
|
820
|
+
* - `failed`: a call failed (`action` says which); `error` is what it threw.
|
|
821
|
+
*/
|
|
822
|
+
type SquareConnectOutcome = {
|
|
823
|
+
kind: 'connected';
|
|
824
|
+
source: 'check' | 'return';
|
|
825
|
+
} | {
|
|
826
|
+
kind: 'needs-reconnect';
|
|
827
|
+
source: 'check' | 'return';
|
|
828
|
+
} | {
|
|
829
|
+
kind: 'not-connected';
|
|
830
|
+
} | {
|
|
831
|
+
kind: 'disconnected';
|
|
832
|
+
} | {
|
|
833
|
+
kind: 'link-unavailable';
|
|
834
|
+
} | {
|
|
835
|
+
kind: 'failed';
|
|
836
|
+
action: 'start' | 'check' | 'disconnect';
|
|
837
|
+
error: unknown;
|
|
838
|
+
};
|
|
839
|
+
/** The state the flow reads and writes: signals owned by the host (or by the card's two-way models). */
|
|
840
|
+
interface SquareConnectState {
|
|
841
|
+
status: WritableSignal<SquareConnectStatus | null>;
|
|
842
|
+
loading: WritableSignal<boolean>;
|
|
843
|
+
}
|
|
844
|
+
interface SquareConnectFlowOptions {
|
|
845
|
+
/** Read at call time, so a host can swap the call. Null = no call yet (`start()` does nothing). */
|
|
846
|
+
start: () => (() => Observable<SquareConnectStart>) | null;
|
|
847
|
+
getStatus: () => (() => Observable<SquareConnectStatus>) | null;
|
|
848
|
+
disconnect: () => (() => Observable<unknown>) | null;
|
|
849
|
+
state: SquareConnectState;
|
|
850
|
+
/** Where outcomes go. */
|
|
851
|
+
emit: (outcome: SquareConnectOutcome) => void;
|
|
852
|
+
/** The buttons and methods do nothing while this says true (a read-only user). */
|
|
853
|
+
disabled?: () => boolean;
|
|
854
|
+
/** How THIS tab is sent to Square when the browser refused the new tab (default `window.location.href = url`). */
|
|
855
|
+
navigate?: (url: string) => void;
|
|
856
|
+
/** Called when Square's page was opened in a new tab (the card then offers "Check Status"). */
|
|
857
|
+
onOpened?: () => void;
|
|
858
|
+
destroyRef: DestroyRef;
|
|
859
|
+
}
|
|
860
|
+
/** Only an https address on Square's own domains (`squareup.com`, `squareupsandbox.com`, `square.com`, or a real subdomain): never `evilsquareup.com`, `http:` or `javascript:`. */
|
|
861
|
+
export declare function isSquareUrl(url: string | undefined | null): url is string;
|
|
862
|
+
/**
|
|
863
|
+
* The Square OAuth connection as a plain class: start (authorization page in a new tab), "Check Status", disconnect, and the "back from Square" read.
|
|
864
|
+
* `ui-square-connect` runs it behind its card; a host that has to start the flow from code creates its own instance over the same state signals.
|
|
865
|
+
* Square's page always opens in a NEW tab opened inside the click (a tab opened after the request is blocked by popup blockers); only an https Square address is
|
|
866
|
+
* opened; a failed call closes the empty tab.
|
|
867
|
+
*/
|
|
868
|
+
export declare class SquareConnectFlow {
|
|
869
|
+
private readonly o;
|
|
870
|
+
/** A Square tab was opened: the card reads the state again when the user comes back (`refreshOnReturn`). */
|
|
871
|
+
tabOpened: boolean;
|
|
872
|
+
constructor(o: SquareConnectFlowOptions);
|
|
873
|
+
private get blocked();
|
|
874
|
+
/** Asks for the authorization address and opens Square's page in a new tab. */
|
|
875
|
+
startConnect(): void;
|
|
876
|
+
/** "Check Status": reads the state and reports it. */
|
|
877
|
+
check(): void;
|
|
878
|
+
/** Removes the connection. The state becomes "not connected" only after the call succeeded. */
|
|
879
|
+
disconnect(): void;
|
|
880
|
+
/** The state read when the user came back to this tab: silent unless a connection is live or needs to be redone. */
|
|
881
|
+
readStatusOnReturn(): void;
|
|
882
|
+
private openSquare;
|
|
883
|
+
/** The empty tab, opened inside the click and cut from this page (`opener`); null when the browser refused. */
|
|
884
|
+
openBlankTab(): Window | null;
|
|
885
|
+
/** The browser refused the new tab: Square opens in this one. */
|
|
886
|
+
private navigateCurrentTab;
|
|
887
|
+
private closeTab;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The default wording of an outcome, for apps that just want a toast: `{ variant, message }`, or null when nothing should be said.
|
|
891
|
+
*/
|
|
892
|
+
export declare function squareConnectNotice(outcome: SquareConnectOutcome): {
|
|
893
|
+
variant: 'success' | 'info' | 'error';
|
|
894
|
+
message: string;
|
|
895
|
+
} | null;
|
|
896
|
+
/**
|
|
897
|
+
* "Square account": the card where a business connects the Square account it collects payments into (Square OAuth). The host owns the data (its three calls and the
|
|
898
|
+
* status value); the component owns the screen and the flow:
|
|
899
|
+
*
|
|
900
|
+
* - not connected: "Connect Square" (opens Square's authorization page in a NEW tab, then offers "Check Status");
|
|
901
|
+
* - connected: success with the merchant, the location and the date, "Check Status" and "Disconnect" (asks to confirm first);
|
|
902
|
+
* - needs reconnect: warning with "Reconnect".
|
|
903
|
+
*
|
|
904
|
+
* The page opens in a NEW tab opened inside the click (a tab opened after the request is blocked by popup blockers) and receives the address when it arrives; with the
|
|
905
|
+
* tab refused the address opens in the current tab. Only an https Square address is ever opened. A failed call closes the empty tab and is reported, never toasted.
|
|
906
|
+
*
|
|
907
|
+
* <ui-square-connect [(status)]="status" [startConnect]="start" [getStatus]="getStatus" [disconnect]="disconnect" [refreshOnReturn]="true" (outcome)="onOutcome($event)" />
|
|
908
|
+
*
|
|
909
|
+
* where `start = () => http.get<SquareConnectStart>('/integrations/square/connect')`, `getStatus = () => http.get<SquareConnectStatus>('/integrations/square/status')` and
|
|
910
|
+
* `disconnect = () => http.delete('/integrations/square/disconnect')`.
|
|
911
|
+
*/
|
|
912
|
+
export declare class SquareConnectComponent {
|
|
913
|
+
/** Unique per instance: two connect cards on one page must not share the id the dialog's description points at. */
|
|
914
|
+
protected readonly confirmMessageId: string;
|
|
915
|
+
protected readonly labels: UiLabelsService;
|
|
916
|
+
private readonly destroyRef;
|
|
917
|
+
private readonly injector;
|
|
918
|
+
private readonly host;
|
|
919
|
+
/** The call that answers Square's authorization address (`{ authUrl }`). Needed for `start()`. */
|
|
920
|
+
readonly startConnect: import("@angular/core").InputSignal<(() => Observable<SquareConnectStart>) | null>;
|
|
921
|
+
/** The call that reads the connection's state. Needed for `check()` and `refreshOnReturn`. */
|
|
922
|
+
readonly getStatus: import("@angular/core").InputSignal<(() => Observable<SquareConnectStatus>) | null>;
|
|
923
|
+
/** The call that removes the connection. Needed for "Disconnect". */
|
|
924
|
+
readonly disconnect: import("@angular/core").InputSignal<(() => Observable<unknown>) | null>;
|
|
925
|
+
/** The connection state (null = not read yet = shown as not connected). Two-way: the component sets it after "Check Status" and "Disconnect". */
|
|
926
|
+
readonly status: import("@angular/core").ModelSignal<SquareConnectStatus | null>;
|
|
927
|
+
readonly titleInput: import("@angular/core").InputSignal<string | null>;
|
|
928
|
+
readonly title: import("@angular/core").Signal<string>;
|
|
929
|
+
/** No card around the content: the text and the buttons sit directly in the host's own card (a setup wizard step). `title` is not shown then. */
|
|
930
|
+
readonly bare: import("@angular/core").InputSignal<boolean>;
|
|
931
|
+
readonly startTitleInput: import("@angular/core").InputSignal<string | null>;
|
|
932
|
+
readonly startTitle: import("@angular/core").Signal<string>;
|
|
933
|
+
readonly startTextInput: import("@angular/core").InputSignal<string | null>;
|
|
934
|
+
readonly startText: import("@angular/core").Signal<string>;
|
|
935
|
+
readonly startLabelInput: import("@angular/core").InputSignal<string | null>;
|
|
936
|
+
readonly startLabel: import("@angular/core").Signal<string>;
|
|
937
|
+
/** The buttons cannot be pressed (a read-only user). */
|
|
938
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
939
|
+
/** Ask before disconnecting (default true). */
|
|
940
|
+
readonly confirmDisconnect: import("@angular/core").InputSignal<boolean>;
|
|
941
|
+
/** After a Square tab was opened, the state is read again when this tab becomes visible again (the user came back): `(outcome)` then reports `connected` / `needs-reconnect` with source `return`. */
|
|
942
|
+
readonly refreshOnReturn: import("@angular/core").InputSignal<boolean>;
|
|
943
|
+
/** How the current tab is sent to Square when the browser refused the new tab (default: `window.location.href = url`). */
|
|
944
|
+
readonly navigateTab: import("@angular/core").InputSignal<((url: string) => void) | null>;
|
|
945
|
+
/** What happened (see {@link SquareConnectOutcome}); the host words it. */
|
|
946
|
+
readonly outcome: import("@angular/core").OutputEmitterRef<SquareConnectOutcome>;
|
|
947
|
+
/** A request is running: the buttons show "Loading..." / "Checking..." and cannot be pressed again. Two-way, so a host can read it. */
|
|
948
|
+
readonly loading: import("@angular/core").ModelSignal<boolean>;
|
|
949
|
+
protected readonly awaiting: import("@angular/core").WritableSignal<boolean>;
|
|
950
|
+
protected readonly confirming: import("@angular/core").WritableSignal<boolean>;
|
|
951
|
+
protected readonly state: import("@angular/core").Signal<"none" | "connected" | "reconnect">;
|
|
952
|
+
protected readonly merchant: import("@angular/core").Signal<string>;
|
|
953
|
+
protected readonly location: import("@angular/core").Signal<string>;
|
|
954
|
+
protected readonly connectedOn: import("@angular/core").Signal<string>;
|
|
955
|
+
/** What the persistent status region says: the current state, plus "Loading." while a request runs. */
|
|
956
|
+
protected readonly liveText: import("@angular/core").Signal<string>;
|
|
957
|
+
/** The user pressed a button that started a request: when the screen then changes, focus moves to the new screen (the pressed button is gone). */
|
|
958
|
+
private acted;
|
|
959
|
+
private lastState;
|
|
960
|
+
private readonly flow;
|
|
961
|
+
constructor();
|
|
962
|
+
/** Asks for the authorization address and opens Square's page in a new tab. */
|
|
963
|
+
start(): void;
|
|
964
|
+
/** "Check Status": reads the state; the card updates and the outcome is reported. */
|
|
965
|
+
check(): void;
|
|
966
|
+
/** "Disconnect": asks for confirmation first (`confirmDisconnect`, default), then removes the connection. */
|
|
967
|
+
askDisconnect(): void;
|
|
968
|
+
protected cancelDisconnect(): void;
|
|
969
|
+
/** Removes the connection (what the confirm's button calls). */
|
|
970
|
+
doDisconnect(): void;
|
|
971
|
+
/** The flow will really send a request (the host gave the call, nothing is running, the card is not read-only). */
|
|
972
|
+
private canRun;
|
|
973
|
+
/** The browser refused the new tab: Square opens in this one (through the host's `navigateTab` when it gave one). */
|
|
974
|
+
protected navigateCurrentTab(url: string): void;
|
|
975
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SquareConnectComponent, never>;
|
|
976
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SquareConnectComponent, "ui-square-connect", never, {
|
|
977
|
+
"startConnect": {
|
|
978
|
+
"alias": "startConnect";
|
|
979
|
+
"required": false;
|
|
980
|
+
"isSignal": true;
|
|
981
|
+
};
|
|
982
|
+
"getStatus": {
|
|
983
|
+
"alias": "getStatus";
|
|
984
|
+
"required": false;
|
|
985
|
+
"isSignal": true;
|
|
986
|
+
};
|
|
987
|
+
"disconnect": {
|
|
988
|
+
"alias": "disconnect";
|
|
989
|
+
"required": false;
|
|
990
|
+
"isSignal": true;
|
|
991
|
+
};
|
|
992
|
+
"status": {
|
|
993
|
+
"alias": "status";
|
|
994
|
+
"required": false;
|
|
995
|
+
"isSignal": true;
|
|
996
|
+
};
|
|
997
|
+
"titleInput": {
|
|
998
|
+
"alias": "title";
|
|
999
|
+
"required": false;
|
|
1000
|
+
"isSignal": true;
|
|
1001
|
+
};
|
|
1002
|
+
"bare": {
|
|
1003
|
+
"alias": "bare";
|
|
1004
|
+
"required": false;
|
|
1005
|
+
"isSignal": true;
|
|
1006
|
+
};
|
|
1007
|
+
"startTitleInput": {
|
|
1008
|
+
"alias": "startTitle";
|
|
1009
|
+
"required": false;
|
|
1010
|
+
"isSignal": true;
|
|
1011
|
+
};
|
|
1012
|
+
"startTextInput": {
|
|
1013
|
+
"alias": "startText";
|
|
1014
|
+
"required": false;
|
|
1015
|
+
"isSignal": true;
|
|
1016
|
+
};
|
|
1017
|
+
"startLabelInput": {
|
|
1018
|
+
"alias": "startLabel";
|
|
1019
|
+
"required": false;
|
|
1020
|
+
"isSignal": true;
|
|
1021
|
+
};
|
|
1022
|
+
"disabled": {
|
|
1023
|
+
"alias": "disabled";
|
|
1024
|
+
"required": false;
|
|
1025
|
+
"isSignal": true;
|
|
1026
|
+
};
|
|
1027
|
+
"confirmDisconnect": {
|
|
1028
|
+
"alias": "confirmDisconnect";
|
|
1029
|
+
"required": false;
|
|
1030
|
+
"isSignal": true;
|
|
1031
|
+
};
|
|
1032
|
+
"refreshOnReturn": {
|
|
1033
|
+
"alias": "refreshOnReturn";
|
|
1034
|
+
"required": false;
|
|
1035
|
+
"isSignal": true;
|
|
1036
|
+
};
|
|
1037
|
+
"navigateTab": {
|
|
1038
|
+
"alias": "navigateTab";
|
|
1039
|
+
"required": false;
|
|
1040
|
+
"isSignal": true;
|
|
1041
|
+
};
|
|
1042
|
+
"loading": {
|
|
1043
|
+
"alias": "loading";
|
|
1044
|
+
"required": false;
|
|
1045
|
+
"isSignal": true;
|
|
1046
|
+
};
|
|
1047
|
+
}, {
|
|
1048
|
+
"status": "statusChange";
|
|
1049
|
+
"outcome": "outcome";
|
|
1050
|
+
"loading": "loadingChange";
|
|
1051
|
+
}, never, never, true, never>;
|
|
1052
|
+
}
|
|
1053
|
+
/** What the host's `createPayment` receives: the entered payment, how it is applied to charges, and the single-use token Square gave for the customer's card / bank account. */
|
|
1054
|
+
interface SquarePaymentContext extends PaymentAllocation {
|
|
1055
|
+
/** The amount the payer owes (before processing fees), in major units (12.5 = $12.50). */
|
|
1056
|
+
amount: number;
|
|
1057
|
+
/** The method value that was selected (`'CARD'` / `'ACH'`). */
|
|
1058
|
+
paymentMethod: string;
|
|
1059
|
+
/** Square's side of it: `'card'` or `'ach'`. */
|
|
1060
|
+
method: SquareMethod;
|
|
1061
|
+
receivedDate: string;
|
|
1062
|
+
notes: string | null;
|
|
1063
|
+
/** The single-use source id: send it to your backend (which sends it to the payments service). */
|
|
1064
|
+
token: string;
|
|
1065
|
+
/** Brand, last four, bank name ... as far as the SDK sent them. */
|
|
1066
|
+
details: SquareTokenDetails;
|
|
1067
|
+
/** The card funding when the SDK already told it at tokenization (`null` otherwise: a backend that needs it reads `card_type` from Square once the card exists). */
|
|
1068
|
+
funding: SquareCardType | null;
|
|
1069
|
+
/** The buyer-verification (SCA) token, when the form ran `verifyBuyer`. */
|
|
1070
|
+
verificationToken: string | null;
|
|
1071
|
+
/**
|
|
1072
|
+
* @deprecated A new id per tokenization: do NOT use it as the Square `idempotency_key` (a retry with a new token would then be a second payment). Send `token` and `attemptKey` instead, and derive
|
|
1073
|
+
* the idempotency key from `attemptKey`.
|
|
1074
|
+
*/
|
|
1075
|
+
idempotencyKey: string;
|
|
1076
|
+
/**
|
|
1077
|
+
* The key of this PAYMENT ATTEMPT: stable across retries after a timeout / offline loss, a reload and a second tab (with a `payableRef` it is derived from payable, amount and method, so every tab holds
|
|
1078
|
+
* the SAME key); renewed only after a definitive failure or success. Send it to your backend with the charge (it looks the attempt up by it FIRST and derives the processor's idempotency key from it) and
|
|
1079
|
+
* answer `checkStatus(attemptKey)` with it.
|
|
1080
|
+
*/
|
|
1081
|
+
attemptKey: string;
|
|
1082
|
+
/** The payable of this attempt (the plugin's `payableRef` at the click): the backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key. */
|
|
1083
|
+
payableRef: string | null;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* What the host's `createPayment` answers. `status` is Square's payment status: `COMPLETED` = paid (a payment the host created with autocomplete answers `COMPLETED`), `APPROVED` (authorized, NOT captured yet)
|
|
1087
|
+
* and `PENDING` (and any other non-final value) = submitted and settling (a bank debit takes days), `FAILED` / `CANCELED` = not paid (the panel shows `failureMessage` / a default text and the payer can try again). Fees are optional;
|
|
1088
|
+
* when given they are shown as rows under the form.
|
|
1089
|
+
*/
|
|
1090
|
+
interface SquarePaymentResult {
|
|
1091
|
+
paymentId?: string | null;
|
|
1092
|
+
status?: string;
|
|
1093
|
+
failureMessage?: string;
|
|
1094
|
+
processingFee?: number;
|
|
1095
|
+
platformFee?: number;
|
|
1096
|
+
totalAmount?: number;
|
|
1097
|
+
processingFeeLabel?: string;
|
|
1098
|
+
platformFeeLabel?: string;
|
|
1099
|
+
}
|
|
1100
|
+
/** The fees of a payment, shown before the payer pays (the host's `estimateFees`) or after the payment exists. */
|
|
1101
|
+
interface SquareFees {
|
|
1102
|
+
processingFee?: number;
|
|
1103
|
+
platformFee?: number;
|
|
1104
|
+
/** What the payer is charged (amount + fees), shown as "Total charged". Display only: Square's form is not created for an amount. */
|
|
1105
|
+
totalAmount?: number;
|
|
1106
|
+
processingFeeLabel?: string;
|
|
1107
|
+
platformFeeLabel?: string;
|
|
1108
|
+
}
|
|
1109
|
+
interface SquareFeeContext {
|
|
1110
|
+
amount: number;
|
|
1111
|
+
paymentMethod: string;
|
|
1112
|
+
method: SquareMethod;
|
|
1113
|
+
/**
|
|
1114
|
+
* The card funding. Square's SDK does not know it before the customer pays, so this is `null` in the estimate; a credit-only fee schedule shows the credit fee
|
|
1115
|
+
* (or the highest) here and corrects the rows from the `createPayment` answer.
|
|
1116
|
+
*/
|
|
1117
|
+
funding: SquareCardType | null;
|
|
1118
|
+
}
|
|
1119
|
+
type SquareOutcomeKind = 'paid' | 'processing' | 'failed';
|
|
1120
|
+
/**
|
|
1121
|
+
* Square's payment `status` as one outcome. A non-final status (`PENDING`, `APPROVED` = authorized but not captured, anything unknown) counts as `'processing'`: the payment exists, so the payer is told it was submitted,
|
|
1122
|
+
* never "failed". No status at all (a host that answers nothing after it created the payment) is `'paid'` for a card and `'processing'` for a bank account, which never settles at once.
|
|
1123
|
+
*/
|
|
1124
|
+
export declare function squareOutcomeOf(status: string | null | undefined, method?: SquareMethod): SquareOutcomeKind;
|
|
1125
|
+
/** The method values the plugin takes over by default. */
|
|
1126
|
+
export declare const SQUARE_PAYMENT_METHOD_VALUES: readonly ["CARD", "ACH"];
|
|
1127
|
+
/** The name of a method in the app's active language (an unknown value is shown as it is). */
|
|
1128
|
+
export declare const squareMethodLabel: (value: string) => string;
|
|
1129
|
+
declare const squareMethodOf: (method: string) => SquareMethod;
|
|
1130
|
+
/** The texts of the Square payment method; read on every access, so they follow the app's active language. */
|
|
1131
|
+
export declare const SQUARE_METHOD_TEXTS: {
|
|
1132
|
+
readonly amountNeeded: string;
|
|
1133
|
+
readonly notCompleted: string;
|
|
1134
|
+
readonly achTitle: string;
|
|
1135
|
+
achMessage: (amount: string) => string;
|
|
1136
|
+
readonly pendingTitle: string;
|
|
1137
|
+
pendingMessage: (amount: string) => string;
|
|
1138
|
+
readonly receiptNote: string;
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* Adds LIVE Card and ACH (Square) to `ui-payment-side-panel`. Put it inside the panel only for customers who use Square: its presence replaces the record-only
|
|
1142
|
+
* Card / ACH (last 4 digits) with the Square card form / bank authorization; remove it and the panel is record-only again.
|
|
1143
|
+
*
|
|
1144
|
+
* <ui-payment-side-panel ...>
|
|
1145
|
+
* @if (squareEnabled()) {
|
|
1146
|
+
* <ui-square-payment-method [applicationId]="app" [locationId]="loc" environment="production" [createPayment]="createPayment" />
|
|
1147
|
+
* }
|
|
1148
|
+
* </ui-payment-side-panel>
|
|
1149
|
+
*
|
|
1150
|
+
* The host owns the HTTP: `createPayment(ctx)` receives the single-use token (and the entered amount, date, notes, allocation) and answers the payment result
|
|
1151
|
+
* (`{ status, fees... }`). Outcomes arrive as the panel's `outcome` events with kind `'plugin'` and codes `paid`, `processing` and `failed`.
|
|
1152
|
+
*/
|
|
1153
|
+
export declare class SquarePaymentMethodComponent extends PaymentMethodPlugin {
|
|
1154
|
+
protected readonly self: this;
|
|
1155
|
+
/** Creates the payment on the host's backend from the token (called when the payer presses Pay, after Square tokenized). */
|
|
1156
|
+
readonly createPayment: import("@angular/core").InputSignal<((ctx: SquarePaymentContext) => HostResult<SquarePaymentResult>) | null>;
|
|
1157
|
+
/** Optional fee preview before paying (display only). */
|
|
1158
|
+
readonly estimateFees: import("@angular/core").InputSignal<((ctx: SquareFeeContext) => HostResult<SquareFees>) | null>;
|
|
1159
|
+
readonly applicationId: import("@angular/core").InputSignal<string | null>;
|
|
1160
|
+
readonly locationId: import("@angular/core").InputSignal<string | null>;
|
|
1161
|
+
readonly environment: import("@angular/core").InputSignal<"production" | "sandbox" | null>;
|
|
1162
|
+
/** The buyer's billing contact: with it the card form runs buyer verification (SCA / 3-D Secure) before the token reaches your backend. */
|
|
1163
|
+
readonly billingContact: import("@angular/core").InputSignal<SquareBillingContact | null>;
|
|
1164
|
+
/** The account holder name offered for the bank account. */
|
|
1165
|
+
readonly accountHolderName: import("@angular/core").InputSignal<string>;
|
|
1166
|
+
/** ACH: the authorization checkbox must be ticked before the bank window opens. */
|
|
1167
|
+
readonly requireAchConsent: import("@angular/core").InputSignal<boolean>;
|
|
1168
|
+
readonly cardStyle: import("@angular/core").InputSignal<SquareCardStyle | null>;
|
|
1169
|
+
/** The methods this plugin takes over (default: Card and ACH / Bank Transfer). Pass `[{ value: 'CARD', label: 'Card' }]` for cards only. */
|
|
1170
|
+
readonly methodListInput: import("@angular/core").InputSignal<readonly PaymentPluginMethod[] | null>;
|
|
1171
|
+
readonly methodList: import("@angular/core").Signal<readonly PaymentPluginMethod[]>;
|
|
1172
|
+
/** How long a fee estimate may take before Pay is released and "Try again" is offered (ms). */
|
|
1173
|
+
readonly estimateTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
1174
|
+
/**
|
|
1175
|
+
* The payable this is for (an invoice, a balance, a payment link). While an attempt is undecided its opaque marker (key, amount, method) is stored under it in `localStorage`, so a RELOAD or a
|
|
1176
|
+
* SECOND TAB of the same payable starts locked (unknown) with the same attempt key. Without it the protection covers this page instance only. Nothing else is stored.
|
|
1177
|
+
*/
|
|
1178
|
+
readonly payableRef: import("@angular/core").InputSignal<string | null>;
|
|
1179
|
+
/** A key the host supplies for the charge; empty = the plugin generates one per payment attempt session (it arrives in `createPayment(ctx).attemptKey`). */
|
|
1180
|
+
readonly attemptKey: import("@angular/core").InputSignal<string | null>;
|
|
1181
|
+
/** The host's status check by attempt key: resolves an UNKNOWN outcome (timeout, offline mid-flight). */
|
|
1182
|
+
readonly checkStatus: import("@angular/core").InputSignal<CheckPaymentStatusFn | null>;
|
|
1183
|
+
/** The payable is paid (host re-render, back navigation): Pay stays locked for good. */
|
|
1184
|
+
readonly paid: import("@angular/core").InputSignal<boolean>;
|
|
1185
|
+
/** The host reports an ambiguous result of ITS charge call: the plugin goes to "Checking your payment..." while true. */
|
|
1186
|
+
readonly hostPending: import("@angular/core").InputSignal<boolean>;
|
|
1187
|
+
readonly statusPollMs: import("@angular/core").InputSignal<number>;
|
|
1188
|
+
readonly statusPollMaxMs: import("@angular/core").InputSignal<number>;
|
|
1189
|
+
/** A status check slower than this counts as unknown (ms). */
|
|
1190
|
+
readonly statusCheckTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
1191
|
+
/** While the attempt's own request is unsettled, a status answer `failed` is ignored for this long (ms). */
|
|
1192
|
+
readonly statusFailGraceMs: import("@angular/core").InputSignal<number>;
|
|
1193
|
+
/** Offer "Start over" after the status polling window (a new attempt with a NEW key). Turn it on ONLY when your backend allows ONE open or succeeded attempt per payable and answers 409 `payment_in_flight` to a second key: that rule is what makes it safe. */
|
|
1194
|
+
readonly allowStartOver: import("@angular/core").InputSignal<boolean>;
|
|
1195
|
+
/** Managed environments where `navigator.onLine === false` is a false negative (captive portal, VPN): do not refuse a payment because of the browser's offline flag (default false). */
|
|
1196
|
+
readonly offlineOverride: import("@angular/core").InputSignal<boolean>;
|
|
1197
|
+
/** The request timeout is replaced by this while a 3-D Secure challenge or the bank window is open (ms). */
|
|
1198
|
+
readonly authTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
1199
|
+
/** How long ONE `createPayment` (tokenize + charge) may take before the outcome counts as unknown (ms). */
|
|
1200
|
+
readonly paymentTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
1201
|
+
/** The host's readiness endpoint (`GET /api/payments/ready`): `{ ready, reasons[] }`. */
|
|
1202
|
+
readonly readinessCheck: import("@angular/core").InputSignal<ReadinessCheckFn | null>;
|
|
1203
|
+
readonly readinessTimeoutMs: import("@angular/core").InputSignal<number>;
|
|
1204
|
+
readonly readinessEveryMs: import("@angular/core").InputSignal<number>;
|
|
1205
|
+
/** The payer covers fees: a rejected or empty estimate keeps Pay off (with "Try again") instead of paying without the fee preview. */
|
|
1206
|
+
readonly feesRequired: import("@angular/core").InputSignal<boolean>;
|
|
1207
|
+
readonly receiptNoteInput: import("@angular/core").InputSignal<string | null>;
|
|
1208
|
+
readonly receiptNote: import("@angular/core").Signal<string>;
|
|
1209
|
+
private readonly body;
|
|
1210
|
+
private readonly controls;
|
|
1211
|
+
/** @internal The body registers itself. */
|
|
1212
|
+
attachControls(controls: PaymentAttemptControls): void;
|
|
1213
|
+
/** @internal The body leaves. */
|
|
1214
|
+
detachControls(controls: PaymentAttemptControls): void;
|
|
1215
|
+
/** The host's charge of this payment is ambiguous (its call timed out): the plugin shows "Checking your payment..." and stays locked (see `checkStatus`). */
|
|
1216
|
+
markUnknown(): void;
|
|
1217
|
+
/** The host's charge succeeded: the plugin records it (paid + complete) and locks the payable. */
|
|
1218
|
+
markSucceeded(): void;
|
|
1219
|
+
/** The host's charge was DEFINITIVELY refused: the plugin unlocks with a NEW attempt key. */
|
|
1220
|
+
markFailed(): void;
|
|
1221
|
+
/** NOTHING was sent to the processor: the plugin unlocks and the attempt key is KEPT (the backend must still answer the state of an attempt it already holds for that key). */
|
|
1222
|
+
markNotCharged(): void;
|
|
1223
|
+
/** The host starts a deliberate SECOND payment of this payable (an explicit "pay again" flow): forgets the paid state this form saw, removes the succeeded record and moves the epoch so the next attempt has a NEW key. Does nothing against the host's own `paid` input. */
|
|
1224
|
+
resetPaid(): void;
|
|
1225
|
+
readonly methods: import("@angular/core").Signal<readonly PaymentPluginMethod[]>;
|
|
1226
|
+
readonly template: import("@angular/core").Signal<TemplateRef<PaymentMethodBodyContext> | undefined>;
|
|
1227
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SquarePaymentMethodComponent, never>;
|
|
1228
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SquarePaymentMethodComponent, "ui-square-payment-method", never, {
|
|
1229
|
+
"createPayment": {
|
|
1230
|
+
"alias": "createPayment";
|
|
1231
|
+
"required": false;
|
|
1232
|
+
"isSignal": true;
|
|
1233
|
+
};
|
|
1234
|
+
"estimateFees": {
|
|
1235
|
+
"alias": "estimateFees";
|
|
1236
|
+
"required": false;
|
|
1237
|
+
"isSignal": true;
|
|
1238
|
+
};
|
|
1239
|
+
"applicationId": {
|
|
1240
|
+
"alias": "applicationId";
|
|
1241
|
+
"required": false;
|
|
1242
|
+
"isSignal": true;
|
|
1243
|
+
};
|
|
1244
|
+
"locationId": {
|
|
1245
|
+
"alias": "locationId";
|
|
1246
|
+
"required": false;
|
|
1247
|
+
"isSignal": true;
|
|
1248
|
+
};
|
|
1249
|
+
"environment": {
|
|
1250
|
+
"alias": "environment";
|
|
1251
|
+
"required": false;
|
|
1252
|
+
"isSignal": true;
|
|
1253
|
+
};
|
|
1254
|
+
"billingContact": {
|
|
1255
|
+
"alias": "billingContact";
|
|
1256
|
+
"required": false;
|
|
1257
|
+
"isSignal": true;
|
|
1258
|
+
};
|
|
1259
|
+
"accountHolderName": {
|
|
1260
|
+
"alias": "accountHolderName";
|
|
1261
|
+
"required": false;
|
|
1262
|
+
"isSignal": true;
|
|
1263
|
+
};
|
|
1264
|
+
"requireAchConsent": {
|
|
1265
|
+
"alias": "requireAchConsent";
|
|
1266
|
+
"required": false;
|
|
1267
|
+
"isSignal": true;
|
|
1268
|
+
};
|
|
1269
|
+
"cardStyle": {
|
|
1270
|
+
"alias": "cardStyle";
|
|
1271
|
+
"required": false;
|
|
1272
|
+
"isSignal": true;
|
|
1273
|
+
};
|
|
1274
|
+
"methodListInput": {
|
|
1275
|
+
"alias": "methodList";
|
|
1276
|
+
"required": false;
|
|
1277
|
+
"isSignal": true;
|
|
1278
|
+
};
|
|
1279
|
+
"estimateTimeoutMs": {
|
|
1280
|
+
"alias": "estimateTimeoutMs";
|
|
1281
|
+
"required": false;
|
|
1282
|
+
"isSignal": true;
|
|
1283
|
+
};
|
|
1284
|
+
"payableRef": {
|
|
1285
|
+
"alias": "payableRef";
|
|
1286
|
+
"required": false;
|
|
1287
|
+
"isSignal": true;
|
|
1288
|
+
};
|
|
1289
|
+
"attemptKey": {
|
|
1290
|
+
"alias": "attemptKey";
|
|
1291
|
+
"required": false;
|
|
1292
|
+
"isSignal": true;
|
|
1293
|
+
};
|
|
1294
|
+
"checkStatus": {
|
|
1295
|
+
"alias": "checkStatus";
|
|
1296
|
+
"required": false;
|
|
1297
|
+
"isSignal": true;
|
|
1298
|
+
};
|
|
1299
|
+
"paid": {
|
|
1300
|
+
"alias": "paid";
|
|
1301
|
+
"required": false;
|
|
1302
|
+
"isSignal": true;
|
|
1303
|
+
};
|
|
1304
|
+
"hostPending": {
|
|
1305
|
+
"alias": "hostPending";
|
|
1306
|
+
"required": false;
|
|
1307
|
+
"isSignal": true;
|
|
1308
|
+
};
|
|
1309
|
+
"statusPollMs": {
|
|
1310
|
+
"alias": "statusPollMs";
|
|
1311
|
+
"required": false;
|
|
1312
|
+
"isSignal": true;
|
|
1313
|
+
};
|
|
1314
|
+
"statusPollMaxMs": {
|
|
1315
|
+
"alias": "statusPollMaxMs";
|
|
1316
|
+
"required": false;
|
|
1317
|
+
"isSignal": true;
|
|
1318
|
+
};
|
|
1319
|
+
"statusCheckTimeoutMs": {
|
|
1320
|
+
"alias": "statusCheckTimeoutMs";
|
|
1321
|
+
"required": false;
|
|
1322
|
+
"isSignal": true;
|
|
1323
|
+
};
|
|
1324
|
+
"statusFailGraceMs": {
|
|
1325
|
+
"alias": "statusFailGraceMs";
|
|
1326
|
+
"required": false;
|
|
1327
|
+
"isSignal": true;
|
|
1328
|
+
};
|
|
1329
|
+
"allowStartOver": {
|
|
1330
|
+
"alias": "allowStartOver";
|
|
1331
|
+
"required": false;
|
|
1332
|
+
"isSignal": true;
|
|
1333
|
+
};
|
|
1334
|
+
"offlineOverride": {
|
|
1335
|
+
"alias": "offlineOverride";
|
|
1336
|
+
"required": false;
|
|
1337
|
+
"isSignal": true;
|
|
1338
|
+
};
|
|
1339
|
+
"authTimeoutMs": {
|
|
1340
|
+
"alias": "authTimeoutMs";
|
|
1341
|
+
"required": false;
|
|
1342
|
+
"isSignal": true;
|
|
1343
|
+
};
|
|
1344
|
+
"paymentTimeoutMs": {
|
|
1345
|
+
"alias": "paymentTimeoutMs";
|
|
1346
|
+
"required": false;
|
|
1347
|
+
"isSignal": true;
|
|
1348
|
+
};
|
|
1349
|
+
"readinessCheck": {
|
|
1350
|
+
"alias": "readinessCheck";
|
|
1351
|
+
"required": false;
|
|
1352
|
+
"isSignal": true;
|
|
1353
|
+
};
|
|
1354
|
+
"readinessTimeoutMs": {
|
|
1355
|
+
"alias": "readinessTimeoutMs";
|
|
1356
|
+
"required": false;
|
|
1357
|
+
"isSignal": true;
|
|
1358
|
+
};
|
|
1359
|
+
"readinessEveryMs": {
|
|
1360
|
+
"alias": "readinessEveryMs";
|
|
1361
|
+
"required": false;
|
|
1362
|
+
"isSignal": true;
|
|
1363
|
+
};
|
|
1364
|
+
"feesRequired": {
|
|
1365
|
+
"alias": "feesRequired";
|
|
1366
|
+
"required": false;
|
|
1367
|
+
"isSignal": true;
|
|
1368
|
+
};
|
|
1369
|
+
"receiptNoteInput": {
|
|
1370
|
+
"alias": "receiptNote";
|
|
1371
|
+
"required": false;
|
|
1372
|
+
"isSignal": true;
|
|
1373
|
+
};
|
|
1374
|
+
}, {}, never, never, true, never>;
|
|
1375
|
+
}
|
|
1376
|
+
export type { ProvideSquarePaymentOptions, SquareA11yMessages, SquareAchLike, SquareBillingContact, SquareCardLike, SquareCardStyle, SquareCardType, SquareConnectFlowOptions, SquareConnectOutcome, SquareConnectStart, SquareConnectState, SquareConnectStatus, SquareConnectionConfig, SquareEnvironment, SquareErrorDisplay, SquareErrorMessageOptions, SquareFailure, SquareFailureStage, SquareFeeContext, SquareFees, SquareIntentKind, SquareLoaderFn, SquareMethod, SquareOutcomeKind, SquarePaymentContext, SquarePaymentDefaults, SquarePaymentResult, SquarePaymentsLike, SquarePrepaidType, SquareReadyEvent, SquareTokenDetails, SquareTokenDetailsLike, SquareTokenError, SquareTokenResultLike, SquareTokenizedEvent, SquareVerifyBuyerDetails };
|