@cimplify/sdk 0.44.14 → 0.44.16
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/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +21 -21
- package/dist/advanced.mjs +2 -2
- package/dist/{chunk-6TVQQYQ5.mjs → chunk-6AZZ6AOF.mjs} +21 -1
- package/dist/{chunk-EZK2FXTM.mjs → chunk-7NML226B.mjs} +1 -1
- package/dist/{chunk-BAWKQRIB.js → chunk-CFD4J32N.js} +21 -21
- package/dist/{chunk-OMAP327U.js → chunk-MBGQP6FZ.js} +62 -61
- package/dist/{chunk-V2O5AO7I.js → chunk-MNIKXG7W.js} +26 -0
- package/dist/{chunk-3WD6U5RD.mjs → chunk-UXLQ7WXI.mjs} +4 -3
- package/dist/chunk-XL4CX75J.js +9370 -0
- package/dist/chunk-ZLEFMQC6.mjs +9318 -0
- package/dist/cli/commands/deploy.mjs +9 -1
- package/dist/{client-lvLvB1_K.d.ts → client-D6ZisKco.d.ts} +7 -0
- package/dist/{client-CkGlXZRd.d.mts → client-Dh-bHyhU.d.mts} +7 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +106 -106
- package/dist/index.mjs +3 -3
- package/dist/mock/cli.mjs +2 -1
- package/dist/mock/library.js +2 -1
- package/dist/mock/library.mjs +2 -1
- package/dist/mock/msw.js +2 -1
- package/dist/mock/msw.mjs +2 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +80 -80
- package/dist/react.mjs +3 -3
- package/dist/server-CWpUlLOQ.d.mts +1003 -0
- package/dist/server-CWpUlLOQ.d.ts +1003 -0
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/dist/testing/suite.d.mts +60 -0
- package/dist/testing/suite.d.ts +60 -0
- package/dist/testing/suite.js +169 -0
- package/dist/testing/suite.mjs +165 -0
- package/dist/testing.d.mts +1359 -0
- package/dist/testing.d.ts +1359 -0
- package/dist/testing.js +213 -0
- package/dist/testing.mjs +4 -0
- package/dist/utils.js +28 -28
- package/dist/utils.mjs +1 -1
- package/package.json +18 -3
- package/templates/storefront-bakery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-bakery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-bakery/package.json +11 -3
- package/templates/storefront-bakery/vitest.config.ts +9 -0
- package/templates/storefront-fashion/__tests__/brand.test.ts +4 -0
- package/templates/storefront-fashion/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-fashion/__tests__/contract.test.ts +4 -0
- package/templates/storefront-fashion/package.json +11 -3
- package/templates/storefront-fashion/vitest.config.ts +9 -0
- package/templates/storefront-grocery/__tests__/brand.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-grocery/__tests__/contract.test.ts +4 -0
- package/templates/storefront-grocery/package.json +11 -3
- package/templates/storefront-grocery/vitest.config.ts +9 -0
- package/templates/storefront-restaurant/__tests__/brand.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-restaurant/__tests__/contract.test.ts +4 -0
- package/templates/storefront-restaurant/package.json +11 -3
- package/templates/storefront-restaurant/vitest.config.ts +9 -0
- package/templates/storefront-retail/__tests__/brand.test.ts +4 -0
- package/templates/storefront-retail/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-retail/__tests__/contract.test.ts +4 -0
- package/templates/storefront-retail/package.json +11 -3
- package/templates/storefront-retail/vitest.config.ts +9 -0
- package/templates/storefront-services/__tests__/brand.test.ts +4 -0
- package/templates/storefront-services/__tests__/cart-flow.test.ts +4 -0
- package/templates/storefront-services/__tests__/contract.test.ts +4 -0
- package/templates/storefront-services/package.json +11 -3
- package/templates/storefront-services/vitest.config.ts +9 -0
package/dist/advanced.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-
|
|
1
|
+
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-Dh-bHyhU.mjs';
|
|
2
2
|
import './payment-DA1i5hhk.mjs';
|
|
3
3
|
|
|
4
4
|
declare function generateIdempotencyKey(prefix?: string): string;
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-
|
|
1
|
+
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, a6 as CimplifyElement, a5 as CimplifyElements, aa as ELEMENT_TYPES, a9 as EVENT_TYPES, ae as ElementEventType, ac as ElementOptions, ad as ElementType, ab as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, a8 as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, p as SchedulingService, a7 as createElements } from './client-D6ZisKco.js';
|
|
2
2
|
import './payment-DA1i5hhk.js';
|
|
3
3
|
|
|
4
4
|
declare function generateIdempotencyKey(prefix?: string): string;
|
package/dist/advanced.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkCFD4J32N_js = require('./chunk-CFD4J32N.js');
|
|
4
|
+
require('./chunk-MNIKXG7W.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "AuthService", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkCFD4J32N_js.AuthService; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "BusinessService", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkCFD4J32N_js.BusinessService; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "CartOperations", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkCFD4J32N_js.CartOperations; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkCFD4J32N_js.CatalogueQueries; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkCFD4J32N_js.CheckoutService; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "CheckoutService", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkCFD4J32N_js.CheckoutService; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkCFD4J32N_js.CimplifyElement; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkCFD4J32N_js.CimplifyElements; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkCFD4J32N_js.ELEMENT_TYPES; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkCFD4J32N_js.EVENT_TYPES; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "FxService", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkCFD4J32N_js.FxService; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "InventoryService", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkCFD4J32N_js.InventoryService; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "LinkService", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkCFD4J32N_js.LinkService; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "LiteService", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkCFD4J32N_js.LiteService; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkCFD4J32N_js.MESSAGE_TYPES; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "OrderQueries", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkCFD4J32N_js.OrderQueries; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "SchedulingService", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkCFD4J32N_js.SchedulingService; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "createElements", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkCFD4J32N_js.createElements; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkCFD4J32N_js.generateIdempotencyKey; }
|
|
83
83
|
});
|
package/dist/advanced.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-7NML226B.mjs';
|
|
2
|
+
import './chunk-6AZZ6AOF.mjs';
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
+
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
13
|
+
set _(value) {
|
|
14
|
+
__privateSet(obj, member, value, setter);
|
|
15
|
+
},
|
|
16
|
+
get _() {
|
|
17
|
+
return __privateGet(obj, member, getter);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
1
21
|
// src/types/common.ts
|
|
2
22
|
function money(value) {
|
|
3
23
|
return typeof value === "string" ? parseFloat(value) || 0 : value;
|
|
@@ -708,4 +728,4 @@ function detectMobileMoneyProvider(phoneNumber) {
|
|
|
708
728
|
return null;
|
|
709
729
|
}
|
|
710
730
|
|
|
711
|
-
export { CURRENCY_SYMBOLS, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, MOBILE_MONEY_PROVIDERS, ZERO, categorizePaymentError, currencyCode, detectMobileMoneyProvider, enrichError, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getErrorHint, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isCimplifyError, isIdempotencyMismatchError, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isRetryableError, isSupportedCurrency, isTaxInclusive, money, moneyFromNumber, normalizePaymentResponse, normalizeStatusResponse, parsePrice };
|
|
731
|
+
export { CURRENCY_SYMBOLS, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, MOBILE_MONEY_PROVIDERS, ZERO, __privateAdd, __privateGet, __privateMethod, __privateSet, __privateWrapper, __publicField, categorizePaymentError, currencyCode, detectMobileMoneyProvider, enrichError, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getErrorHint, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isCimplifyError, isIdempotencyMismatchError, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isRetryableError, isSupportedCurrency, isTaxInclusive, money, moneyFromNumber, normalizePaymentResponse, normalizeStatusResponse, parsePrice };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CimplifyError, currencyCode, ErrorCode, enrichError, isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure, getErrorHint } from './chunk-
|
|
1
|
+
import { CimplifyError, currencyCode, ErrorCode, enrichError, isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure, getErrorHint } from './chunk-6AZZ6AOF.mjs';
|
|
2
2
|
|
|
3
3
|
// src/types/result.ts
|
|
4
4
|
function ok(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMNIKXG7W_js = require('./chunk-MNIKXG7W.js');
|
|
4
4
|
|
|
5
5
|
// src/types/result.ts
|
|
6
6
|
function ok(value) {
|
|
@@ -84,11 +84,11 @@ function generateIdempotencyKey(prefix = "idem") {
|
|
|
84
84
|
|
|
85
85
|
// src/internal/safe.ts
|
|
86
86
|
function toCimplifyError(error) {
|
|
87
|
-
if (error instanceof
|
|
87
|
+
if (error instanceof chunkMNIKXG7W_js.CimplifyError) return chunkMNIKXG7W_js.enrichError(error);
|
|
88
88
|
if (error instanceof Error) {
|
|
89
|
-
return
|
|
89
|
+
return chunkMNIKXG7W_js.enrichError(new chunkMNIKXG7W_js.CimplifyError(chunkMNIKXG7W_js.ErrorCode.UNKNOWN_ERROR, error.message, false));
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return chunkMNIKXG7W_js.enrichError(new chunkMNIKXG7W_js.CimplifyError(chunkMNIKXG7W_js.ErrorCode.UNKNOWN_ERROR, String(error), false));
|
|
92
92
|
}
|
|
93
93
|
async function safe(promise) {
|
|
94
94
|
try {
|
|
@@ -647,7 +647,7 @@ var CartOperations = class {
|
|
|
647
647
|
if (typeof updates.quantity !== "number") {
|
|
648
648
|
return {
|
|
649
649
|
ok: false,
|
|
650
|
-
error: new
|
|
650
|
+
error: new chunkMNIKXG7W_js.CimplifyError(
|
|
651
651
|
"VALIDATION_ERROR",
|
|
652
652
|
"updateItem requires a quantity; richer mid-cart edits are not supported"
|
|
653
653
|
)
|
|
@@ -1089,7 +1089,7 @@ var CheckoutResolver = class {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
|
-
if (checkoutResult.requires_authorization ||
|
|
1092
|
+
if (checkoutResult.requires_authorization || chunkMNIKXG7W_js.isPaymentStatusRequiresAction(checkoutResult.payment_status)) {
|
|
1093
1093
|
const authorization = await this.handleAuthorization({
|
|
1094
1094
|
authorizationType,
|
|
1095
1095
|
paymentReference,
|
|
@@ -1263,18 +1263,18 @@ var CheckoutResolver = class {
|
|
|
1263
1263
|
if (statusResult.value.reference) {
|
|
1264
1264
|
paymentReference = statusResult.value.reference;
|
|
1265
1265
|
}
|
|
1266
|
-
const normalized =
|
|
1267
|
-
if (normalized.paid ||
|
|
1266
|
+
const normalized = chunkMNIKXG7W_js.normalizeStatusResponse(statusResult.value);
|
|
1267
|
+
if (normalized.paid || chunkMNIKXG7W_js.isPaymentStatusSuccess(normalized.status)) {
|
|
1268
1268
|
return this.finalizeSuccess(latestCheckoutResult);
|
|
1269
1269
|
}
|
|
1270
|
-
if (
|
|
1270
|
+
if (chunkMNIKXG7W_js.isPaymentStatusFailure(normalized.status)) {
|
|
1271
1271
|
return this.fail(
|
|
1272
1272
|
normalized.status ? normalized.status.toUpperCase() : "PAYMENT_FAILED",
|
|
1273
1273
|
normalized.message || "Payment failed during confirmation.",
|
|
1274
1274
|
false
|
|
1275
1275
|
);
|
|
1276
1276
|
}
|
|
1277
|
-
if (
|
|
1277
|
+
if (chunkMNIKXG7W_js.isPaymentStatusRequiresAction(normalized.status)) {
|
|
1278
1278
|
const authorization = await this.handleAuthorization({
|
|
1279
1279
|
authorizationType,
|
|
1280
1280
|
paymentReference,
|
|
@@ -1305,8 +1305,8 @@ var CheckoutResolver = class {
|
|
|
1305
1305
|
try {
|
|
1306
1306
|
const finalResult = await this.client.checkout.pollPaymentStatus(input.orderId);
|
|
1307
1307
|
if (finalResult.ok) {
|
|
1308
|
-
const normalized =
|
|
1309
|
-
if (normalized.paid ||
|
|
1308
|
+
const normalized = chunkMNIKXG7W_js.normalizeStatusResponse(finalResult.value);
|
|
1309
|
+
if (normalized.paid || chunkMNIKXG7W_js.isPaymentStatusSuccess(normalized.status)) {
|
|
1310
1310
|
return this.finalizeSuccess(latestCheckoutResult);
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
@@ -1502,12 +1502,12 @@ var CheckoutResolver = class {
|
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
1504
|
isSuccessfulStatus(status) {
|
|
1505
|
-
const normalized =
|
|
1506
|
-
return normalized.paid ||
|
|
1505
|
+
const normalized = chunkMNIKXG7W_js.normalizeStatusResponse({ status, paid: false });
|
|
1506
|
+
return normalized.paid || chunkMNIKXG7W_js.isPaymentStatusSuccess(normalized.status);
|
|
1507
1507
|
}
|
|
1508
1508
|
isFailureStatus(status) {
|
|
1509
|
-
const normalized =
|
|
1510
|
-
return
|
|
1509
|
+
const normalized = chunkMNIKXG7W_js.normalizeStatusResponse({ status, paid: false });
|
|
1510
|
+
return chunkMNIKXG7W_js.isPaymentStatusFailure(normalized.status);
|
|
1511
1511
|
}
|
|
1512
1512
|
ensureNotAborted() {
|
|
1513
1513
|
if (this.signal?.aborted) {
|
|
@@ -1570,7 +1570,7 @@ var CheckoutService = class {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
async initializePayment(_orderId, _method) {
|
|
1572
1572
|
return err(
|
|
1573
|
-
new
|
|
1573
|
+
new chunkMNIKXG7W_js.CimplifyError(
|
|
1574
1574
|
"NOT_IMPLEMENTED",
|
|
1575
1575
|
"initializePayment is not available in REST mode.",
|
|
1576
1576
|
false
|
|
@@ -1642,11 +1642,11 @@ var CheckoutService = class {
|
|
|
1642
1642
|
pay_currency: data.pay_currency,
|
|
1643
1643
|
fx_quote_id: data.fx_quote_id
|
|
1644
1644
|
};
|
|
1645
|
-
const baseCurrency =
|
|
1645
|
+
const baseCurrency = chunkMNIKXG7W_js.currencyCode(
|
|
1646
1646
|
(cart.pricing.currency || checkoutData.pay_currency || "GHS").toUpperCase()
|
|
1647
1647
|
);
|
|
1648
1648
|
const payCurrency = data.pay_currency?.trim().toUpperCase();
|
|
1649
|
-
const payCurrencyCode = payCurrency ?
|
|
1649
|
+
const payCurrencyCode = payCurrency ? chunkMNIKXG7W_js.currencyCode(payCurrency) : void 0;
|
|
1650
1650
|
const cartTotalAmount = typeof cart.pricing.total_price === "number" ? cart.pricing.total_price : Number.parseFloat(cart.pricing.total_price || "0");
|
|
1651
1651
|
if (payCurrencyCode && payCurrencyCode !== baseCurrency && !checkoutData.fx_quote_id && Number.isFinite(cartTotalAmount) && cartTotalAmount > 0) {
|
|
1652
1652
|
const fxQuoteResult = await this.client.fx.lockQuote({
|
|
@@ -2004,7 +2004,7 @@ var BusinessService = class {
|
|
|
2004
2004
|
if (!result.ok) return err(result.error);
|
|
2005
2005
|
const location = result.value.find((item) => item.id === locationId);
|
|
2006
2006
|
if (!location) {
|
|
2007
|
-
return err(new
|
|
2007
|
+
return err(new chunkMNIKXG7W_js.CimplifyError(chunkMNIKXG7W_js.ErrorCode.NOT_FOUND, `Location not found: ${locationId}`, false));
|
|
2008
2008
|
}
|
|
2009
2009
|
return ok(location);
|
|
2010
2010
|
}
|
|
@@ -2290,7 +2290,7 @@ var EVENT_TYPES = {
|
|
|
2290
2290
|
|
|
2291
2291
|
// src/elements.ts
|
|
2292
2292
|
function toCheckoutError(code, message, recoverable) {
|
|
2293
|
-
const hint =
|
|
2293
|
+
const hint = chunkMNIKXG7W_js.getErrorHint(code);
|
|
2294
2294
|
return {
|
|
2295
2295
|
success: false,
|
|
2296
2296
|
error: {
|