@economist/web-apple-pay 0.1.3-beta.16 → 0.1.3-beta.18
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/dist/index.js +6 -2
- package/dist/src/apple-pay-button.js +6 -2
- package/dist/src/apple-pay-button.stories.js +6 -2
- package/dist/src/apple-pay-modal.stories.js +6 -2
- package/dist/src/clients/payment-checkout/apple-session.js +5 -2
- package/dist/src/clients/payment-checkout/payment-handler.js +6 -2
- package/dist/src/index.js +6 -2
- package/dist/src/utils/expressCheckoutRedirect.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1188,8 +1188,11 @@ var buildQueryString = () => {
|
|
|
1188
1188
|
};
|
|
1189
1189
|
var decodeSku = (sku) => {
|
|
1190
1190
|
try {
|
|
1191
|
-
|
|
1192
|
-
|
|
1191
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
1192
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
1193
|
+
return decoded;
|
|
1194
|
+
} catch (err) {
|
|
1195
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
1193
1196
|
return sku;
|
|
1194
1197
|
}
|
|
1195
1198
|
};
|
|
@@ -1519,6 +1522,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
1519
1522
|
return void 0;
|
|
1520
1523
|
}
|
|
1521
1524
|
function redirectFallback(skuId, returnUrl, options) {
|
|
1525
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
1522
1526
|
trackFallbackCheckout(skuId);
|
|
1523
1527
|
window.location.href = redirectToCheckoutFallback({
|
|
1524
1528
|
skuId,
|
|
@@ -1183,8 +1183,11 @@ var buildQueryString = () => {
|
|
|
1183
1183
|
};
|
|
1184
1184
|
var decodeSku = (sku) => {
|
|
1185
1185
|
try {
|
|
1186
|
-
|
|
1187
|
-
|
|
1186
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
1187
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
1188
|
+
return decoded;
|
|
1189
|
+
} catch (err) {
|
|
1190
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
1188
1191
|
return sku;
|
|
1189
1192
|
}
|
|
1190
1193
|
};
|
|
@@ -1514,6 +1517,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
1514
1517
|
return void 0;
|
|
1515
1518
|
}
|
|
1516
1519
|
function redirectFallback(skuId, returnUrl, options) {
|
|
1520
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
1517
1521
|
trackFallbackCheckout(skuId);
|
|
1518
1522
|
window.location.href = redirectToCheckoutFallback({
|
|
1519
1523
|
skuId,
|
|
@@ -1191,8 +1191,11 @@ var buildQueryString = () => {
|
|
|
1191
1191
|
};
|
|
1192
1192
|
var decodeSku = (sku) => {
|
|
1193
1193
|
try {
|
|
1194
|
-
|
|
1195
|
-
|
|
1194
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
1195
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
1196
|
+
return decoded;
|
|
1197
|
+
} catch (err) {
|
|
1198
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
1196
1199
|
return sku;
|
|
1197
1200
|
}
|
|
1198
1201
|
};
|
|
@@ -1522,6 +1525,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
1522
1525
|
return void 0;
|
|
1523
1526
|
}
|
|
1524
1527
|
function redirectFallback(skuId, returnUrl, options) {
|
|
1528
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
1525
1529
|
trackFallbackCheckout(skuId);
|
|
1526
1530
|
window.location.href = redirectToCheckoutFallback({
|
|
1527
1531
|
skuId,
|
|
@@ -1183,8 +1183,11 @@ var buildQueryString = () => {
|
|
|
1183
1183
|
};
|
|
1184
1184
|
var decodeSku = (sku) => {
|
|
1185
1185
|
try {
|
|
1186
|
-
|
|
1187
|
-
|
|
1186
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
1187
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
1188
|
+
return decoded;
|
|
1189
|
+
} catch (err) {
|
|
1190
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
1188
1191
|
return sku;
|
|
1189
1192
|
}
|
|
1190
1193
|
};
|
|
@@ -1514,6 +1517,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
1514
1517
|
return void 0;
|
|
1515
1518
|
}
|
|
1516
1519
|
function redirectFallback(skuId, returnUrl, options) {
|
|
1520
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
1517
1521
|
trackFallbackCheckout(skuId);
|
|
1518
1522
|
window.location.href = redirectToCheckoutFallback({
|
|
1519
1523
|
skuId,
|
|
@@ -64,8 +64,11 @@ var validateAppleMerchant = (data) => {
|
|
|
64
64
|
// src/utils/expressCheckoutRedirect.ts
|
|
65
65
|
var decodeSku = (sku) => {
|
|
66
66
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
68
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
69
|
+
return decoded;
|
|
70
|
+
} catch (err) {
|
|
71
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
69
72
|
return sku;
|
|
70
73
|
}
|
|
71
74
|
};
|
|
@@ -241,8 +241,11 @@ var shippingContactDetails = (shippingContact) => {
|
|
|
241
241
|
// src/utils/expressCheckoutRedirect.ts
|
|
242
242
|
var decodeSku = (sku) => {
|
|
243
243
|
try {
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
245
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
246
|
+
return decoded;
|
|
247
|
+
} catch (err) {
|
|
248
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
246
249
|
return sku;
|
|
247
250
|
}
|
|
248
251
|
};
|
|
@@ -304,6 +307,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
304
307
|
return void 0;
|
|
305
308
|
}
|
|
306
309
|
function redirectFallback(skuId, returnUrl, options) {
|
|
310
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
307
311
|
trackFallbackCheckout(skuId);
|
|
308
312
|
window.location.href = redirectToCheckoutFallback({
|
|
309
313
|
skuId,
|
package/dist/src/index.js
CHANGED
|
@@ -1188,8 +1188,11 @@ var buildQueryString = () => {
|
|
|
1188
1188
|
};
|
|
1189
1189
|
var decodeSku = (sku) => {
|
|
1190
1190
|
try {
|
|
1191
|
-
|
|
1192
|
-
|
|
1191
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
1192
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
1193
|
+
return decoded;
|
|
1194
|
+
} catch (err) {
|
|
1195
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
1193
1196
|
return sku;
|
|
1194
1197
|
}
|
|
1195
1198
|
};
|
|
@@ -1519,6 +1522,7 @@ function validateContacts(event, sessionData, supportedBillingCountries) {
|
|
|
1519
1522
|
return void 0;
|
|
1520
1523
|
}
|
|
1521
1524
|
function redirectFallback(skuId, returnUrl, options) {
|
|
1525
|
+
console.log("[web-apple-pay] redirectFallback called", { skuId, returnUrl, options });
|
|
1522
1526
|
trackFallbackCheckout(skuId);
|
|
1523
1527
|
window.location.href = redirectToCheckoutFallback({
|
|
1524
1528
|
skuId,
|
|
@@ -8,8 +8,11 @@ var buildQueryString = () => {
|
|
|
8
8
|
};
|
|
9
9
|
var decodeSku = (sku) => {
|
|
10
10
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const decoded = atob(sku.substring(sku.indexOf("-") + 1));
|
|
12
|
+
console.log("[web-apple-pay] decodeSku", { input: sku, decoded });
|
|
13
|
+
return decoded;
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.warn("[web-apple-pay] decodeSku: failed to decode, returning raw", { input: sku, err });
|
|
13
16
|
return sku;
|
|
14
17
|
}
|
|
15
18
|
};
|
package/package.json
CHANGED