@cimplify/sdk 0.8.1 → 0.8.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 +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +32 -2
- package/dist/advanced.mjs +32 -2
- package/dist/{client-bq-xxzM7.d.mts → client-DnAfLDhV.d.mts} +38 -1
- package/dist/{client-BJFeYCB2.d.ts → client-hKTJv1I1.d.ts} +38 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +174 -111
- package/dist/index.mjs +174 -111
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +421 -285
- package/dist/react.mjs +210 -78
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -715,6 +715,105 @@ var CartOperations = class {
|
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
717
|
|
|
718
|
+
// src/constants.ts
|
|
719
|
+
var CHECKOUT_MODE = {
|
|
720
|
+
LINK: "link",
|
|
721
|
+
GUEST: "guest"
|
|
722
|
+
};
|
|
723
|
+
var ORDER_TYPE = {
|
|
724
|
+
DELIVERY: "delivery",
|
|
725
|
+
PICKUP: "pickup",
|
|
726
|
+
DINE_IN: "dine-in",
|
|
727
|
+
WALK_IN: "walk-in"
|
|
728
|
+
};
|
|
729
|
+
var PAYMENT_METHOD = {
|
|
730
|
+
MOBILE_MONEY: "mobile_money",
|
|
731
|
+
CARD: "card"
|
|
732
|
+
};
|
|
733
|
+
var CHECKOUT_STEP = {
|
|
734
|
+
AUTHENTICATION: "authentication",
|
|
735
|
+
ORDER_DETAILS: "order_details",
|
|
736
|
+
PAYMENT_METHOD: "payment_method",
|
|
737
|
+
PAYMENT: "payment",
|
|
738
|
+
CONFIRMATION: "confirmation"
|
|
739
|
+
};
|
|
740
|
+
var PAYMENT_STATE = {
|
|
741
|
+
INITIAL: "initial",
|
|
742
|
+
PREPARING: "preparing",
|
|
743
|
+
PROCESSING: "processing",
|
|
744
|
+
VERIFYING: "verifying",
|
|
745
|
+
AWAITING_AUTHORIZATION: "awaiting_authorization",
|
|
746
|
+
SUCCESS: "success",
|
|
747
|
+
ERROR: "error",
|
|
748
|
+
TIMEOUT: "timeout"
|
|
749
|
+
};
|
|
750
|
+
var PICKUP_TIME_TYPE = {
|
|
751
|
+
ASAP: "asap",
|
|
752
|
+
SCHEDULED: "scheduled"
|
|
753
|
+
};
|
|
754
|
+
var MOBILE_MONEY_PROVIDER = {
|
|
755
|
+
MTN: "mtn",
|
|
756
|
+
VODAFONE: "vodafone",
|
|
757
|
+
AIRTEL: "airtel"
|
|
758
|
+
};
|
|
759
|
+
var AUTHORIZATION_TYPE = {
|
|
760
|
+
OTP: "otp",
|
|
761
|
+
PIN: "pin",
|
|
762
|
+
PHONE: "phone",
|
|
763
|
+
BIRTHDAY: "birthday",
|
|
764
|
+
ADDRESS: "address"
|
|
765
|
+
};
|
|
766
|
+
var DEVICE_TYPE = {
|
|
767
|
+
MOBILE: "mobile",
|
|
768
|
+
DESKTOP: "desktop",
|
|
769
|
+
TABLET: "tablet"
|
|
770
|
+
};
|
|
771
|
+
var CONTACT_TYPE = {
|
|
772
|
+
PHONE: "phone",
|
|
773
|
+
EMAIL: "email"
|
|
774
|
+
};
|
|
775
|
+
var LINK_QUERY = {
|
|
776
|
+
DATA: "link.data",
|
|
777
|
+
ADDRESSES: "link.addresses",
|
|
778
|
+
MOBILE_MONEY: "link.mobile_money",
|
|
779
|
+
PREFERENCES: "link.preferences",
|
|
780
|
+
SESSIONS: "link.sessions"
|
|
781
|
+
};
|
|
782
|
+
var LINK_MUTATION = {
|
|
783
|
+
CHECK_STATUS: "link.check_status",
|
|
784
|
+
ENROLL: "link.enroll",
|
|
785
|
+
ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order",
|
|
786
|
+
UPDATE_PREFERENCES: "link.update_preferences",
|
|
787
|
+
CREATE_ADDRESS: "link.create_address",
|
|
788
|
+
UPDATE_ADDRESS: "link.update_address",
|
|
789
|
+
DELETE_ADDRESS: "link.delete_address",
|
|
790
|
+
SET_DEFAULT_ADDRESS: "link.set_default_address",
|
|
791
|
+
TRACK_ADDRESS_USAGE: "link.track_address_usage",
|
|
792
|
+
CREATE_MOBILE_MONEY: "link.create_mobile_money",
|
|
793
|
+
DELETE_MOBILE_MONEY: "link.delete_mobile_money",
|
|
794
|
+
SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money",
|
|
795
|
+
TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage",
|
|
796
|
+
VERIFY_MOBILE_MONEY: "link.verify_mobile_money",
|
|
797
|
+
REVOKE_SESSION: "link.revoke_session",
|
|
798
|
+
REVOKE_ALL_SESSIONS: "link.revoke_all_sessions"
|
|
799
|
+
};
|
|
800
|
+
var AUTH_MUTATION = {
|
|
801
|
+
REQUEST_OTP: "auth.request_otp",
|
|
802
|
+
VERIFY_OTP: "auth.verify_otp"
|
|
803
|
+
};
|
|
804
|
+
var CHECKOUT_MUTATION = {
|
|
805
|
+
PROCESS: "checkout.process"
|
|
806
|
+
};
|
|
807
|
+
var PAYMENT_MUTATION = {
|
|
808
|
+
SUBMIT_AUTHORIZATION: "payment.submit_authorization",
|
|
809
|
+
CHECK_STATUS: "order.poll_payment_status"
|
|
810
|
+
};
|
|
811
|
+
var ORDER_MUTATION = {
|
|
812
|
+
UPDATE_CUSTOMER: "order.update_order_customer"
|
|
813
|
+
};
|
|
814
|
+
var DEFAULT_CURRENCY = "GHS";
|
|
815
|
+
var DEFAULT_COUNTRY = "GHA";
|
|
816
|
+
|
|
718
817
|
// src/utils/price.ts
|
|
719
818
|
var CURRENCY_SYMBOLS = {
|
|
720
819
|
// Major world currencies
|
|
@@ -1272,6 +1371,10 @@ async function openCardPopup(provider, checkoutResult, email, currency, signal)
|
|
|
1272
1371
|
}
|
|
1273
1372
|
return { success: false, error: "PROVIDER_UNAVAILABLE" };
|
|
1274
1373
|
}
|
|
1374
|
+
var VALID_MOBILE_MONEY_PROVIDERS = new Set(Object.values(MOBILE_MONEY_PROVIDER));
|
|
1375
|
+
function isValidMobileMoneyProvider(value) {
|
|
1376
|
+
return VALID_MOBILE_MONEY_PROVIDERS.has(value);
|
|
1377
|
+
}
|
|
1275
1378
|
function normalizeAuthorizationType(value) {
|
|
1276
1379
|
return value === "otp" || value === "pin" ? value : void 0;
|
|
1277
1380
|
}
|
|
@@ -1504,6 +1607,16 @@ var CheckoutResolver = class {
|
|
|
1504
1607
|
}
|
|
1505
1608
|
await this.wait(this.pollIntervalMs);
|
|
1506
1609
|
}
|
|
1610
|
+
try {
|
|
1611
|
+
const finalResult = await this.client.checkout.pollPaymentStatus(input.orderId);
|
|
1612
|
+
if (finalResult.ok) {
|
|
1613
|
+
const normalized = normalizeStatusResponse(finalResult.value);
|
|
1614
|
+
if (normalized.paid || isPaymentStatusSuccess(normalized.status)) {
|
|
1615
|
+
return this.finalizeSuccess(latestCheckoutResult);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
} catch {
|
|
1619
|
+
}
|
|
1507
1620
|
return this.fail(
|
|
1508
1621
|
"PAYMENT_TIMEOUT",
|
|
1509
1622
|
"Payment confirmation timed out. Please retry checkout.",
|
|
@@ -1634,7 +1747,7 @@ var CheckoutResolver = class {
|
|
|
1634
1747
|
};
|
|
1635
1748
|
}
|
|
1636
1749
|
getEnrollmentMobileMoney() {
|
|
1637
|
-
if (this.paymentData?.type === "mobile_money" && this.paymentData.phone_number && this.paymentData.provider) {
|
|
1750
|
+
if (this.paymentData?.type === "mobile_money" && this.paymentData.phone_number && this.paymentData.provider && isValidMobileMoneyProvider(this.paymentData.provider)) {
|
|
1638
1751
|
return {
|
|
1639
1752
|
phone_number: this.paymentData.phone_number,
|
|
1640
1753
|
provider: this.paymentData.provider,
|
|
@@ -2589,6 +2702,7 @@ var MESSAGE_TYPES = {
|
|
|
2589
2702
|
// Parent → Iframe
|
|
2590
2703
|
INIT: "init",
|
|
2591
2704
|
SET_TOKEN: "set_token",
|
|
2705
|
+
SET_CART: "set_cart",
|
|
2592
2706
|
GET_DATA: "get_data",
|
|
2593
2707
|
REFRESH_TOKEN: "refresh_token",
|
|
2594
2708
|
LOGOUT: "logout",
|
|
@@ -2753,8 +2867,10 @@ var CimplifyElements = class {
|
|
|
2753
2867
|
false
|
|
2754
2868
|
);
|
|
2755
2869
|
}
|
|
2870
|
+
this.checkoutInProgress = true;
|
|
2756
2871
|
if (!options.cart_id) {
|
|
2757
2872
|
console.debug("[cimplify:checkout] BLOCKED: no cart_id");
|
|
2873
|
+
this.checkoutInProgress = false;
|
|
2758
2874
|
return toCheckoutError(
|
|
2759
2875
|
"INVALID_CART",
|
|
2760
2876
|
"A valid cart is required before checkout can start.",
|
|
@@ -2763,6 +2879,7 @@ var CimplifyElements = class {
|
|
|
2763
2879
|
}
|
|
2764
2880
|
if (!options.order_type) {
|
|
2765
2881
|
console.debug("[cimplify:checkout] BLOCKED: no order_type");
|
|
2882
|
+
this.checkoutInProgress = false;
|
|
2766
2883
|
return toCheckoutError(
|
|
2767
2884
|
"ORDER_TYPE_REQUIRED",
|
|
2768
2885
|
"Order type is required before checkout can start.",
|
|
@@ -2772,6 +2889,7 @@ var CimplifyElements = class {
|
|
|
2772
2889
|
const checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
2773
2890
|
if (!checkoutElement) {
|
|
2774
2891
|
console.debug("[cimplify:checkout] BLOCKED: no checkout element");
|
|
2892
|
+
this.checkoutInProgress = false;
|
|
2775
2893
|
return toCheckoutError(
|
|
2776
2894
|
"NO_PAYMENT_ELEMENT",
|
|
2777
2895
|
"Checkout element must be mounted before checkout.",
|
|
@@ -2780,6 +2898,7 @@ var CimplifyElements = class {
|
|
|
2780
2898
|
}
|
|
2781
2899
|
if (!checkoutElement.isMounted()) {
|
|
2782
2900
|
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2901
|
+
this.checkoutInProgress = false;
|
|
2783
2902
|
return toCheckoutError(
|
|
2784
2903
|
"PAYMENT_NOT_MOUNTED",
|
|
2785
2904
|
"Checkout element must be mounted before checkout.",
|
|
@@ -2791,6 +2910,7 @@ var CimplifyElements = class {
|
|
|
2791
2910
|
const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
|
|
2792
2911
|
if (authElement && !this.accessToken) {
|
|
2793
2912
|
console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
|
|
2913
|
+
this.checkoutInProgress = false;
|
|
2794
2914
|
return toCheckoutError(
|
|
2795
2915
|
"AUTH_INCOMPLETE",
|
|
2796
2916
|
"Authentication must complete before checkout can start.",
|
|
@@ -2828,7 +2948,6 @@ var CimplifyElements = class {
|
|
|
2828
2948
|
};
|
|
2829
2949
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2830
2950
|
const paymentWindow = checkoutElement.getContentWindow();
|
|
2831
|
-
this.checkoutInProgress = true;
|
|
2832
2951
|
return new Promise((resolve) => {
|
|
2833
2952
|
let settled = false;
|
|
2834
2953
|
const cleanup = () => {
|
|
@@ -3123,6 +3242,9 @@ var CimplifyElement = class {
|
|
|
3123
3242
|
this.sendMessage({ type: MESSAGE_TYPES.GET_DATA });
|
|
3124
3243
|
});
|
|
3125
3244
|
}
|
|
3245
|
+
setCart(cart) {
|
|
3246
|
+
this.sendMessage({ type: MESSAGE_TYPES.SET_CART, cart });
|
|
3247
|
+
}
|
|
3126
3248
|
sendMessage(message) {
|
|
3127
3249
|
if (this.iframe?.contentWindow) {
|
|
3128
3250
|
this.iframe.contentWindow.postMessage(message, this.linkUrl);
|
|
@@ -3271,6 +3393,7 @@ var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
|
3271
3393
|
var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
|
|
3272
3394
|
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3273
3395
|
var SESSION_TOKEN_HEADER = "x-session-token";
|
|
3396
|
+
var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
3274
3397
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3275
3398
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3276
3399
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3377,6 +3500,14 @@ var CimplifyClient = class {
|
|
|
3377
3500
|
);
|
|
3378
3501
|
}
|
|
3379
3502
|
}
|
|
3503
|
+
/** Build a full URL, appending context params (e.g. location_id) as query parameters. */
|
|
3504
|
+
buildUrl(base, path) {
|
|
3505
|
+
const url = `${base}${path}`;
|
|
3506
|
+
const locationId = this.context.location_id;
|
|
3507
|
+
if (!locationId) return url;
|
|
3508
|
+
const separator = url.includes("?") ? "&" : "?";
|
|
3509
|
+
return `${url}${separator}location_id=${encodeURIComponent(locationId)}`;
|
|
3510
|
+
}
|
|
3380
3511
|
/** @deprecated Use getAccessToken() instead */
|
|
3381
3512
|
getSessionToken() {
|
|
3382
3513
|
return this.accessToken;
|
|
@@ -3420,12 +3551,27 @@ var CimplifyClient = class {
|
|
|
3420
3551
|
}
|
|
3421
3552
|
setOrderToken(orderId, token) {
|
|
3422
3553
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3423
|
-
|
|
3554
|
+
try {
|
|
3555
|
+
const entry = JSON.stringify({ token, storedAt: Date.now() });
|
|
3556
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, entry);
|
|
3557
|
+
} catch {
|
|
3558
|
+
}
|
|
3424
3559
|
}
|
|
3425
3560
|
}
|
|
3426
3561
|
getOrderToken(orderId) {
|
|
3427
3562
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3428
|
-
|
|
3563
|
+
try {
|
|
3564
|
+
const raw = localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3565
|
+
if (!raw) return null;
|
|
3566
|
+
const entry = JSON.parse(raw);
|
|
3567
|
+
if (Date.now() - entry.storedAt > ORDER_TOKEN_TTL_MS) {
|
|
3568
|
+
localStorage.removeItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3569
|
+
return null;
|
|
3570
|
+
}
|
|
3571
|
+
return entry.token;
|
|
3572
|
+
} catch {
|
|
3573
|
+
return null;
|
|
3574
|
+
}
|
|
3429
3575
|
}
|
|
3430
3576
|
return null;
|
|
3431
3577
|
}
|
|
@@ -3501,10 +3647,13 @@ var CimplifyClient = class {
|
|
|
3501
3647
|
}
|
|
3502
3648
|
saveAccessToken(token) {
|
|
3503
3649
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3650
|
+
try {
|
|
3651
|
+
if (token) {
|
|
3652
|
+
localStorage.setItem(ACCESS_TOKEN_STORAGE_KEY, token);
|
|
3653
|
+
} else {
|
|
3654
|
+
localStorage.removeItem(ACCESS_TOKEN_STORAGE_KEY);
|
|
3655
|
+
}
|
|
3656
|
+
} catch {
|
|
3508
3657
|
}
|
|
3509
3658
|
}
|
|
3510
3659
|
}
|
|
@@ -3577,6 +3726,19 @@ var CimplifyClient = class {
|
|
|
3577
3726
|
});
|
|
3578
3727
|
return response;
|
|
3579
3728
|
}
|
|
3729
|
+
if (response.status === 429 && attempt < this.maxRetries) {
|
|
3730
|
+
retryCount++;
|
|
3731
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
3732
|
+
const delay = retryAfter ? Math.min(parseInt(retryAfter, 10) * 1e3, 3e4) || this.retryDelay * Math.pow(2, attempt) : this.retryDelay * Math.pow(2, attempt);
|
|
3733
|
+
this.hooks.onRetry?.({
|
|
3734
|
+
...context,
|
|
3735
|
+
attempt: retryCount,
|
|
3736
|
+
delayMs: delay,
|
|
3737
|
+
error: new Error(`Rate limited: ${response.status}`)
|
|
3738
|
+
});
|
|
3739
|
+
await sleep(delay);
|
|
3740
|
+
continue;
|
|
3741
|
+
}
|
|
3580
3742
|
if (response.status >= 400 && response.status < 500) {
|
|
3581
3743
|
this.hooks.onRequestError?.({
|
|
3582
3744
|
...context,
|
|
@@ -3669,7 +3831,7 @@ var CimplifyClient = class {
|
|
|
3669
3831
|
async get(path) {
|
|
3670
3832
|
const key = this.getDedupeKey("get", path);
|
|
3671
3833
|
return this.deduplicatedRequest(key, async () => {
|
|
3672
|
-
const response = await this.resilientFetch(
|
|
3834
|
+
const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
|
|
3673
3835
|
method: "GET",
|
|
3674
3836
|
credentials: this.credentials,
|
|
3675
3837
|
headers: this.getHeaders()
|
|
@@ -3678,7 +3840,7 @@ var CimplifyClient = class {
|
|
|
3678
3840
|
});
|
|
3679
3841
|
}
|
|
3680
3842
|
async post(path, body) {
|
|
3681
|
-
const response = await this.resilientFetch(
|
|
3843
|
+
const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
|
|
3682
3844
|
method: "POST",
|
|
3683
3845
|
credentials: this.credentials,
|
|
3684
3846
|
headers: this.getHeaders(),
|
|
@@ -3687,7 +3849,7 @@ var CimplifyClient = class {
|
|
|
3687
3849
|
return this.handleRestResponse(response);
|
|
3688
3850
|
}
|
|
3689
3851
|
async patch(path, body) {
|
|
3690
|
-
const response = await this.resilientFetch(
|
|
3852
|
+
const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
|
|
3691
3853
|
method: "PATCH",
|
|
3692
3854
|
credentials: this.credentials,
|
|
3693
3855
|
headers: this.getHeaders(),
|
|
@@ -3696,7 +3858,7 @@ var CimplifyClient = class {
|
|
|
3696
3858
|
return this.handleRestResponse(response);
|
|
3697
3859
|
}
|
|
3698
3860
|
async delete(path) {
|
|
3699
|
-
const response = await this.resilientFetch(
|
|
3861
|
+
const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
|
|
3700
3862
|
method: "DELETE",
|
|
3701
3863
|
credentials: this.credentials,
|
|
3702
3864
|
headers: this.getHeaders()
|
|
@@ -3927,103 +4089,4 @@ function query(entity) {
|
|
|
3927
4089
|
return new QueryBuilder(entity);
|
|
3928
4090
|
}
|
|
3929
4091
|
|
|
3930
|
-
// src/constants.ts
|
|
3931
|
-
var CHECKOUT_MODE = {
|
|
3932
|
-
LINK: "link",
|
|
3933
|
-
GUEST: "guest"
|
|
3934
|
-
};
|
|
3935
|
-
var ORDER_TYPE = {
|
|
3936
|
-
DELIVERY: "delivery",
|
|
3937
|
-
PICKUP: "pickup",
|
|
3938
|
-
DINE_IN: "dine-in",
|
|
3939
|
-
WALK_IN: "walk-in"
|
|
3940
|
-
};
|
|
3941
|
-
var PAYMENT_METHOD = {
|
|
3942
|
-
MOBILE_MONEY: "mobile_money",
|
|
3943
|
-
CARD: "card"
|
|
3944
|
-
};
|
|
3945
|
-
var CHECKOUT_STEP = {
|
|
3946
|
-
AUTHENTICATION: "authentication",
|
|
3947
|
-
ORDER_DETAILS: "order_details",
|
|
3948
|
-
PAYMENT_METHOD: "payment_method",
|
|
3949
|
-
PAYMENT: "payment",
|
|
3950
|
-
CONFIRMATION: "confirmation"
|
|
3951
|
-
};
|
|
3952
|
-
var PAYMENT_STATE = {
|
|
3953
|
-
INITIAL: "initial",
|
|
3954
|
-
PREPARING: "preparing",
|
|
3955
|
-
PROCESSING: "processing",
|
|
3956
|
-
VERIFYING: "verifying",
|
|
3957
|
-
AWAITING_AUTHORIZATION: "awaiting_authorization",
|
|
3958
|
-
SUCCESS: "success",
|
|
3959
|
-
ERROR: "error",
|
|
3960
|
-
TIMEOUT: "timeout"
|
|
3961
|
-
};
|
|
3962
|
-
var PICKUP_TIME_TYPE = {
|
|
3963
|
-
ASAP: "asap",
|
|
3964
|
-
SCHEDULED: "scheduled"
|
|
3965
|
-
};
|
|
3966
|
-
var MOBILE_MONEY_PROVIDER = {
|
|
3967
|
-
MTN: "mtn",
|
|
3968
|
-
VODAFONE: "vodafone",
|
|
3969
|
-
AIRTEL: "airtel"
|
|
3970
|
-
};
|
|
3971
|
-
var AUTHORIZATION_TYPE = {
|
|
3972
|
-
OTP: "otp",
|
|
3973
|
-
PIN: "pin",
|
|
3974
|
-
PHONE: "phone",
|
|
3975
|
-
BIRTHDAY: "birthday",
|
|
3976
|
-
ADDRESS: "address"
|
|
3977
|
-
};
|
|
3978
|
-
var DEVICE_TYPE = {
|
|
3979
|
-
MOBILE: "mobile",
|
|
3980
|
-
DESKTOP: "desktop",
|
|
3981
|
-
TABLET: "tablet"
|
|
3982
|
-
};
|
|
3983
|
-
var CONTACT_TYPE = {
|
|
3984
|
-
PHONE: "phone",
|
|
3985
|
-
EMAIL: "email"
|
|
3986
|
-
};
|
|
3987
|
-
var LINK_QUERY = {
|
|
3988
|
-
DATA: "link.data",
|
|
3989
|
-
ADDRESSES: "link.addresses",
|
|
3990
|
-
MOBILE_MONEY: "link.mobile_money",
|
|
3991
|
-
PREFERENCES: "link.preferences",
|
|
3992
|
-
SESSIONS: "link.sessions"
|
|
3993
|
-
};
|
|
3994
|
-
var LINK_MUTATION = {
|
|
3995
|
-
CHECK_STATUS: "link.check_status",
|
|
3996
|
-
ENROLL: "link.enroll",
|
|
3997
|
-
ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order",
|
|
3998
|
-
UPDATE_PREFERENCES: "link.update_preferences",
|
|
3999
|
-
CREATE_ADDRESS: "link.create_address",
|
|
4000
|
-
UPDATE_ADDRESS: "link.update_address",
|
|
4001
|
-
DELETE_ADDRESS: "link.delete_address",
|
|
4002
|
-
SET_DEFAULT_ADDRESS: "link.set_default_address",
|
|
4003
|
-
TRACK_ADDRESS_USAGE: "link.track_address_usage",
|
|
4004
|
-
CREATE_MOBILE_MONEY: "link.create_mobile_money",
|
|
4005
|
-
DELETE_MOBILE_MONEY: "link.delete_mobile_money",
|
|
4006
|
-
SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money",
|
|
4007
|
-
TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage",
|
|
4008
|
-
VERIFY_MOBILE_MONEY: "link.verify_mobile_money",
|
|
4009
|
-
REVOKE_SESSION: "link.revoke_session",
|
|
4010
|
-
REVOKE_ALL_SESSIONS: "link.revoke_all_sessions"
|
|
4011
|
-
};
|
|
4012
|
-
var AUTH_MUTATION = {
|
|
4013
|
-
REQUEST_OTP: "auth.request_otp",
|
|
4014
|
-
VERIFY_OTP: "auth.verify_otp"
|
|
4015
|
-
};
|
|
4016
|
-
var CHECKOUT_MUTATION = {
|
|
4017
|
-
PROCESS: "checkout.process"
|
|
4018
|
-
};
|
|
4019
|
-
var PAYMENT_MUTATION = {
|
|
4020
|
-
SUBMIT_AUTHORIZATION: "payment.submit_authorization",
|
|
4021
|
-
CHECK_STATUS: "order.poll_payment_status"
|
|
4022
|
-
};
|
|
4023
|
-
var ORDER_MUTATION = {
|
|
4024
|
-
UPDATE_CUSTOMER: "order.update_order_customer"
|
|
4025
|
-
};
|
|
4026
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
4027
|
-
var DEFAULT_COUNTRY = "GHA";
|
|
4028
|
-
|
|
4029
4092
|
export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CURRENCY_SYMBOLS, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyClient, CimplifyElement, CimplifyElements, CimplifyError, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, ERROR_HINTS, EVENT_TYPES, ErrorCode, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, QueryBuilder, SchedulingService, ZERO, categorizePaymentError, combine, combineObject, createCimplifyClient, createElements, currencyCode, detectMobileMoneyProvider, enrichError, err, flatMap, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, fromPromise, generateIdempotencyKey, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getErrorHint, getMarkupPercentage, getOrElse, getProductCurrency, getTaxAmount, hasTaxInfo, isCimplifyError, isErr, isOk, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isRetryableError, isTaxInclusive, mapError, mapResult, money, moneyFromNumber, normalizePaymentResponse, normalizeStatusResponse, ok, parsePrice, query, toNullable, tryCatch, unwrap };
|
package/dist/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cJ as AuthenticatedData, cF as AddressInfo, cG as PaymentMethodInfo, cL as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-
|
|
1
|
+
import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cJ as AuthenticatedData, cF as AddressInfo, cG as PaymentMethodInfo, cL as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-DnAfLDhV.mjs';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.mjs';
|
|
4
4
|
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.mjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cJ as AuthenticatedData, cF as AddressInfo, cG as PaymentMethodInfo, cL as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-
|
|
1
|
+
import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cJ as AuthenticatedData, cF as AddressInfo, cG as PaymentMethodInfo, cL as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-hKTJv1I1.js';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.js';
|
|
4
4
|
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.js';
|