@ozura/elements 1.3.1-next.69 → 1.3.1-next.70

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.
@@ -356,15 +356,22 @@ export interface TokenizeOptions {
356
356
  }
357
357
  /** Options for `vault.createBankToken()`. */
358
358
  export interface BankTokenizeOptions {
359
- /** Account holder first name. Required. */
360
- firstName: string;
361
- /** Account holder last name. Required. */
362
- lastName: string;
363
359
  /**
364
- * Optional billing details for the account holder.
365
- * When provided, firstName and lastName inside `billing` take precedence
366
- * over the top-level fields. The normalized details are echoed back in
367
- * `BankTokenResponse.billing` for convenience.
360
+ * Account holder first name.
361
+ * Required when `billing` is not provided.
362
+ * @deprecated Pass firstName inside `billing` instead.
363
+ */
364
+ firstName?: string;
365
+ /**
366
+ * Account holder last name.
367
+ * Required when `billing` is not provided.
368
+ * @deprecated Pass lastName inside `billing` instead.
369
+ */
370
+ lastName?: string;
371
+ /**
372
+ * Billing details for the account holder. When provided, `billing.firstName`
373
+ * and `billing.lastName` take precedence over the top-level fields.
374
+ * The normalized details are echoed back in `BankTokenResponse.billing`.
368
375
  */
369
376
  billing?: BillingDetails;
370
377
  }
@@ -103,7 +103,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
103
103
  default: undefined;
104
104
  };
105
105
  onLoadError: {
106
- type: PropType<() => void>;
106
+ type: PropType<(info?: {
107
+ source: "tokenizer";
108
+ }) => void>;
107
109
  default: undefined;
108
110
  };
109
111
  sessionLimit: {
@@ -158,7 +160,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
158
160
  default: undefined;
159
161
  };
160
162
  onLoadError: {
161
- type: PropType<() => void>;
163
+ type: PropType<(info?: {
164
+ source: "tokenizer";
165
+ }) => void>;
162
166
  default: undefined;
163
167
  };
164
168
  sessionLimit: {
@@ -180,7 +184,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
180
184
  maxTokenizeCalls: number;
181
185
  sessionUrl: string;
182
186
  getSessionKey: (sessionId: string) => Promise<string>;
183
- onLoadError: () => void;
187
+ onLoadError: (info?: {
188
+ source: "tokenizer";
189
+ }) => void;
184
190
  onSessionRefresh: () => void;
185
191
  onReady: () => void;
186
192
  appearance: Appearance;
@@ -356,15 +356,22 @@ export interface TokenizeOptions {
356
356
  }
357
357
  /** Options for `vault.createBankToken()`. */
358
358
  export interface BankTokenizeOptions {
359
- /** Account holder first name. Required. */
360
- firstName: string;
361
- /** Account holder last name. Required. */
362
- lastName: string;
363
359
  /**
364
- * Optional billing details for the account holder.
365
- * When provided, firstName and lastName inside `billing` take precedence
366
- * over the top-level fields. The normalized details are echoed back in
367
- * `BankTokenResponse.billing` for convenience.
360
+ * Account holder first name.
361
+ * Required when `billing` is not provided.
362
+ * @deprecated Pass firstName inside `billing` instead.
363
+ */
364
+ firstName?: string;
365
+ /**
366
+ * Account holder last name.
367
+ * Required when `billing` is not provided.
368
+ * @deprecated Pass lastName inside `billing` instead.
369
+ */
370
+ lastName?: string;
371
+ /**
372
+ * Billing details for the account holder. When provided, `billing.firstName`
373
+ * and `billing.lastName` take precedence over the top-level fields.
374
+ * The normalized details are echoed back in `BankTokenResponse.billing`.
368
375
  */
369
376
  billing?: BillingDetails;
370
377
  }
@@ -103,7 +103,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
103
103
  default: undefined;
104
104
  };
105
105
  onLoadError: {
106
- type: PropType<() => void>;
106
+ type: PropType<(info?: {
107
+ source: "tokenizer";
108
+ }) => void>;
107
109
  default: undefined;
108
110
  };
109
111
  sessionLimit: {
@@ -158,7 +160,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
158
160
  default: undefined;
159
161
  };
160
162
  onLoadError: {
161
- type: PropType<() => void>;
163
+ type: PropType<(info?: {
164
+ source: "tokenizer";
165
+ }) => void>;
162
166
  default: undefined;
163
167
  };
164
168
  sessionLimit: {
@@ -184,7 +188,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
184
188
  appearance: Appearance;
185
189
  onSessionRefresh: () => void;
186
190
  onReady: () => void;
187
- onLoadError: () => void;
191
+ onLoadError: (info?: {
192
+ source: "tokenizer";
193
+ }) => void;
188
194
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
189
195
  export interface UseOzElementsReturn {
190
196
  /**
@@ -356,15 +356,22 @@ export interface TokenizeOptions {
356
356
  }
357
357
  /** Options for `vault.createBankToken()`. */
358
358
  export interface BankTokenizeOptions {
359
- /** Account holder first name. Required. */
360
- firstName: string;
361
- /** Account holder last name. Required. */
362
- lastName: string;
363
359
  /**
364
- * Optional billing details for the account holder.
365
- * When provided, firstName and lastName inside `billing` take precedence
366
- * over the top-level fields. The normalized details are echoed back in
367
- * `BankTokenResponse.billing` for convenience.
360
+ * Account holder first name.
361
+ * Required when `billing` is not provided.
362
+ * @deprecated Pass firstName inside `billing` instead.
363
+ */
364
+ firstName?: string;
365
+ /**
366
+ * Account holder last name.
367
+ * Required when `billing` is not provided.
368
+ * @deprecated Pass lastName inside `billing` instead.
369
+ */
370
+ lastName?: string;
371
+ /**
372
+ * Billing details for the account holder. When provided, `billing.firstName`
373
+ * and `billing.lastName` take precedence over the top-level fields.
374
+ * The normalized details are echoed back in `BankTokenResponse.billing`.
368
375
  */
369
376
  billing?: BillingDetails;
370
377
  }
@@ -103,7 +103,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
103
103
  default: undefined;
104
104
  };
105
105
  onLoadError: {
106
- type: PropType<() => void>;
106
+ type: PropType<(info?: {
107
+ source: "tokenizer";
108
+ }) => void>;
107
109
  default: undefined;
108
110
  };
109
111
  sessionLimit: {
@@ -158,7 +160,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
158
160
  default: undefined;
159
161
  };
160
162
  onLoadError: {
161
- type: PropType<() => void>;
163
+ type: PropType<(info?: {
164
+ source: "tokenizer";
165
+ }) => void>;
162
166
  default: undefined;
163
167
  };
164
168
  sessionLimit: {
@@ -184,7 +188,9 @@ export declare const OzElements: import("vue").DefineComponent<import("vue").Ext
184
188
  appearance: Appearance;
185
189
  onSessionRefresh: () => void;
186
190
  onReady: () => void;
187
- onLoadError: () => void;
191
+ onLoadError: (info?: {
192
+ source: "tokenizer";
193
+ }) => void;
188
194
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
189
195
  export interface UseOzElementsReturn {
190
196
  /**
@@ -2357,7 +2357,20 @@ const OzElements = vue.defineComponent({
2357
2357
  vue.onMounted(() => {
2358
2358
  const ac = new AbortController();
2359
2359
  abortController = ac;
2360
- OzVault.create(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ pubKey: props.pubKey }, (props.sessionUrl ? { sessionUrl: props.sessionUrl } : {})), (props.getSessionKey ? { getSessionKey: props.getSessionKey } : {})), (props.frameBaseUrl ? { frameBaseUrl: props.frameBaseUrl } : {})), (props.fonts ? { fonts: props.fonts } : {})), (props.appearance ? { appearance: props.appearance } : {})), (props.loadTimeoutMs !== undefined ? { loadTimeoutMs: props.loadTimeoutMs } : {})), (props.onLoadError ? { onLoadError: props.onLoadError } : {})), (props.debug ? { debug: props.debug } : {})), {
2360
+ // Guard: onLoadError must fire at most once per mount cycle. It can be
2361
+ // triggered by two independent paths — the vault's iframe load timeout
2362
+ // (inside OzVault constructor) and the .catch below when create() rejects
2363
+ // after the timeout has already fired. Without this flag both paths would
2364
+ // call the callback, mirroring the same guard used in the React provider.
2365
+ let loadErrorFired = false;
2366
+ const fireLoadError = () => {
2367
+ var _a;
2368
+ if (loadErrorFired)
2369
+ return;
2370
+ loadErrorFired = true;
2371
+ (_a = props.onLoadError) === null || _a === void 0 ? void 0 : _a.call(props, { source: 'tokenizer' });
2372
+ };
2373
+ OzVault.create(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ pubKey: props.pubKey }, (props.sessionUrl ? { sessionUrl: props.sessionUrl } : {})), (props.getSessionKey ? { getSessionKey: props.getSessionKey } : {})), (props.frameBaseUrl ? { frameBaseUrl: props.frameBaseUrl } : {})), (props.fonts ? { fonts: props.fonts } : {})), (props.appearance ? { appearance: props.appearance } : {})), (props.loadTimeoutMs !== undefined ? { loadTimeoutMs: props.loadTimeoutMs } : {})), (props.onLoadError ? { onLoadError: fireLoadError } : {})), (props.debug ? { debug: props.debug } : {})), {
2361
2374
  // Session lifecycle — wire refresh callback and reset tokenizeCount so the
2362
2375
  // counter stays accurate across proactive key refreshes (mirrors React provider).
2363
2376
  // Deferred by one microtask for the same reason as React: notifyTokenize fires
@@ -2380,7 +2393,7 @@ const OzElements = vue.defineComponent({
2380
2393
  return;
2381
2394
  initError.value = err instanceof Error ? err : new Error('OzVault.create() failed.');
2382
2395
  if (props.onLoadError) {
2383
- props.onLoadError({ source: 'tokenizer' });
2396
+ fireLoadError();
2384
2397
  }
2385
2398
  else {
2386
2399
  console.error('[OzElements] OzVault.create() failed. Provide an `onLoadError` prop to handle this gracefully.', err);