@cimplify/sdk 0.8.0 → 0.8.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/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +41 -5
- package/dist/advanced.mjs +41 -5
- package/dist/{client-tMD3aBuM.d.ts → client-1fzEx2NA.d.ts} +41 -1
- package/dist/{client-I-utsHva.d.mts → client-Bm2VkZJq.d.mts} +41 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +171 -110
- package/dist/index.mjs +171 -110
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +419 -301
- package/dist/react.mjs +208 -94
- 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",
|
|
@@ -2608,7 +2722,8 @@ var MESSAGE_TYPES = {
|
|
|
2608
2722
|
CONTACT_PROVIDED: "contact_provided",
|
|
2609
2723
|
CHECKOUT_STATUS: "checkout_status",
|
|
2610
2724
|
CHECKOUT_COMPLETE: "checkout_complete",
|
|
2611
|
-
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2725
|
+
ORDER_TYPE_CHANGED: "order_type_changed",
|
|
2726
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2612
2727
|
};
|
|
2613
2728
|
var EVENT_TYPES = {
|
|
2614
2729
|
READY: "ready",
|
|
@@ -2618,7 +2733,8 @@ var EVENT_TYPES = {
|
|
|
2618
2733
|
CHANGE: "change",
|
|
2619
2734
|
BLUR: "blur",
|
|
2620
2735
|
FOCUS: "focus",
|
|
2621
|
-
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2736
|
+
ORDER_TYPE_CHANGED: "order_type_changed",
|
|
2737
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2622
2738
|
};
|
|
2623
2739
|
|
|
2624
2740
|
// src/elements.ts
|
|
@@ -2751,8 +2867,10 @@ var CimplifyElements = class {
|
|
|
2751
2867
|
false
|
|
2752
2868
|
);
|
|
2753
2869
|
}
|
|
2870
|
+
this.checkoutInProgress = true;
|
|
2754
2871
|
if (!options.cart_id) {
|
|
2755
2872
|
console.debug("[cimplify:checkout] BLOCKED: no cart_id");
|
|
2873
|
+
this.checkoutInProgress = false;
|
|
2756
2874
|
return toCheckoutError(
|
|
2757
2875
|
"INVALID_CART",
|
|
2758
2876
|
"A valid cart is required before checkout can start.",
|
|
@@ -2761,6 +2879,7 @@ var CimplifyElements = class {
|
|
|
2761
2879
|
}
|
|
2762
2880
|
if (!options.order_type) {
|
|
2763
2881
|
console.debug("[cimplify:checkout] BLOCKED: no order_type");
|
|
2882
|
+
this.checkoutInProgress = false;
|
|
2764
2883
|
return toCheckoutError(
|
|
2765
2884
|
"ORDER_TYPE_REQUIRED",
|
|
2766
2885
|
"Order type is required before checkout can start.",
|
|
@@ -2770,6 +2889,7 @@ var CimplifyElements = class {
|
|
|
2770
2889
|
const checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
2771
2890
|
if (!checkoutElement) {
|
|
2772
2891
|
console.debug("[cimplify:checkout] BLOCKED: no checkout element");
|
|
2892
|
+
this.checkoutInProgress = false;
|
|
2773
2893
|
return toCheckoutError(
|
|
2774
2894
|
"NO_PAYMENT_ELEMENT",
|
|
2775
2895
|
"Checkout element must be mounted before checkout.",
|
|
@@ -2778,6 +2898,7 @@ var CimplifyElements = class {
|
|
|
2778
2898
|
}
|
|
2779
2899
|
if (!checkoutElement.isMounted()) {
|
|
2780
2900
|
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2901
|
+
this.checkoutInProgress = false;
|
|
2781
2902
|
return toCheckoutError(
|
|
2782
2903
|
"PAYMENT_NOT_MOUNTED",
|
|
2783
2904
|
"Checkout element must be mounted before checkout.",
|
|
@@ -2789,6 +2910,7 @@ var CimplifyElements = class {
|
|
|
2789
2910
|
const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
|
|
2790
2911
|
if (authElement && !this.accessToken) {
|
|
2791
2912
|
console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
|
|
2913
|
+
this.checkoutInProgress = false;
|
|
2792
2914
|
return toCheckoutError(
|
|
2793
2915
|
"AUTH_INCOMPLETE",
|
|
2794
2916
|
"Authentication must complete before checkout can start.",
|
|
@@ -2826,7 +2948,6 @@ var CimplifyElements = class {
|
|
|
2826
2948
|
};
|
|
2827
2949
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2828
2950
|
const paymentWindow = checkoutElement.getContentWindow();
|
|
2829
|
-
this.checkoutInProgress = true;
|
|
2830
2951
|
return new Promise((resolve) => {
|
|
2831
2952
|
let settled = false;
|
|
2832
2953
|
const cleanup = () => {
|
|
@@ -3121,6 +3242,9 @@ var CimplifyElement = class {
|
|
|
3121
3242
|
this.sendMessage({ type: MESSAGE_TYPES.GET_DATA });
|
|
3122
3243
|
});
|
|
3123
3244
|
}
|
|
3245
|
+
setCart(cart) {
|
|
3246
|
+
this.sendMessage({ type: MESSAGE_TYPES.SET_CART, cart });
|
|
3247
|
+
}
|
|
3124
3248
|
sendMessage(message) {
|
|
3125
3249
|
if (this.iframe?.contentWindow) {
|
|
3126
3250
|
this.iframe.contentWindow.postMessage(message, this.linkUrl);
|
|
@@ -3176,7 +3300,8 @@ var CimplifyElement = class {
|
|
|
3176
3300
|
prefillEmail: this.options.prefillEmail,
|
|
3177
3301
|
appearance: this.parent.getAppearance(),
|
|
3178
3302
|
orderTypes: this.options.orderTypes,
|
|
3179
|
-
defaultOrderType: this.options.defaultOrderType
|
|
3303
|
+
defaultOrderType: this.options.defaultOrderType,
|
|
3304
|
+
renderSubmitButton: true
|
|
3180
3305
|
});
|
|
3181
3306
|
const token = this.parent.getAccessToken();
|
|
3182
3307
|
if (token && this.type !== ELEMENT_TYPES.AUTH) {
|
|
@@ -3243,6 +3368,9 @@ var CimplifyElement = class {
|
|
|
3243
3368
|
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
3244
3369
|
this.emit(EVENT_TYPES.ORDER_TYPE_CHANGED, { orderType: message.orderType });
|
|
3245
3370
|
break;
|
|
3371
|
+
case MESSAGE_TYPES.REQUEST_SUBMIT:
|
|
3372
|
+
this.emit(EVENT_TYPES.REQUEST_SUBMIT, {});
|
|
3373
|
+
break;
|
|
3246
3374
|
}
|
|
3247
3375
|
}
|
|
3248
3376
|
emit(event, data) {
|
|
@@ -3265,6 +3393,7 @@ var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
|
3265
3393
|
var SESSION_TOKEN_STORAGE_KEY = "cimplify_session_token";
|
|
3266
3394
|
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3267
3395
|
var SESSION_TOKEN_HEADER = "x-session-token";
|
|
3396
|
+
var ORDER_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
3268
3397
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3269
3398
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3270
3399
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3414,12 +3543,27 @@ var CimplifyClient = class {
|
|
|
3414
3543
|
}
|
|
3415
3544
|
setOrderToken(orderId, token) {
|
|
3416
3545
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3417
|
-
|
|
3546
|
+
try {
|
|
3547
|
+
const entry = JSON.stringify({ token, storedAt: Date.now() });
|
|
3548
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, entry);
|
|
3549
|
+
} catch {
|
|
3550
|
+
}
|
|
3418
3551
|
}
|
|
3419
3552
|
}
|
|
3420
3553
|
getOrderToken(orderId) {
|
|
3421
3554
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3422
|
-
|
|
3555
|
+
try {
|
|
3556
|
+
const raw = localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3557
|
+
if (!raw) return null;
|
|
3558
|
+
const entry = JSON.parse(raw);
|
|
3559
|
+
if (Date.now() - entry.storedAt > ORDER_TOKEN_TTL_MS) {
|
|
3560
|
+
localStorage.removeItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3561
|
+
return null;
|
|
3562
|
+
}
|
|
3563
|
+
return entry.token;
|
|
3564
|
+
} catch {
|
|
3565
|
+
return null;
|
|
3566
|
+
}
|
|
3423
3567
|
}
|
|
3424
3568
|
return null;
|
|
3425
3569
|
}
|
|
@@ -3495,10 +3639,13 @@ var CimplifyClient = class {
|
|
|
3495
3639
|
}
|
|
3496
3640
|
saveAccessToken(token) {
|
|
3497
3641
|
if (typeof window !== "undefined" && window.localStorage) {
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3642
|
+
try {
|
|
3643
|
+
if (token) {
|
|
3644
|
+
localStorage.setItem(ACCESS_TOKEN_STORAGE_KEY, token);
|
|
3645
|
+
} else {
|
|
3646
|
+
localStorage.removeItem(ACCESS_TOKEN_STORAGE_KEY);
|
|
3647
|
+
}
|
|
3648
|
+
} catch {
|
|
3502
3649
|
}
|
|
3503
3650
|
}
|
|
3504
3651
|
}
|
|
@@ -3571,6 +3718,19 @@ var CimplifyClient = class {
|
|
|
3571
3718
|
});
|
|
3572
3719
|
return response;
|
|
3573
3720
|
}
|
|
3721
|
+
if (response.status === 429 && attempt < this.maxRetries) {
|
|
3722
|
+
retryCount++;
|
|
3723
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
3724
|
+
const delay = retryAfter ? Math.min(parseInt(retryAfter, 10) * 1e3, 3e4) || this.retryDelay * Math.pow(2, attempt) : this.retryDelay * Math.pow(2, attempt);
|
|
3725
|
+
this.hooks.onRetry?.({
|
|
3726
|
+
...context,
|
|
3727
|
+
attempt: retryCount,
|
|
3728
|
+
delayMs: delay,
|
|
3729
|
+
error: new Error(`Rate limited: ${response.status}`)
|
|
3730
|
+
});
|
|
3731
|
+
await sleep(delay);
|
|
3732
|
+
continue;
|
|
3733
|
+
}
|
|
3574
3734
|
if (response.status >= 400 && response.status < 500) {
|
|
3575
3735
|
this.hooks.onRequestError?.({
|
|
3576
3736
|
...context,
|
|
@@ -3921,103 +4081,4 @@ function query(entity) {
|
|
|
3921
4081
|
return new QueryBuilder(entity);
|
|
3922
4082
|
}
|
|
3923
4083
|
|
|
3924
|
-
// src/constants.ts
|
|
3925
|
-
var CHECKOUT_MODE = {
|
|
3926
|
-
LINK: "link",
|
|
3927
|
-
GUEST: "guest"
|
|
3928
|
-
};
|
|
3929
|
-
var ORDER_TYPE = {
|
|
3930
|
-
DELIVERY: "delivery",
|
|
3931
|
-
PICKUP: "pickup",
|
|
3932
|
-
DINE_IN: "dine-in",
|
|
3933
|
-
WALK_IN: "walk-in"
|
|
3934
|
-
};
|
|
3935
|
-
var PAYMENT_METHOD = {
|
|
3936
|
-
MOBILE_MONEY: "mobile_money",
|
|
3937
|
-
CARD: "card"
|
|
3938
|
-
};
|
|
3939
|
-
var CHECKOUT_STEP = {
|
|
3940
|
-
AUTHENTICATION: "authentication",
|
|
3941
|
-
ORDER_DETAILS: "order_details",
|
|
3942
|
-
PAYMENT_METHOD: "payment_method",
|
|
3943
|
-
PAYMENT: "payment",
|
|
3944
|
-
CONFIRMATION: "confirmation"
|
|
3945
|
-
};
|
|
3946
|
-
var PAYMENT_STATE = {
|
|
3947
|
-
INITIAL: "initial",
|
|
3948
|
-
PREPARING: "preparing",
|
|
3949
|
-
PROCESSING: "processing",
|
|
3950
|
-
VERIFYING: "verifying",
|
|
3951
|
-
AWAITING_AUTHORIZATION: "awaiting_authorization",
|
|
3952
|
-
SUCCESS: "success",
|
|
3953
|
-
ERROR: "error",
|
|
3954
|
-
TIMEOUT: "timeout"
|
|
3955
|
-
};
|
|
3956
|
-
var PICKUP_TIME_TYPE = {
|
|
3957
|
-
ASAP: "asap",
|
|
3958
|
-
SCHEDULED: "scheduled"
|
|
3959
|
-
};
|
|
3960
|
-
var MOBILE_MONEY_PROVIDER = {
|
|
3961
|
-
MTN: "mtn",
|
|
3962
|
-
VODAFONE: "vodafone",
|
|
3963
|
-
AIRTEL: "airtel"
|
|
3964
|
-
};
|
|
3965
|
-
var AUTHORIZATION_TYPE = {
|
|
3966
|
-
OTP: "otp",
|
|
3967
|
-
PIN: "pin",
|
|
3968
|
-
PHONE: "phone",
|
|
3969
|
-
BIRTHDAY: "birthday",
|
|
3970
|
-
ADDRESS: "address"
|
|
3971
|
-
};
|
|
3972
|
-
var DEVICE_TYPE = {
|
|
3973
|
-
MOBILE: "mobile",
|
|
3974
|
-
DESKTOP: "desktop",
|
|
3975
|
-
TABLET: "tablet"
|
|
3976
|
-
};
|
|
3977
|
-
var CONTACT_TYPE = {
|
|
3978
|
-
PHONE: "phone",
|
|
3979
|
-
EMAIL: "email"
|
|
3980
|
-
};
|
|
3981
|
-
var LINK_QUERY = {
|
|
3982
|
-
DATA: "link.data",
|
|
3983
|
-
ADDRESSES: "link.addresses",
|
|
3984
|
-
MOBILE_MONEY: "link.mobile_money",
|
|
3985
|
-
PREFERENCES: "link.preferences",
|
|
3986
|
-
SESSIONS: "link.sessions"
|
|
3987
|
-
};
|
|
3988
|
-
var LINK_MUTATION = {
|
|
3989
|
-
CHECK_STATUS: "link.check_status",
|
|
3990
|
-
ENROLL: "link.enroll",
|
|
3991
|
-
ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order",
|
|
3992
|
-
UPDATE_PREFERENCES: "link.update_preferences",
|
|
3993
|
-
CREATE_ADDRESS: "link.create_address",
|
|
3994
|
-
UPDATE_ADDRESS: "link.update_address",
|
|
3995
|
-
DELETE_ADDRESS: "link.delete_address",
|
|
3996
|
-
SET_DEFAULT_ADDRESS: "link.set_default_address",
|
|
3997
|
-
TRACK_ADDRESS_USAGE: "link.track_address_usage",
|
|
3998
|
-
CREATE_MOBILE_MONEY: "link.create_mobile_money",
|
|
3999
|
-
DELETE_MOBILE_MONEY: "link.delete_mobile_money",
|
|
4000
|
-
SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money",
|
|
4001
|
-
TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage",
|
|
4002
|
-
VERIFY_MOBILE_MONEY: "link.verify_mobile_money",
|
|
4003
|
-
REVOKE_SESSION: "link.revoke_session",
|
|
4004
|
-
REVOKE_ALL_SESSIONS: "link.revoke_all_sessions"
|
|
4005
|
-
};
|
|
4006
|
-
var AUTH_MUTATION = {
|
|
4007
|
-
REQUEST_OTP: "auth.request_otp",
|
|
4008
|
-
VERIFY_OTP: "auth.verify_otp"
|
|
4009
|
-
};
|
|
4010
|
-
var CHECKOUT_MUTATION = {
|
|
4011
|
-
PROCESS: "checkout.process"
|
|
4012
|
-
};
|
|
4013
|
-
var PAYMENT_MUTATION = {
|
|
4014
|
-
SUBMIT_AUTHORIZATION: "payment.submit_authorization",
|
|
4015
|
-
CHECK_STATUS: "order.poll_payment_status"
|
|
4016
|
-
};
|
|
4017
|
-
var ORDER_MUTATION = {
|
|
4018
|
-
UPDATE_CUSTOMER: "order.update_order_customer"
|
|
4019
|
-
};
|
|
4020
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
4021
|
-
var DEFAULT_COUNTRY = "GHA";
|
|
4022
|
-
|
|
4023
4084
|
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-Bm2VkZJq.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-1fzEx2NA.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';
|