@ozura/elements 1.2.0-next.30 → 1.2.0-next.31

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.
@@ -22,6 +22,8 @@ export declare class ElementFrame {
22
22
  private vaultId;
23
23
  private frameId;
24
24
  private hostOrigin;
25
+ /** Mirrors the parent vault's debug flag — set via OZ_INIT. */
26
+ private debug;
25
27
  private rawValue;
26
28
  private cardBrand;
27
29
  private cvvMaxLength;
@@ -30,7 +30,16 @@ export declare class TokenizerFrame {
30
30
  private waxKey;
31
31
  private pending;
32
32
  private pendingBank;
33
+ /** Mirrors the parent vault's debug flag — set via OZ_INIT. When true, the frame relays debug-level info in addition to errors/warnings. */
34
+ private debug;
33
35
  constructor();
36
+ /**
37
+ * Relays a warning or error message to the parent window as OZ_DEBUG_LOG so
38
+ * it surfaces in the merchant page's DevTools console rather than the hidden
39
+ * tokenizer-frame context. Errors/warnings are always relayed; debug-level
40
+ * info is gated on this.debug.
41
+ */
42
+ private postDebugLog;
34
43
  private onMessage;
35
44
  /**
36
45
  * Shared vault POST helper. Handles origin guard, header construction,
@@ -24,7 +24,8 @@ export declare class OzElement {
24
24
  private handlers;
25
25
  /** Called by OzVault when this element is destroyed so it can remove stale map entries. @internal */
26
26
  private _onDestroy;
27
- constructor(elementType: AnyElementType, options: ElementOptions, vaultId: string, frameBaseUrl: string, fonts?: FontSource[], appearanceStyle?: ElementStyleConfig, onDestroy?: () => void);
27
+ private debug;
28
+ constructor(elementType: AnyElementType, options: ElementOptions, vaultId: string, frameBaseUrl: string, fonts?: FontSource[], appearanceStyle?: ElementStyleConfig, onDestroy?: () => void, debug?: boolean);
28
29
  /** The element type this proxy represents. */
29
30
  get type(): AnyElementType;
30
31
  /** True once the element iframe has loaded and signalled ready. */
@@ -51,6 +51,13 @@ export interface OzuraConfig {
51
51
  timeoutMs?: number;
52
52
  /** Max retry attempts for 5xx / network errors. Default: 2 (up to 3 total attempts). Set 0 to disable. */
53
53
  retries?: number;
54
+ /**
55
+ * Enables structured debug logging to the server console.
56
+ * Logs method, path, HTTP status, and duration for every Pay API and vault request.
57
+ * Request bodies are included with sensitive fields (tokens, session keys) redacted.
58
+ * Never enable in production — for local development and CI debugging only.
59
+ */
60
+ debug?: boolean;
54
61
  }
55
62
  export declare class OzuraError extends Error {
56
63
  readonly statusCode: number;
@@ -191,7 +198,15 @@ export declare class Ozura {
191
198
  private vaultUrl;
192
199
  private timeoutMs;
193
200
  private retries;
201
+ private debug;
194
202
  constructor(config: OzuraConfig);
203
+ /** Emits a `[Ozura]`-prefixed entry to `console.log`. No-op when `debug` is not set. */
204
+ private log;
205
+ /**
206
+ * Returns a copy of `body` with known-sensitive fields replaced by `'[REDACTED]'`.
207
+ * Used to make debug logs safe to emit without leaking vault tokens or session keys.
208
+ */
209
+ private static redactBody;
195
210
  /**
196
211
  * Charge a tokenized card. Maps the friendly `CardSaleInput` shape to the
197
212
  * Pay API's flat field format and handles headers, defaults, and errors.
@@ -656,7 +656,7 @@ export interface TransactionQueryResponse {
656
656
  data: TransactionData[];
657
657
  pagination: TransactionQueryPagination;
658
658
  }
659
- export type OzMessageType = 'OZ_FRAME_READY' | 'OZ_INIT' | 'OZ_UPDATE' | 'OZ_CLEAR' | 'OZ_CHANGE' | 'OZ_FOCUS' | 'OZ_BLUR' | 'OZ_RESIZE' | 'OZ_BEGIN_COLLECT' | 'OZ_FIELD_VALUE' | 'OZ_TOKENIZE' | 'OZ_TOKEN_RESULT' | 'OZ_TOKEN_ERROR' | 'OZ_FOCUS_REQUEST' | 'OZ_BLUR_REQUEST' | 'OZ_SET_CVV_LENGTH' | 'OZ_BANK_TOKENIZE' | 'OZ_BANK_TOKEN_RESULT' | 'OZ_TOKENIZE_CANCEL';
659
+ export type OzMessageType = 'OZ_FRAME_READY' | 'OZ_INIT' | 'OZ_UPDATE' | 'OZ_CLEAR' | 'OZ_CHANGE' | 'OZ_FOCUS' | 'OZ_BLUR' | 'OZ_RESIZE' | 'OZ_BEGIN_COLLECT' | 'OZ_FIELD_VALUE' | 'OZ_TOKENIZE' | 'OZ_TOKEN_RESULT' | 'OZ_TOKEN_ERROR' | 'OZ_FOCUS_REQUEST' | 'OZ_BLUR_REQUEST' | 'OZ_SET_CVV_LENGTH' | 'OZ_BANK_TOKENIZE' | 'OZ_BANK_TOKEN_RESULT' | 'OZ_TOKENIZE_CANCEL' | 'OZ_DEBUG_LOG';
660
660
  export interface OzMessage {
661
661
  __oz: true;
662
662
  /** Protocol version stamped by the frame on OZ_FRAME_READY. Read by the SDK to detect stale CDN frames. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozura/elements",
3
- "version": "1.2.0-next.30",
3
+ "version": "1.2.0-next.31",
4
4
  "description": "PCI-compliant card tokenization SDK for the Ozura Vault — collect card data in iframe-isolated fields and tokenize without PCI scope",
5
5
  "main": "dist/oz-elements.umd.js",
6
6
  "module": "dist/oz-elements.esm.js",