@ozura/elements 1.2.4-next.56 → 1.2.4-next.57
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/README.md +4 -2
- package/dist/oz-elements.esm.js +18 -7
- package/dist/oz-elements.esm.js.map +1 -1
- package/dist/oz-elements.umd.js +18 -7
- package/dist/oz-elements.umd.js.map +1 -1
- package/dist/react/index.cjs.js +18 -7
- package/dist/react/index.cjs.js.map +1 -1
- package/dist/react/index.esm.js +18 -7
- package/dist/react/index.esm.js.map +1 -1
- package/dist/react/react/index.d.ts +5 -2
- package/dist/react/sdk/OzVault.d.ts +1 -1
- package/dist/react/types/index.d.ts +7 -3
- package/dist/react/vue/index.d.ts +6 -3
- package/dist/server/sdk/OzVault.d.ts +1 -1
- package/dist/server/types/index.d.ts +7 -3
- package/dist/server/vue/index.d.ts +6 -3
- package/dist/types/sdk/OzVault.d.ts +1 -1
- package/dist/types/types/index.d.ts +7 -3
- package/dist/types/vue/index.d.ts +6 -3
- package/dist/vue/index.cjs.js +19 -8
- package/dist/vue/index.cjs.js.map +1 -1
- package/dist/vue/index.esm.js +19 -8
- package/dist/vue/index.esm.js.map +1 -1
- package/dist/vue/sdk/OzVault.d.ts +1 -1
- package/dist/vue/types/index.d.ts +7 -3
- package/dist/vue/vue/index.d.ts +6 -3
- package/package.json +1 -1
package/dist/react/index.esm.js
CHANGED
|
@@ -1035,7 +1035,7 @@ const DEFAULT_FRAME_BASE_URL = "https://lively-hill-097170c0f.4.azurestaticapps.
|
|
|
1035
1035
|
* @example
|
|
1036
1036
|
* // Recommended — pass sessionUrl and let the SDK call your backend automatically
|
|
1037
1037
|
* const vault = await OzVault.create({
|
|
1038
|
-
* pubKey: 'pk_prod_...', //
|
|
1038
|
+
* pubKey: 'pk_prod_...', // omit for test vault keys; required for production
|
|
1039
1039
|
* sessionUrl: '/api/oz-session', // backend endpoint that calls ozura.createSession()
|
|
1040
1040
|
* });
|
|
1041
1041
|
* const cardNum = vault.createElement('cardNumber');
|
|
@@ -1143,8 +1143,15 @@ class OzVault {
|
|
|
1143
1143
|
* @throws {OzError} if the session fetch fails, times out, or returns an empty string.
|
|
1144
1144
|
*/
|
|
1145
1145
|
static async create(options, signal) {
|
|
1146
|
-
|
|
1147
|
-
|
|
1146
|
+
// pubKey is optional — test vault keys (from a Test project on the vault)
|
|
1147
|
+
// do not require a pub key. Production keys do. If provided, it must be
|
|
1148
|
+
// non-empty after trimming; if omitted entirely, warn but continue.
|
|
1149
|
+
if (options.pubKey !== undefined && !options.pubKey.trim()) {
|
|
1150
|
+
throw new OzError('pubKey must be a non-empty string. Omit the option entirely to use a test vault key.');
|
|
1151
|
+
}
|
|
1152
|
+
if (options.pubKey === undefined) {
|
|
1153
|
+
console.warn('[OzVault] pubKey not provided — this only works with a test vault key from a Test project on the vault. ' +
|
|
1154
|
+
'For production, set pubKey to your pk_live_... or pk_prod_... value.');
|
|
1148
1155
|
}
|
|
1149
1156
|
// Normalize the session callback. Priority: sessionUrl > getSessionKey > fetchWaxKey (deprecated).
|
|
1150
1157
|
// This allows merchants to use the clean new API without touching legacy code.
|
|
@@ -1353,6 +1360,7 @@ class OzVault {
|
|
|
1353
1360
|
const requestId = `req-${uuid()}`;
|
|
1354
1361
|
this.log('createBankToken() called');
|
|
1355
1362
|
return new Promise((resolve, reject) => {
|
|
1363
|
+
var _a;
|
|
1356
1364
|
const resetCountAtStart = this._resetCount;
|
|
1357
1365
|
const cleanup = () => {
|
|
1358
1366
|
if (this._resetCount === resetCountAtStart)
|
|
@@ -1373,7 +1381,7 @@ class OzVault {
|
|
|
1373
1381
|
type: 'OZ_BANK_TOKENIZE',
|
|
1374
1382
|
requestId,
|
|
1375
1383
|
tokenizationSessionId: this.tokenizationSessionId,
|
|
1376
|
-
pubKey: this.pubKey,
|
|
1384
|
+
pubKey: (_a = this.pubKey) !== null && _a !== void 0 ? _a : '',
|
|
1377
1385
|
firstName: options.firstName.trim(),
|
|
1378
1386
|
lastName: options.lastName.trim(),
|
|
1379
1387
|
fieldCount: readyBankElements.length,
|
|
@@ -1472,6 +1480,7 @@ class OzVault {
|
|
|
1472
1480
|
billingPresent: Boolean(options.billing),
|
|
1473
1481
|
});
|
|
1474
1482
|
return new Promise((resolve, reject) => {
|
|
1483
|
+
var _a;
|
|
1475
1484
|
// Capture the reset generation so cleanup() only zeros _tokenizing when it
|
|
1476
1485
|
// still belongs to this invocation — not a newer one that started after a reset.
|
|
1477
1486
|
const resetCountAtStart = this._resetCount;
|
|
@@ -1496,7 +1505,7 @@ class OzVault {
|
|
|
1496
1505
|
type: 'OZ_TOKENIZE',
|
|
1497
1506
|
requestId,
|
|
1498
1507
|
tokenizationSessionId: this.tokenizationSessionId,
|
|
1499
|
-
pubKey: this.pubKey,
|
|
1508
|
+
pubKey: (_a = this.pubKey) !== null && _a !== void 0 ? _a : '',
|
|
1500
1509
|
firstName,
|
|
1501
1510
|
lastName,
|
|
1502
1511
|
fieldCount: readyElements.length,
|
|
@@ -1944,6 +1953,7 @@ class OzVault {
|
|
|
1944
1953
|
if (willRefresh) {
|
|
1945
1954
|
const resetCountAtRetry = this._resetCount;
|
|
1946
1955
|
this.refreshWaxKey().then(() => {
|
|
1956
|
+
var _a;
|
|
1947
1957
|
if (this._destroyed) {
|
|
1948
1958
|
pending.reject(new OzError('Vault destroyed during wax key refresh.'));
|
|
1949
1959
|
return;
|
|
@@ -1976,7 +1986,7 @@ class OzVault {
|
|
|
1976
1986
|
type: 'OZ_TOKENIZE',
|
|
1977
1987
|
requestId: newRequestId,
|
|
1978
1988
|
tokenizationSessionId: this.tokenizationSessionId,
|
|
1979
|
-
pubKey: this.pubKey,
|
|
1989
|
+
pubKey: (_a = this.pubKey) !== null && _a !== void 0 ? _a : '',
|
|
1980
1990
|
firstName: pending.firstName,
|
|
1981
1991
|
lastName: pending.lastName,
|
|
1982
1992
|
fieldCount: pending.fieldCount,
|
|
@@ -2020,6 +2030,7 @@ class OzVault {
|
|
|
2020
2030
|
if (this.isRefreshableAuthError(errorCode, raw) && !bankPending.retried && this._storedFetchWaxKey) {
|
|
2021
2031
|
const resetCountAtRetry = this._resetCount;
|
|
2022
2032
|
this.refreshWaxKey().then(() => {
|
|
2033
|
+
var _a;
|
|
2023
2034
|
if (this._destroyed) {
|
|
2024
2035
|
bankPending.reject(new OzError('Vault destroyed during wax key refresh.'));
|
|
2025
2036
|
return;
|
|
@@ -2042,7 +2053,7 @@ class OzVault {
|
|
|
2042
2053
|
type: 'OZ_BANK_TOKENIZE',
|
|
2043
2054
|
requestId: newRequestId,
|
|
2044
2055
|
tokenizationSessionId: this.tokenizationSessionId,
|
|
2045
|
-
pubKey: this.pubKey,
|
|
2056
|
+
pubKey: (_a = this.pubKey) !== null && _a !== void 0 ? _a : '',
|
|
2046
2057
|
firstName: bankPending.firstName,
|
|
2047
2058
|
lastName: bankPending.lastName,
|
|
2048
2059
|
fieldCount: bankPending.fieldCount,
|