@ozura/elements 1.3.1-next.78 → 1.3.1-next.79

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.
Files changed (2) hide show
  1. package/README.md +7 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -810,7 +810,7 @@ import { OzBankAccountNumber, OzBankRoutingNumber } from '@ozura/elements/react'
810
810
  ### useOzElements()
811
811
 
812
812
  ```ts
813
- const { createToken, createBankToken, reset, ready, initError, tokenizeCount } = useOzElements();
813
+ const { createToken, createBankToken, reset, ready, initError, tokenizeCount, isComplete, isBankComplete, isTokenizing } = useOzElements();
814
814
  ```
815
815
 
816
816
  Must be called from inside an `<OzElements>` provider tree.
@@ -823,6 +823,9 @@ Must be called from inside an `<OzElements>` provider tree.
823
823
  | `ready` | `boolean` | `true` when the tokenizer **and** all mounted element iframes are ready. Gate your submit button on this. See note below. |
824
824
  | `initError` | `Error \| null` | Non-null if `OzVault.create()` failed (e.g. session endpoint unreachable). Render a fallback UI. |
825
825
  | `tokenizeCount` | `number` | Number of successful tokenizations in the current session. Resets on session refresh or provider re-init. Useful for tracking calls against `sessionLimit`. |
826
+ | `isComplete` | `boolean` | `true` when every mounted **card** field reports complete and valid. Gate the pay button on it without wiring per-field `onChange`. Reactive — updates as the customer types. |
827
+ | `isBankComplete` | `boolean` | Same as `isComplete`, but for mounted **bank** fields (`OzBankCard` / bank elements). Card and bank completion are tracked independently. |
828
+ | `isTokenizing` | `boolean` | `true` while `createToken()` / `createBankToken()` is in progress (including the transparent wax-key refresh). Keep the pay button disabled to prevent double-submission. |
826
829
 
827
830
  > **`ready` vs `vault.isReady`:** `ready` from `useOzElements()` is a composite — it combines `vault.isReady` (tokenizer loaded) with element readiness (all mounted input iframes loaded). `vault.isReady` alone is insufficient for gating a submit button. Always use `ready` from `useOzElements()` in React.
828
831
 
@@ -937,6 +940,9 @@ Keys exist only for fields you have created (card and bank combined), so access
937
940
  | `initError` | `Ref<Error \| null>` | Non-null if `OzVault.create()` failed. Render a fallback UI. |
938
941
  | `tokenizeCount` | `Ref<number>` | Successful tokenizations in the current session. Resets on session refresh. |
939
942
  | `reset` | `() => void` | Clear all fields without destroying the vault. Call after a declined payment. |
943
+ | `isComplete` | `ComputedRef<boolean>` | `true` when every mounted **card** field reports complete and valid. Gate the pay button on it. |
944
+ | `isBankComplete` | `ComputedRef<boolean>` | Same as `isComplete`, but for mounted **bank** fields. Tracked independently. |
945
+ | `isTokenizing` | `ComputedRef<boolean>` | `true` while `createToken()` / `createBankToken()` is in progress (incl. wax-key refresh). Keep the pay button disabled. |
940
946
 
941
947
  ### useFieldStates()
942
948
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozura/elements",
3
- "version": "1.3.1-next.78",
3
+ "version": "1.3.1-next.79",
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",