@cimplify/sdk 0.46.1 → 0.46.3
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 +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{chunk-5LZNTG4V.mjs → chunk-632JEJUS.mjs} +1 -1
- package/dist/{chunk-AUS4B7PA.mjs → chunk-6HYKWYUF.mjs} +2 -2
- package/dist/{chunk-Z3CHDA24.js → chunk-6RP6OPYO.js} +3 -3
- package/dist/{chunk-6V67MAWO.js → chunk-7ZACMER7.js} +22 -22
- package/dist/{chunk-UJ5BBLKL.mjs → chunk-CKRMA5F7.mjs} +2 -2
- package/dist/{chunk-4KNCSWE4.js → chunk-GEWFWQYK.js} +234 -234
- package/dist/{chunk-DETRNWHF.js → chunk-TKOTACKZ.js} +22 -0
- package/dist/{chunk-NKZ5YN5D.js → chunk-TW4OFRWV.js} +4 -4
- package/dist/{chunk-7H2DYO4T.mjs → chunk-WUIERJ6J.mjs} +2 -2
- package/dist/{chunk-7RRVM2X2.mjs → chunk-XY2DFX5K.mjs} +1 -1
- package/dist/{chunk-3HXYEK5K.mjs → chunk-Z2AYLZDF.mjs} +21 -1
- package/dist/{chunk-HNPVZGTO.js → chunk-Z2MLAIID.js} +60 -60
- package/dist/{client-D7nI2XmP.d.ts → client-B76ZNW5r.d.ts} +2 -2
- package/dist/{client-BScRT1Rz.d.mts → client-CT9NwIDX.d.mts} +2 -2
- package/dist/{client-DyrpQRza.d.mts → client-G2WCoxv2.d.mts} +2 -2
- package/dist/{client-B9r5rH3O.d.ts → client-QVINYu1X.d.ts} +2 -2
- package/dist/{index-DC_ZcSgO.d.ts → index-BAohYhdg.d.ts} +3 -3
- package/dist/{index-3C9J8Wb-.d.mts → index-Bo0NjgR6.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +115 -107
- package/dist/index.mjs +4 -4
- package/dist/mock/cli.mjs +2 -0
- package/dist/mock/library.js +2 -0
- package/dist/mock/library.mjs +2 -0
- package/dist/mock/msw.js +2 -0
- package/dist/mock/msw.mjs +2 -0
- package/dist/{payment-Bse2XJ-c.d.mts → payment-9L_-GWqQ.d.mts} +1 -1
- package/dist/{payment-JcNqOf_T.d.ts → payment-_e99nSRj.d.ts} +1 -1
- package/dist/{price-YBGk5seG.d.mts → price-BjehlIhG.d.mts} +1 -1
- package/dist/{price-mHkRncgW.d.ts → price-CWQ5TQmk.d.ts} +1 -1
- package/dist/{product-DiX-HGkT.d.ts → product-C-xLzh7Q.d.mts} +16 -1
- package/dist/{product-DiX-HGkT.d.mts → product-C-xLzh7Q.d.ts} +16 -1
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +93 -85
- package/dist/react.mjs +12 -4
- package/dist/{server-Bg3VtA1D.d.ts → server-72rzvJ4Y.d.ts} +1 -1
- package/dist/{server-kakjHRgj.d.mts → server-BgccqOLT.d.mts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +6 -6
- package/dist/server.mjs +4 -4
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +81 -81
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +29 -29
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/dist/advanced.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
import './product-
|
|
3
|
-
import './payment-
|
|
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-G2WCoxv2.mjs';
|
|
2
|
+
import './product-C-xLzh7Q.mjs';
|
|
3
|
+
import './payment-9L_-GWqQ.mjs';
|
|
4
4
|
|
|
5
5
|
declare function generateIdempotencyKey(prefix?: string): string;
|
|
6
6
|
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
import './product-
|
|
3
|
-
import './payment-
|
|
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-QVINYu1X.js';
|
|
2
|
+
import './product-C-xLzh7Q.js';
|
|
3
|
+
import './payment-_e99nSRj.js';
|
|
4
4
|
|
|
5
5
|
declare function generateIdempotencyKey(prefix?: string): string;
|
|
6
6
|
|
package/dist/advanced.js
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunk7ZACMER7_js = require('./chunk-7ZACMER7.js');
|
|
4
|
+
require('./chunk-6RP6OPYO.js');
|
|
5
|
+
require('./chunk-TKOTACKZ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "AuthService", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk7ZACMER7_js.AuthService; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "BusinessService", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk7ZACMER7_js.BusinessService; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "CartOperations", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk7ZACMER7_js.CartOperations; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk7ZACMER7_js.CatalogueQueries; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk7ZACMER7_js.CheckoutService; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "CheckoutService", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk7ZACMER7_js.CheckoutService; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunk7ZACMER7_js.CimplifyElement; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk7ZACMER7_js.CimplifyElements; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk7ZACMER7_js.ELEMENT_TYPES; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk7ZACMER7_js.EVENT_TYPES; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "FxService", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk7ZACMER7_js.FxService; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "InventoryService", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk7ZACMER7_js.InventoryService; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "LinkService", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk7ZACMER7_js.LinkService; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "LiteService", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk7ZACMER7_js.LiteService; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk7ZACMER7_js.MESSAGE_TYPES; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "OrderQueries", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk7ZACMER7_js.OrderQueries; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "SchedulingService", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk7ZACMER7_js.SchedulingService; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "createElements", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunk7ZACMER7_js.createElements; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunk7ZACMER7_js.generateIdempotencyKey; }
|
|
84
84
|
});
|
package/dist/advanced.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
3
|
-
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-CKRMA5F7.mjs';
|
|
2
|
+
import './chunk-XY2DFX5K.mjs';
|
|
3
|
+
import './chunk-Z2AYLZDF.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __publicField, __privateAdd, __privateSet, __privateGet, __privateMethod, ErrorCode, __privateWrapper } from './chunk-
|
|
1
|
+
import { __publicField, __privateAdd, __privateSet, __privateGet, __privateMethod, ErrorCode, __privateWrapper } from './chunk-Z2AYLZDF.mjs';
|
|
2
2
|
|
|
3
3
|
// ../node_modules/.bun/hono@4.12.16/node_modules/hono/dist/compose.js
|
|
4
4
|
var compose = (middleware, onError, onNotFound) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCimplifyClient } from './chunk-
|
|
2
|
-
import { createMockApp } from './chunk-
|
|
1
|
+
import { createCimplifyClient } from './chunk-WUIERJ6J.mjs';
|
|
2
|
+
import { createMockApp } from './chunk-632JEJUS.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var cimplifyRegistry = z.registry();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTKOTACKZ_js = require('./chunk-TKOTACKZ.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/price.ts
|
|
6
6
|
var CURRENCY_SYMBOLS = {
|
|
@@ -440,14 +440,14 @@ function normalizeStatusResponse(response) {
|
|
|
440
440
|
return {
|
|
441
441
|
status: "pending",
|
|
442
442
|
paid: false,
|
|
443
|
-
amount:
|
|
443
|
+
amount: chunkTKOTACKZ_js.moneyFromNumber(0),
|
|
444
444
|
currency: "",
|
|
445
445
|
message: "No status available"
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
448
|
const res = response;
|
|
449
449
|
const normalizedStatus = normalizePaymentStatusValue(res.status ?? void 0);
|
|
450
|
-
const normalizedAmount = typeof res.amount === "string" ?
|
|
450
|
+
const normalizedAmount = typeof res.amount === "string" ? chunkTKOTACKZ_js.money(res.amount) : typeof res.amount === "number" && Number.isFinite(res.amount) ? chunkTKOTACKZ_js.moneyFromNumber(res.amount) : chunkTKOTACKZ_js.moneyFromNumber(0);
|
|
451
451
|
const normalizedCurrency = typeof res.currency === "string" && res.currency.trim().length > 0 ? res.currency : "";
|
|
452
452
|
const paidValue = res.paid === true;
|
|
453
453
|
const derivedPaid = paidValue || [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk6RP6OPYO_js = require('./chunk-6RP6OPYO.js');
|
|
4
|
+
var chunkTKOTACKZ_js = require('./chunk-TKOTACKZ.js');
|
|
5
5
|
|
|
6
6
|
// src/types/result.ts
|
|
7
7
|
function ok(value) {
|
|
@@ -85,11 +85,11 @@ function generateIdempotencyKey(prefix = "idem") {
|
|
|
85
85
|
|
|
86
86
|
// src/internal/safe.ts
|
|
87
87
|
function toCimplifyError(error) {
|
|
88
|
-
if (error instanceof
|
|
88
|
+
if (error instanceof chunkTKOTACKZ_js.CimplifyError) return chunkTKOTACKZ_js.enrichError(error);
|
|
89
89
|
if (error instanceof Error) {
|
|
90
|
-
return
|
|
90
|
+
return chunkTKOTACKZ_js.enrichError(new chunkTKOTACKZ_js.CimplifyError(chunkTKOTACKZ_js.ErrorCode.UNKNOWN_ERROR, error.message, false));
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return chunkTKOTACKZ_js.enrichError(new chunkTKOTACKZ_js.CimplifyError(chunkTKOTACKZ_js.ErrorCode.UNKNOWN_ERROR, String(error), false));
|
|
93
93
|
}
|
|
94
94
|
async function safe(promise) {
|
|
95
95
|
try {
|
|
@@ -648,7 +648,7 @@ var CartOperations = class {
|
|
|
648
648
|
if (typeof updates.quantity !== "number") {
|
|
649
649
|
return {
|
|
650
650
|
ok: false,
|
|
651
|
-
error: new
|
|
651
|
+
error: new chunkTKOTACKZ_js.CimplifyError(
|
|
652
652
|
"VALIDATION_ERROR",
|
|
653
653
|
"updateItem requires a quantity; richer mid-cart edits are not supported"
|
|
654
654
|
)
|
|
@@ -1093,7 +1093,7 @@ var CheckoutResolver = class {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
|
-
if (checkoutResult.requires_authorization ||
|
|
1096
|
+
if (checkoutResult.requires_authorization || chunk6RP6OPYO_js.isPaymentStatusRequiresAction(checkoutResult.payment_status)) {
|
|
1097
1097
|
const authorization = await this.handleAuthorization({
|
|
1098
1098
|
authorizationType,
|
|
1099
1099
|
paymentReference,
|
|
@@ -1267,18 +1267,18 @@ var CheckoutResolver = class {
|
|
|
1267
1267
|
if (statusResult.value.reference) {
|
|
1268
1268
|
paymentReference = statusResult.value.reference;
|
|
1269
1269
|
}
|
|
1270
|
-
const normalized =
|
|
1271
|
-
if (normalized.paid ||
|
|
1270
|
+
const normalized = chunk6RP6OPYO_js.normalizeStatusResponse(statusResult.value);
|
|
1271
|
+
if (normalized.paid || chunk6RP6OPYO_js.isPaymentStatusSuccess(normalized.status)) {
|
|
1272
1272
|
return this.finalizeSuccess(latestCheckoutResult);
|
|
1273
1273
|
}
|
|
1274
|
-
if (
|
|
1274
|
+
if (chunk6RP6OPYO_js.isPaymentStatusFailure(normalized.status)) {
|
|
1275
1275
|
return this.fail(
|
|
1276
1276
|
normalized.status ? normalized.status.toUpperCase() : "PAYMENT_FAILED",
|
|
1277
1277
|
normalized.message || "Payment failed during confirmation.",
|
|
1278
1278
|
false
|
|
1279
1279
|
);
|
|
1280
1280
|
}
|
|
1281
|
-
if (
|
|
1281
|
+
if (chunk6RP6OPYO_js.isPaymentStatusRequiresAction(normalized.status)) {
|
|
1282
1282
|
const authorization = await this.handleAuthorization({
|
|
1283
1283
|
authorizationType,
|
|
1284
1284
|
paymentReference,
|
|
@@ -1309,8 +1309,8 @@ var CheckoutResolver = class {
|
|
|
1309
1309
|
try {
|
|
1310
1310
|
const finalResult = await this.client.checkout.pollPaymentStatus(input.orderId);
|
|
1311
1311
|
if (finalResult.ok) {
|
|
1312
|
-
const normalized =
|
|
1313
|
-
if (normalized.paid ||
|
|
1312
|
+
const normalized = chunk6RP6OPYO_js.normalizeStatusResponse(finalResult.value);
|
|
1313
|
+
if (normalized.paid || chunk6RP6OPYO_js.isPaymentStatusSuccess(normalized.status)) {
|
|
1314
1314
|
return this.finalizeSuccess(latestCheckoutResult);
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
@@ -1506,12 +1506,12 @@ var CheckoutResolver = class {
|
|
|
1506
1506
|
};
|
|
1507
1507
|
}
|
|
1508
1508
|
isSuccessfulStatus(status) {
|
|
1509
|
-
const normalized =
|
|
1510
|
-
return normalized.paid ||
|
|
1509
|
+
const normalized = chunk6RP6OPYO_js.normalizeStatusResponse({ status, paid: false });
|
|
1510
|
+
return normalized.paid || chunk6RP6OPYO_js.isPaymentStatusSuccess(normalized.status);
|
|
1511
1511
|
}
|
|
1512
1512
|
isFailureStatus(status) {
|
|
1513
|
-
const normalized =
|
|
1514
|
-
return
|
|
1513
|
+
const normalized = chunk6RP6OPYO_js.normalizeStatusResponse({ status, paid: false });
|
|
1514
|
+
return chunk6RP6OPYO_js.isPaymentStatusFailure(normalized.status);
|
|
1515
1515
|
}
|
|
1516
1516
|
ensureNotAborted() {
|
|
1517
1517
|
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 chunkTKOTACKZ_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 = chunkTKOTACKZ_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 ? chunkTKOTACKZ_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({
|
|
@@ -1979,7 +1979,7 @@ var BusinessService = class {
|
|
|
1979
1979
|
if (!result.ok) return err(result.error);
|
|
1980
1980
|
const location = result.value.find((item) => item.id === locationId);
|
|
1981
1981
|
if (!location) {
|
|
1982
|
-
return err(new
|
|
1982
|
+
return err(new chunkTKOTACKZ_js.CimplifyError(chunkTKOTACKZ_js.ErrorCode.NOT_FOUND, `Location not found: ${locationId}`, false));
|
|
1983
1983
|
}
|
|
1984
1984
|
return ok(location);
|
|
1985
1985
|
}
|
|
@@ -2266,7 +2266,7 @@ var EVENT_TYPES = {
|
|
|
2266
2266
|
|
|
2267
2267
|
// src/elements.ts
|
|
2268
2268
|
function toCheckoutError(code, message, recoverable) {
|
|
2269
|
-
const hint =
|
|
2269
|
+
const hint = chunkTKOTACKZ_js.getErrorHint(code);
|
|
2270
2270
|
return {
|
|
2271
2271
|
success: false,
|
|
2272
2272
|
error: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure } from './chunk-
|
|
2
|
-
import { CimplifyError, currencyCode, ErrorCode, enrichError, getErrorHint } from './chunk-
|
|
1
|
+
import { isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure } from './chunk-XY2DFX5K.mjs';
|
|
2
|
+
import { CimplifyError, currencyCode, ErrorCode, enrichError, getErrorHint } from './chunk-Z2AYLZDF.mjs';
|
|
3
3
|
|
|
4
4
|
// src/types/result.ts
|
|
5
5
|
function ok(value) {
|