@blotoutio/providers-blotout-wallet-sdk 0.45.1 → 0.45.2
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/index.cjs.js +3 -17
- package/index.js +3 -17
- package/index.mjs +3 -17
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -38,9 +38,6 @@ const packageName = 'blotoutWallet';
|
|
38
38
|
const cartTokenCookie = 'cart';
|
39
39
|
const cartTokenTwoCookie = 'cart2';
|
40
40
|
const cartCurrencyCookie = 'cart_currency';
|
41
|
-
const checkoutCookie = 'checkout_session_lookup';
|
42
|
-
|
43
|
-
const init = () => { };
|
44
41
|
|
45
42
|
const getCookieValue = (key) => {
|
46
43
|
try {
|
@@ -71,8 +68,7 @@ const registryKey = Symbol.for('blotout-wallet');
|
|
71
68
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
72
69
|
|
73
70
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
74
|
-
const tag = () => {
|
75
|
-
var _a;
|
71
|
+
const tag = ({ eventName }) => {
|
76
72
|
if (!window) {
|
77
73
|
return;
|
78
74
|
}
|
@@ -84,17 +80,8 @@ const tag = () => {
|
|
84
80
|
if (!cartToken) {
|
85
81
|
cartToken = getCookieValue(cartTokenTwoCookie);
|
86
82
|
}
|
87
|
-
if (
|
88
|
-
|
89
|
-
try {
|
90
|
-
const checkout = JSON.parse(checkoutSession);
|
91
|
-
if (((_a = checkout === null || checkout === void 0 ? void 0 : checkout.keys) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
92
|
-
cartToken = checkout.keys[checkout.keys.length - 1].source_id;
|
93
|
-
}
|
94
|
-
}
|
95
|
-
catch {
|
96
|
-
// do nothing
|
97
|
-
}
|
83
|
+
if (eventName === 'Purchase') {
|
84
|
+
document.cookie = 'cart2=;path=/;Max-Age=0';
|
98
85
|
}
|
99
86
|
return { platform, cartToken, cartCurrency };
|
100
87
|
}
|
@@ -107,7 +94,6 @@ const tag = () => {
|
|
107
94
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
108
95
|
const data = {
|
109
96
|
name: packageName,
|
110
|
-
init,
|
111
97
|
tag,
|
112
98
|
};
|
113
99
|
try {
|
package/index.js
CHANGED
@@ -39,9 +39,6 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
39
39
|
const cartTokenCookie = 'cart';
|
40
40
|
const cartTokenTwoCookie = 'cart2';
|
41
41
|
const cartCurrencyCookie = 'cart_currency';
|
42
|
-
const checkoutCookie = 'checkout_session_lookup';
|
43
|
-
|
44
|
-
const init = () => { };
|
45
42
|
|
46
43
|
const getCookieValue = (key) => {
|
47
44
|
try {
|
@@ -72,8 +69,7 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
72
69
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
73
70
|
|
74
71
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
75
|
-
const tag = () => {
|
76
|
-
var _a;
|
72
|
+
const tag = ({ eventName }) => {
|
77
73
|
if (!window) {
|
78
74
|
return;
|
79
75
|
}
|
@@ -85,17 +81,8 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
85
81
|
if (!cartToken) {
|
86
82
|
cartToken = getCookieValue(cartTokenTwoCookie);
|
87
83
|
}
|
88
|
-
if (
|
89
|
-
|
90
|
-
try {
|
91
|
-
const checkout = JSON.parse(checkoutSession);
|
92
|
-
if (((_a = checkout === null || checkout === void 0 ? void 0 : checkout.keys) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
93
|
-
cartToken = checkout.keys[checkout.keys.length - 1].source_id;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
catch {
|
97
|
-
// do nothing
|
98
|
-
}
|
84
|
+
if (eventName === 'Purchase') {
|
85
|
+
document.cookie = 'cart2=;path=/;Max-Age=0';
|
99
86
|
}
|
100
87
|
return { platform, cartToken, cartCurrency };
|
101
88
|
}
|
@@ -108,7 +95,6 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
108
95
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
109
96
|
const data = {
|
110
97
|
name: packageName,
|
111
|
-
init,
|
112
98
|
tag,
|
113
99
|
};
|
114
100
|
try {
|
package/index.mjs
CHANGED
@@ -36,9 +36,6 @@ const packageName = 'blotoutWallet';
|
|
36
36
|
const cartTokenCookie = 'cart';
|
37
37
|
const cartTokenTwoCookie = 'cart2';
|
38
38
|
const cartCurrencyCookie = 'cart_currency';
|
39
|
-
const checkoutCookie = 'checkout_session_lookup';
|
40
|
-
|
41
|
-
const init = () => { };
|
42
39
|
|
43
40
|
const getCookieValue = (key) => {
|
44
41
|
try {
|
@@ -69,8 +66,7 @@ const registryKey = Symbol.for('blotout-wallet');
|
|
69
66
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
70
67
|
|
71
68
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
72
|
-
const tag = () => {
|
73
|
-
var _a;
|
69
|
+
const tag = ({ eventName }) => {
|
74
70
|
if (!window) {
|
75
71
|
return;
|
76
72
|
}
|
@@ -82,17 +78,8 @@ const tag = () => {
|
|
82
78
|
if (!cartToken) {
|
83
79
|
cartToken = getCookieValue(cartTokenTwoCookie);
|
84
80
|
}
|
85
|
-
if (
|
86
|
-
|
87
|
-
try {
|
88
|
-
const checkout = JSON.parse(checkoutSession);
|
89
|
-
if (((_a = checkout === null || checkout === void 0 ? void 0 : checkout.keys) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
90
|
-
cartToken = checkout.keys[checkout.keys.length - 1].source_id;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
catch {
|
94
|
-
// do nothing
|
95
|
-
}
|
81
|
+
if (eventName === 'Purchase') {
|
82
|
+
document.cookie = 'cart2=;path=/;Max-Age=0';
|
96
83
|
}
|
97
84
|
return { platform, cartToken, cartCurrency };
|
98
85
|
}
|
@@ -105,7 +92,6 @@ const tag = () => {
|
|
105
92
|
// eslint-disable-next-line @nx/enforce-module-boundaries
|
106
93
|
const data = {
|
107
94
|
name: packageName,
|
108
|
-
init,
|
109
95
|
tag,
|
110
96
|
};
|
111
97
|
try {
|