@cimplify/sdk 0.101.1 → 0.103.0
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 +23 -22
- package/dist/advanced.mjs +4 -3
- package/dist/{chunk-QPRI2NII.js → chunk-2P4KXFB6.js} +6 -0
- package/dist/{chunk-4G5UWFC3.mjs → chunk-3V4DVXV3.mjs} +6 -1
- package/dist/{chunk-YHPMFTMN.mjs → chunk-C2JSNJUC.mjs} +406 -95
- package/dist/chunk-CNN7Z2IP.js +125 -0
- package/dist/{chunk-DKLHCZ5M.mjs → chunk-GERXZQSX.mjs} +487 -11
- package/dist/chunk-GOHSXBKW.mjs +105 -0
- package/dist/{chunk-7H6IL7CX.mjs → chunk-H7ACMHM3.mjs} +40 -15
- package/dist/{chunk-Z3K2D3TE.mjs → chunk-J6PNHDHL.mjs} +453 -483
- package/dist/{chunk-NIOUSKQQ.js → chunk-JG5CQNCB.js} +5 -0
- package/dist/{chunk-YER7DIOM.js → chunk-JSWJ4XDE.js} +471 -519
- package/dist/{chunk-DLW3RWRK.mjs → chunk-M4URVKHE.mjs} +46 -12
- package/dist/{chunk-WMEC5JWN.js → chunk-NNG6IFFX.js} +50 -13
- package/dist/{chunk-ICCCSVN3.js → chunk-QOWPGS7Z.js} +42 -16
- package/dist/{chunk-YDA46OZ6.js → chunk-R6OLQ33I.js} +560 -80
- package/dist/{chunk-H5SSGN7W.js → chunk-VIL6IQCG.js} +408 -97
- package/dist/{chunk-O3YUHLZL.mjs → chunk-VNPEYLB2.mjs} +5 -0
- package/dist/{client-Db554902.d.ts → client-BfpNjJ_a.d.mts} +93 -299
- package/dist/{client-CdTx7X_X.d.mts → client-DHBwvh7U.d.ts} +93 -299
- package/dist/{client-WkUcvRvO.d.mts → client-DpqRobY9.d.mts} +2 -2
- package/dist/{client-D40kI8z2.d.ts → client-Dqg2mc-7.d.ts} +2 -2
- package/dist/{index-D3UXgAYl.d.ts → index-C8uDqLwJ.d.ts} +14 -4
- package/dist/{index-BjWUkYgY.d.mts → index-e2y6AK70.d.mts} +14 -4
- package/dist/index.d.mts +92 -8
- package/dist/index.d.ts +92 -8
- package/dist/index.js +225 -188
- package/dist/index.mjs +7 -6
- package/dist/link-cuNVYc2s.d.mts +297 -0
- package/dist/link-cuNVYc2s.d.ts +297 -0
- package/dist/mock/cli.mjs +412 -94
- package/dist/mock/library.js +412 -94
- package/dist/mock/library.mjs +412 -94
- package/dist/mock/msw.js +412 -94
- package/dist/mock/msw.mjs +412 -94
- package/dist/{product-DwKdC_to.d.mts → payment-H5LoIvXU.d.mts} +207 -7
- package/dist/{product-DwKdC_to.d.ts → payment-H5LoIvXU.d.ts} +207 -7
- package/dist/{price-CiQUd_XX.d.mts → price-BvePgDXe.d.mts} +1 -1
- package/dist/{price-D9EOj8y8.d.ts → price-C2RqscMY.d.ts} +1 -1
- package/dist/react.d.mts +6 -4
- package/dist/react.d.ts +6 -4
- package/dist/react.js +203 -198
- package/dist/react.mjs +11 -6
- package/dist/{server-CeDb93WA.d.ts → server-C7FyLdrz.d.mts} +11 -9
- package/dist/{server-D-nSkrUr.d.mts → server-DoXIpSd7.d.ts} +11 -9
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +11 -10
- package/dist/server.mjs +5 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +4 -3
- package/dist/testing/msw.mjs +3 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +26 -25
- package/dist/testing/suite.mjs +7 -6
- package/dist/testing.d.mts +175 -45
- package/dist/testing.d.ts +175 -45
- package/dist/testing.js +86 -81
- package/dist/testing.mjs +8 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +37 -29
- package/dist/utils.mjs +2 -2
- package/package.json +7 -1
- package/dist/payment-CRqjGrx6.d.mts +0 -113
- package/dist/payment-DO1Z1Ip6.d.ts +0 -113
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { X as CimplifyError, U as Category, be as Product, f as AddOnWithOptions, aW as Pagination, bs as ProductWithDetails, bq as ProductVariant, bY as VariantAxis, bZ as VariantAxisSelection, A as AddOn, Y as Collection, I as BundleSummary, w as Bundle, a5 as Composite, a3 as ComponentSelectionInput, aa as CompositePriceResult, af as CurrencyCode, W as ChosenPrice, bz as SaleInfo, bn as ProductTaxonomy, bQ as TaxonomyWithChildren, aC as EligiblePlansQuery, bi as ProductBillingPlan, bo as ProductTimeProfile, bh as ProductAvailabilityNow, al as Deal, bj as ProductDealInfo, au as DiscountValidation, bM as TagsResponse, ag as CustomAttributeDefinition, ah as CustomAttributeValue, bt as PropertyFacet, bP as TaxonomyAttributeTemplate, aP as KnowledgeArticle, bR as UICart, N as CartItem, aq as DestinationQuoteInput, ao as DestinationQuote, S as CartSummary, g as AddToCartInput, P as CartMutationResult, bX as UpdateCartItemInput, at as DiscountDetails, aU as Money, aQ as LineConfiguration, bO as TaxPriceDisplayMode, q as AuthorizationType, aZ as PaymentAuthorizationKind, a_ as PaymentAuthorizationSubmission, b0 as PaymentMethod, aL as InitializePaymentResult, bF as SubmitAuthorizationInput, b6 as PaymentStatusResponse, c2 as VariantDetails, c3 as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, F as BundleSelectionData, ac as CompositeSelectionData, ai as CustomerInputValue, c9 as components, bB as SchedulingMode, aA as DurationUnit, bG as Subscription, bK as SubscriptionWithDetails } from './payment-H5LoIvXU.js';
|
|
2
|
+
import { P as PAYMENT_METHOD, B as ORDER_TYPE, z as MobileMoneyProvider, C as CHECKOUT_MODE, e as CHECKOUT_STEP, H as PICKUP_TIME_TYPE, R as RequestOtpInput, V as VerifyOtpInput, c as AuthResponse, w as LinkStatusResult, t as LinkData, k as CustomerAddress, m as CustomerMobileMoney, l as CustomerLinkPreferences, j as Customer, r as EnrollmentData, u as LinkEnrollResult, E as EnrollAndLinkOrderInput, q as EnrollAndLinkOrderResult, h as CreateAddressInput, U as UpdateAddressInput, i as CreateMobileMoneyInput, v as LinkSession, J as RevokeSessionResult, I as RevokeAllSessionsResult } from './link-cuNVYc2s.js';
|
|
3
3
|
|
|
4
4
|
interface RequestContext {
|
|
5
5
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
@@ -777,300 +777,6 @@ interface RelatedProductsEnrichment {
|
|
|
777
777
|
cross_sells: RelatedCandidate[];
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
-
declare const CHECKOUT_MODE: {
|
|
781
|
-
readonly LINK: "link";
|
|
782
|
-
readonly GUEST: "guest";
|
|
783
|
-
};
|
|
784
|
-
declare const ORDER_TYPE: {
|
|
785
|
-
readonly DELIVERY: "delivery";
|
|
786
|
-
readonly PICKUP: "pickup";
|
|
787
|
-
readonly DINE_IN: "dine-in";
|
|
788
|
-
readonly WALK_IN: "walk-in";
|
|
789
|
-
};
|
|
790
|
-
declare const PAYMENT_METHOD: {
|
|
791
|
-
readonly MOBILE_MONEY: "mobile_money";
|
|
792
|
-
readonly CARD: "card";
|
|
793
|
-
};
|
|
794
|
-
declare const CHECKOUT_STEP: {
|
|
795
|
-
readonly AUTHENTICATION: "authentication";
|
|
796
|
-
readonly ORDER_DETAILS: "order_details";
|
|
797
|
-
readonly PAYMENT_METHOD: "payment_method";
|
|
798
|
-
readonly PAYMENT: "payment";
|
|
799
|
-
readonly CONFIRMATION: "confirmation";
|
|
800
|
-
};
|
|
801
|
-
declare const PAYMENT_STATE: {
|
|
802
|
-
readonly INITIAL: "initial";
|
|
803
|
-
readonly PREPARING: "preparing";
|
|
804
|
-
readonly PROCESSING: "processing";
|
|
805
|
-
readonly VERIFYING: "verifying";
|
|
806
|
-
readonly AWAITING_AUTHORIZATION: "awaiting_authorization";
|
|
807
|
-
readonly SUCCESS: "success";
|
|
808
|
-
readonly ERROR: "error";
|
|
809
|
-
readonly TIMEOUT: "timeout";
|
|
810
|
-
};
|
|
811
|
-
declare const PICKUP_TIME_TYPE: {
|
|
812
|
-
readonly ASAP: "asap";
|
|
813
|
-
readonly SCHEDULED: "scheduled";
|
|
814
|
-
};
|
|
815
|
-
declare const MOBILE_MONEY_PROVIDER: {
|
|
816
|
-
readonly MTN: "mtn";
|
|
817
|
-
readonly VODAFONE: "vodafone";
|
|
818
|
-
readonly TELECEL: "telecel";
|
|
819
|
-
readonly AIRTEL: "airtel";
|
|
820
|
-
readonly AIRTELTIGO: "airteltigo";
|
|
821
|
-
readonly MPESA: "mpesa";
|
|
822
|
-
};
|
|
823
|
-
declare const AUTHORIZATION_TYPE: {
|
|
824
|
-
readonly OTP: "otp";
|
|
825
|
-
readonly PIN: "pin";
|
|
826
|
-
readonly PHONE: "phone";
|
|
827
|
-
readonly BIRTHDAY: "birthday";
|
|
828
|
-
readonly ADDRESS: "address";
|
|
829
|
-
};
|
|
830
|
-
declare const DEVICE_TYPE: {
|
|
831
|
-
readonly MOBILE: "mobile";
|
|
832
|
-
readonly DESKTOP: "desktop";
|
|
833
|
-
readonly TABLET: "tablet";
|
|
834
|
-
readonly UNKNOWN: "unknown";
|
|
835
|
-
};
|
|
836
|
-
declare const CONTACT_TYPE: {
|
|
837
|
-
readonly PHONE: "phone";
|
|
838
|
-
readonly EMAIL: "email";
|
|
839
|
-
};
|
|
840
|
-
declare const LINK_QUERY: {
|
|
841
|
-
readonly DATA: "link.data";
|
|
842
|
-
readonly ADDRESSES: "link.addresses";
|
|
843
|
-
readonly MOBILE_MONEY: "link.mobile_money";
|
|
844
|
-
readonly PREFERENCES: "link.preferences";
|
|
845
|
-
readonly SESSIONS: "link.sessions";
|
|
846
|
-
};
|
|
847
|
-
declare const LINK_MUTATION: {
|
|
848
|
-
readonly CHECK_STATUS: "link.check_status";
|
|
849
|
-
readonly ENROLL: "link.enroll";
|
|
850
|
-
readonly ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order";
|
|
851
|
-
readonly UPDATE_PREFERENCES: "link.update_preferences";
|
|
852
|
-
readonly CREATE_ADDRESS: "link.create_address";
|
|
853
|
-
readonly UPDATE_ADDRESS: "link.update_address";
|
|
854
|
-
readonly DELETE_ADDRESS: "link.delete_address";
|
|
855
|
-
readonly SET_DEFAULT_ADDRESS: "link.set_default_address";
|
|
856
|
-
readonly TRACK_ADDRESS_USAGE: "link.track_address_usage";
|
|
857
|
-
readonly CREATE_MOBILE_MONEY: "link.create_mobile_money";
|
|
858
|
-
readonly DELETE_MOBILE_MONEY: "link.delete_mobile_money";
|
|
859
|
-
readonly SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money";
|
|
860
|
-
readonly TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage";
|
|
861
|
-
readonly VERIFY_MOBILE_MONEY: "link.verify_mobile_money";
|
|
862
|
-
readonly REVOKE_SESSION: "link.revoke_session";
|
|
863
|
-
readonly REVOKE_ALL_SESSIONS: "link.revoke_all_sessions";
|
|
864
|
-
};
|
|
865
|
-
declare const AUTH_MUTATION: {
|
|
866
|
-
readonly REQUEST_OTP: "auth.request_otp";
|
|
867
|
-
readonly VERIFY_OTP: "auth.verify_otp";
|
|
868
|
-
};
|
|
869
|
-
declare const CHECKOUT_MUTATION: {
|
|
870
|
-
readonly PROCESS: "checkout.process";
|
|
871
|
-
};
|
|
872
|
-
declare const PAYMENT_MUTATION: {
|
|
873
|
-
readonly SUBMIT_AUTHORIZATION: "payment.submit_authorization";
|
|
874
|
-
readonly CHECK_STATUS: "order.poll_payment_status";
|
|
875
|
-
};
|
|
876
|
-
declare const ORDER_MUTATION: {
|
|
877
|
-
readonly UPDATE_CUSTOMER: "order.update_order_customer";
|
|
878
|
-
};
|
|
879
|
-
declare const DEFAULT_CURRENCY = "GHS";
|
|
880
|
-
declare const DEFAULT_COUNTRY = "GHA";
|
|
881
|
-
|
|
882
|
-
type MobileMoneyProvider = (typeof MOBILE_MONEY_PROVIDER)[keyof typeof MOBILE_MONEY_PROVIDER];
|
|
883
|
-
interface Customer {
|
|
884
|
-
id: string;
|
|
885
|
-
email: string | null;
|
|
886
|
-
phone: string | null;
|
|
887
|
-
name: string;
|
|
888
|
-
delivery_address: string | null;
|
|
889
|
-
created_at: string;
|
|
890
|
-
updated_at: string;
|
|
891
|
-
metadata?: Record<string, unknown> | null;
|
|
892
|
-
account_id?: string | null;
|
|
893
|
-
}
|
|
894
|
-
interface CustomerAddress {
|
|
895
|
-
id: string;
|
|
896
|
-
customer_id: string;
|
|
897
|
-
label: string;
|
|
898
|
-
street_address: string;
|
|
899
|
-
apartment: string | null;
|
|
900
|
-
city: string;
|
|
901
|
-
region: string;
|
|
902
|
-
postal_code: string | null;
|
|
903
|
-
country: string | null;
|
|
904
|
-
delivery_instructions: string | null;
|
|
905
|
-
phone_for_delivery: string | null;
|
|
906
|
-
latitude: number | null;
|
|
907
|
-
longitude: number | null;
|
|
908
|
-
is_default: boolean | null;
|
|
909
|
-
usage_count: number | null;
|
|
910
|
-
last_used_at: string | null;
|
|
911
|
-
created_at: string;
|
|
912
|
-
updated_at: string;
|
|
913
|
-
}
|
|
914
|
-
interface CustomerMobileMoney {
|
|
915
|
-
id: string;
|
|
916
|
-
customer_id: string;
|
|
917
|
-
phone_number: string;
|
|
918
|
-
provider: string;
|
|
919
|
-
label: string;
|
|
920
|
-
is_verified: boolean | null;
|
|
921
|
-
verification_date: string | null;
|
|
922
|
-
is_default: boolean | null;
|
|
923
|
-
usage_count: number | null;
|
|
924
|
-
last_used_at: string | null;
|
|
925
|
-
success_rate: number | null;
|
|
926
|
-
created_at: string;
|
|
927
|
-
updated_at: string;
|
|
928
|
-
}
|
|
929
|
-
interface CustomerLinkPreferences {
|
|
930
|
-
customer_id: string;
|
|
931
|
-
is_link_enabled: boolean | null;
|
|
932
|
-
enrolled_at: string | null;
|
|
933
|
-
enrollment_business_id: string | null;
|
|
934
|
-
preferred_order_type: string | null;
|
|
935
|
-
default_address_id: string | null;
|
|
936
|
-
default_mobile_money_id: string | null;
|
|
937
|
-
remember_me: boolean | null;
|
|
938
|
-
session_duration_days: number | null;
|
|
939
|
-
two_factor_enabled: boolean | null;
|
|
940
|
-
notify_on_order: boolean | null;
|
|
941
|
-
notify_on_payment: boolean | null;
|
|
942
|
-
created_at: string;
|
|
943
|
-
updated_at: string;
|
|
944
|
-
}
|
|
945
|
-
interface LinkData {
|
|
946
|
-
customer: Customer;
|
|
947
|
-
addresses: CustomerAddress[];
|
|
948
|
-
mobile_money: CustomerMobileMoney[];
|
|
949
|
-
preferences: CustomerLinkPreferences;
|
|
950
|
-
default_address: CustomerAddress | null;
|
|
951
|
-
default_mobile_money: CustomerMobileMoney | null;
|
|
952
|
-
}
|
|
953
|
-
interface CreateAddressInput {
|
|
954
|
-
label?: string;
|
|
955
|
-
street_address: string;
|
|
956
|
-
apartment?: string;
|
|
957
|
-
city: string;
|
|
958
|
-
region?: string;
|
|
959
|
-
postal_code?: string;
|
|
960
|
-
country?: string;
|
|
961
|
-
delivery_instructions?: string;
|
|
962
|
-
phone_for_delivery?: string;
|
|
963
|
-
latitude?: number;
|
|
964
|
-
longitude?: number;
|
|
965
|
-
}
|
|
966
|
-
interface UpdateAddressInput {
|
|
967
|
-
address_id: string;
|
|
968
|
-
label?: string;
|
|
969
|
-
street_address?: string;
|
|
970
|
-
apartment?: string;
|
|
971
|
-
city?: string;
|
|
972
|
-
region?: string;
|
|
973
|
-
postal_code?: string;
|
|
974
|
-
country?: string;
|
|
975
|
-
delivery_instructions?: string;
|
|
976
|
-
phone_for_delivery?: string;
|
|
977
|
-
latitude?: number;
|
|
978
|
-
longitude?: number;
|
|
979
|
-
clear_coordinates?: boolean;
|
|
980
|
-
}
|
|
981
|
-
interface CreateMobileMoneyInput {
|
|
982
|
-
phone_number: string;
|
|
983
|
-
provider: MobileMoneyProvider;
|
|
984
|
-
label?: string;
|
|
985
|
-
}
|
|
986
|
-
interface EnrollmentData {
|
|
987
|
-
contact: string;
|
|
988
|
-
name?: string;
|
|
989
|
-
}
|
|
990
|
-
interface AddressData {
|
|
991
|
-
label: string;
|
|
992
|
-
street_address: string;
|
|
993
|
-
apartment?: string;
|
|
994
|
-
city: string;
|
|
995
|
-
region: string;
|
|
996
|
-
postal_code?: string;
|
|
997
|
-
country?: string;
|
|
998
|
-
delivery_instructions?: string;
|
|
999
|
-
phone_for_delivery?: string;
|
|
1000
|
-
latitude?: number;
|
|
1001
|
-
longitude?: number;
|
|
1002
|
-
}
|
|
1003
|
-
interface MobileMoneyData {
|
|
1004
|
-
phone_number: string;
|
|
1005
|
-
provider: string;
|
|
1006
|
-
label: string;
|
|
1007
|
-
}
|
|
1008
|
-
interface EnrollAndLinkOrderInput {
|
|
1009
|
-
order_id: string;
|
|
1010
|
-
business_id: string;
|
|
1011
|
-
address?: AddressData;
|
|
1012
|
-
mobile_money?: MobileMoneyData;
|
|
1013
|
-
order_type?: string;
|
|
1014
|
-
}
|
|
1015
|
-
interface LinkStatusResult {
|
|
1016
|
-
is_link_customer: boolean;
|
|
1017
|
-
}
|
|
1018
|
-
interface LinkEnrollResult {
|
|
1019
|
-
success: boolean;
|
|
1020
|
-
customer_id: string;
|
|
1021
|
-
contact?: string;
|
|
1022
|
-
enrolled_at?: string;
|
|
1023
|
-
preferences?: CustomerLinkPreferences;
|
|
1024
|
-
}
|
|
1025
|
-
interface EnrollAndLinkOrderResult {
|
|
1026
|
-
success: boolean;
|
|
1027
|
-
customer_id: string;
|
|
1028
|
-
order_id: string;
|
|
1029
|
-
enrollment_result: unknown;
|
|
1030
|
-
linked_at: string;
|
|
1031
|
-
}
|
|
1032
|
-
type DeviceType = (typeof DEVICE_TYPE)[keyof typeof DEVICE_TYPE];
|
|
1033
|
-
interface LinkSession {
|
|
1034
|
-
id: string;
|
|
1035
|
-
device_name: string | null;
|
|
1036
|
-
device_type: DeviceType | null;
|
|
1037
|
-
ip_address: string | null;
|
|
1038
|
-
last_used_at: string | null;
|
|
1039
|
-
created_at: string;
|
|
1040
|
-
is_current: boolean;
|
|
1041
|
-
}
|
|
1042
|
-
interface RevokeSessionResult {
|
|
1043
|
-
success: boolean;
|
|
1044
|
-
session_id: string;
|
|
1045
|
-
message: string;
|
|
1046
|
-
}
|
|
1047
|
-
interface RevokeAllSessionsResult {
|
|
1048
|
-
success: boolean;
|
|
1049
|
-
revoked_count: number;
|
|
1050
|
-
message: string;
|
|
1051
|
-
}
|
|
1052
|
-
type ContactType = (typeof CONTACT_TYPE)[keyof typeof CONTACT_TYPE];
|
|
1053
|
-
interface RequestOtpInput {
|
|
1054
|
-
contact: string;
|
|
1055
|
-
contact_type: ContactType;
|
|
1056
|
-
}
|
|
1057
|
-
interface VerifyOtpInput {
|
|
1058
|
-
contact: string;
|
|
1059
|
-
contact_type: ContactType;
|
|
1060
|
-
otp_code: string;
|
|
1061
|
-
}
|
|
1062
|
-
interface AuthResponse {
|
|
1063
|
-
success: boolean;
|
|
1064
|
-
session_token: string | null;
|
|
1065
|
-
refresh_token?: string | null;
|
|
1066
|
-
account_id?: string | null;
|
|
1067
|
-
customer_id: string | null;
|
|
1068
|
-
name?: string | null;
|
|
1069
|
-
email?: string | null;
|
|
1070
|
-
phone?: string | null;
|
|
1071
|
-
message: string;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
780
|
type OrderType = "delivery" | "pickup" | "dine-in" | "walk-in";
|
|
1075
781
|
declare const ELEMENT_TYPES: {
|
|
1076
782
|
readonly AUTH: "auth";
|
|
@@ -1245,6 +951,9 @@ interface CheckoutCartData {
|
|
|
1245
951
|
tax_inclusive: boolean;
|
|
1246
952
|
/** Tax rate in percentage points (8.25 means 8.25%). */
|
|
1247
953
|
tax_rate?: string | number;
|
|
954
|
+
/** Reviewed presentation policy; `gross_required` markets show inclusive
|
|
955
|
+
* prices even when the tax arithmetic is exclusive. */
|
|
956
|
+
price_display_mode?: TaxPriceDisplayMode;
|
|
1248
957
|
/** Deposit due now when the cart has deposit-eligible service items, so the
|
|
1249
958
|
* checkout can offer "pay deposit now, balance later". Absent/0 otherwise. */
|
|
1250
959
|
deposit_required?: boolean;
|
|
@@ -1380,6 +1089,19 @@ type CheckoutOrderType = (typeof ORDER_TYPE)[keyof typeof ORDER_TYPE];
|
|
|
1380
1089
|
type CheckoutPaymentMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
1381
1090
|
type CheckoutStep = (typeof CHECKOUT_STEP)[keyof typeof CHECKOUT_STEP];
|
|
1382
1091
|
type PickupTimeType = (typeof PICKUP_TIME_TYPE)[keyof typeof PICKUP_TIME_TYPE];
|
|
1092
|
+
type CheckoutCollectionMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
|
|
1093
|
+
/** Storefront-safe collection capability. Provider and route identities stay server-side. */
|
|
1094
|
+
type CheckoutCollectionOption = {
|
|
1095
|
+
method: typeof PAYMENT_METHOD.CARD;
|
|
1096
|
+
network: null;
|
|
1097
|
+
} | {
|
|
1098
|
+
method: typeof PAYMENT_METHOD.MOBILE_MONEY;
|
|
1099
|
+
network: string;
|
|
1100
|
+
};
|
|
1101
|
+
interface CheckoutCollectionOptions {
|
|
1102
|
+
presentment_currency: CurrencyCode;
|
|
1103
|
+
options: CheckoutCollectionOption[];
|
|
1104
|
+
}
|
|
1383
1105
|
interface PickupTime {
|
|
1384
1106
|
type: PickupTimeType;
|
|
1385
1107
|
scheduled_time?: string;
|
|
@@ -1463,6 +1185,8 @@ interface CheckoutResult {
|
|
|
1463
1185
|
order_id: string;
|
|
1464
1186
|
order_number: string;
|
|
1465
1187
|
bill_token?: string;
|
|
1188
|
+
/** Tenant-scoped Cimplify payment id used for payment mutations. */
|
|
1189
|
+
payment_id?: string;
|
|
1466
1190
|
payment_reference?: string;
|
|
1467
1191
|
payment_status: string;
|
|
1468
1192
|
requires_authorization: boolean;
|
|
@@ -1485,7 +1209,7 @@ interface CheckoutResult {
|
|
|
1485
1209
|
type CheckoutStatus = "preparing" | "recovering" | "processing" | "awaiting_authorization" | "polling" | "finalizing" | "success" | "failed";
|
|
1486
1210
|
interface CheckoutStatusContext {
|
|
1487
1211
|
display_text?: string;
|
|
1488
|
-
authorization_type?:
|
|
1212
|
+
authorization_type?: PaymentAuthorizationKind;
|
|
1489
1213
|
poll_attempt?: number;
|
|
1490
1214
|
max_poll_attempts?: number;
|
|
1491
1215
|
order_id?: string;
|
|
@@ -1528,7 +1252,12 @@ interface ProcessAndResolveOptions {
|
|
|
1528
1252
|
poll_interval_ms?: number;
|
|
1529
1253
|
max_poll_attempts?: number;
|
|
1530
1254
|
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
1531
|
-
|
|
1255
|
+
/**
|
|
1256
|
+
* Reports the lifetime of provider-owned authorization UI. Hosts with their
|
|
1257
|
+
* own modal focus boundary can suspend it while the provider surface is open.
|
|
1258
|
+
*/
|
|
1259
|
+
on_authorization_ui_change?: (open: boolean) => void;
|
|
1260
|
+
on_authorization_required?: (type: PaymentAuthorizationKind, submit: (authorization: PaymentAuthorizationSubmission) => Promise<void>) => void | Promise<void>;
|
|
1532
1261
|
return_url?: string;
|
|
1533
1262
|
signal?: AbortSignal;
|
|
1534
1263
|
}
|
|
@@ -1536,11 +1265,68 @@ type AbortablePromise<T> = Promise<T> & {
|
|
|
1536
1265
|
abort: () => void;
|
|
1537
1266
|
};
|
|
1538
1267
|
|
|
1268
|
+
type CardPopupAction = Extract<NextAction, {
|
|
1269
|
+
type: "card_popup";
|
|
1270
|
+
}>;
|
|
1271
|
+
interface PaymentAuthorizationContext {
|
|
1272
|
+
action: CardPopupAction;
|
|
1273
|
+
email: string;
|
|
1274
|
+
currency: CurrencyCode;
|
|
1275
|
+
reference?: string;
|
|
1276
|
+
returnUrl?: string;
|
|
1277
|
+
signal?: AbortSignal;
|
|
1278
|
+
}
|
|
1279
|
+
type AuthorizeCardPopupOptions = Omit<PaymentAuthorizationContext, "action">;
|
|
1280
|
+
/**
|
|
1281
|
+
* Provider UI completed or handed control to a provider. This is deliberately
|
|
1282
|
+
* not named "success": only the Cimplify payment-status endpoint can establish
|
|
1283
|
+
* that money was collected.
|
|
1284
|
+
*/
|
|
1285
|
+
type PaymentAuthorizationOutcome = {
|
|
1286
|
+
status: "submitted";
|
|
1287
|
+
reference?: string;
|
|
1288
|
+
} | {
|
|
1289
|
+
status: "cancelled";
|
|
1290
|
+
} | {
|
|
1291
|
+
status: "failed";
|
|
1292
|
+
code: "POPUP_BLOCKED" | "PROVIDER_UNAVAILABLE" | "AUTHORIZATION_FAILED" | "PAYMENT_FAILED";
|
|
1293
|
+
message: string;
|
|
1294
|
+
recoverable: boolean;
|
|
1295
|
+
};
|
|
1296
|
+
/** Provider-specific browser UI for one `card_popup` action. */
|
|
1297
|
+
interface PaymentAuthorizationAdapter {
|
|
1298
|
+
readonly provider: string;
|
|
1299
|
+
authorize(context: PaymentAuthorizationContext): Promise<PaymentAuthorizationOutcome>;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Per-client adapter registry. It contains no process-global state, so tests,
|
|
1304
|
+
* storefronts, and concurrently-rendered tenants cannot affect each other.
|
|
1305
|
+
*/
|
|
1306
|
+
declare class PaymentAuthorizationAdapterRegistry {
|
|
1307
|
+
private readonly adapters;
|
|
1308
|
+
constructor(adapters?: Iterable<PaymentAuthorizationAdapter>);
|
|
1309
|
+
register(adapter: PaymentAuthorizationAdapter): this;
|
|
1310
|
+
unregister(provider: string): boolean;
|
|
1311
|
+
get(provider: string): PaymentAuthorizationAdapter | undefined;
|
|
1312
|
+
supports(provider: string): boolean;
|
|
1313
|
+
providers(): string[];
|
|
1314
|
+
authorize(action: CardPopupAction, options: AuthorizeCardPopupOptions): Promise<PaymentAuthorizationOutcome>;
|
|
1315
|
+
}
|
|
1316
|
+
declare function createDefaultPaymentAuthorizationAdapterRegistry(): PaymentAuthorizationAdapterRegistry;
|
|
1317
|
+
|
|
1539
1318
|
declare class CheckoutService {
|
|
1540
1319
|
private client;
|
|
1541
1320
|
constructor(client: CimplifyClient);
|
|
1542
1321
|
private validateCheckoutData;
|
|
1543
1322
|
private orderTokenParam;
|
|
1323
|
+
/** Available storefront collection methods for one presentment currency. */
|
|
1324
|
+
collectionOptions(currency: CurrencyCode): Promise<Result<CheckoutCollectionOptions, CimplifyError>>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Run provider-owned UI for a backend `card_popup` action. A submitted
|
|
1327
|
+
* outcome is not proof of payment; callers must poll/verify with Cimplify.
|
|
1328
|
+
*/
|
|
1329
|
+
authorizeCardPopup(action: CardPopupAction, options: AuthorizeCardPopupOptions): Promise<PaymentAuthorizationOutcome>;
|
|
1544
1330
|
process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
1545
1331
|
initializePayment(_orderId: string, _method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
|
|
1546
1332
|
submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
@@ -2873,6 +2659,12 @@ interface CimplifyConfig {
|
|
|
2873
2659
|
fetch?: typeof fetch;
|
|
2874
2660
|
/** Auto-record page views in the browser. Default true; false to gate on consent. */
|
|
2875
2661
|
trackPageViews?: boolean;
|
|
2662
|
+
/**
|
|
2663
|
+
* Per-client card-authorization adapters. Omit for the built-in lazy
|
|
2664
|
+
* Paystack and Stripe adapters; inject a registry to override or extend
|
|
2665
|
+
* provider UI without mutating process-global state.
|
|
2666
|
+
*/
|
|
2667
|
+
authorizationAdapterRegistry?: PaymentAuthorizationAdapterRegistry;
|
|
2876
2668
|
}
|
|
2877
2669
|
declare class CimplifyClient {
|
|
2878
2670
|
private baseUrl;
|
|
@@ -2890,6 +2682,8 @@ declare class CimplifyClient {
|
|
|
2890
2682
|
private context;
|
|
2891
2683
|
private businessId;
|
|
2892
2684
|
private businessIdResolvePromise;
|
|
2685
|
+
private publicKeyEpoch;
|
|
2686
|
+
readonly authorizationAdapters: PaymentAuthorizationAdapterRegistry;
|
|
2893
2687
|
private inflightRequests;
|
|
2894
2688
|
/**
|
|
2895
2689
|
* App-level event channel. Subscribe to surface mutation rollbacks, outbox
|
|
@@ -3006,4 +2800,4 @@ declare class CimplifyClient {
|
|
|
3006
2800
|
}
|
|
3007
2801
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
3008
2802
|
|
|
3009
|
-
export { type
|
|
2803
|
+
export { type CheckoutCollectionOption as $, type AbortablePromise as A, type Booking as B, type CacheOptions as C, type CancelBookingInput as D, type CancelBookingResult as E, type CancelOrderInput as F, type CancellationPolicy as G, type CardPopupAction as H, CartOperations as I, CatalogueQueries as J, type CatalogueResult as K, type CatalogueSnapshot as L, type CategoryInfo as M, type ChatAttachment as N, type ChatConversation as O, type ChatConversationResponse as P, type ChatMessage as Q, type ChatReplyCard as R, type ChatReplyContext as S, type ChatUploadAttachment as T, type ChatWidgetStarter as U, type CheckSlotAvailabilityInput as V, type CheckSlotAvailabilityResult as W, type CheckoutAddressInfo as X, type CheckoutCartData as Y, type CheckoutCartItem as Z, type CheckoutCollectionMethod as _, type ActivityRecommendation as a, type GetDeliveryOptionsParams as a$, type CheckoutCollectionOptions as a0, type CheckoutCustomerInfo as a1, type CheckoutFormData as a2, type CheckoutInput as a3, type CheckoutMode as a4, type CheckoutOrderType as a5, type CheckoutPaymentMethod as a6, type CheckoutResult as a7, CheckoutService as a8, type CheckoutStatus as a9, type ElementEventHandler as aA, type ElementEventType as aB, type ElementOptions as aC, type ElementType as aD, type ElementsAuthContactType as aE, type ElementsAuthMode as aF, type ElementsAuthOptions as aG, type ElementsAuthPrompt as aH, type ElementsCheckoutData as aI, type ElementsCheckoutResult as aJ, type ElementsCustomerInfo as aK, type ElementsOptions as aL, type EnrichedOrder as aM, type EnrichedOrderItem as aN, type Err as aO, type FeeBearerType as aP, type FetchQuoteInput as aQ, type FulfillmentLink as aR, type FulfillmentStatus as aS, type FulfillmentSummaryDTO as aT, type FulfillmentType as aU, type FxQuote as aV, type FxQuoteRequest as aW, type FxQuoteStatus as aX, type FxRateResponse as aY, FxService as aZ, type GetAvailableSlotsInput as a_, type CheckoutStatusContext as aa, type CheckoutStep as ab, CimplifyClient as ac, type CimplifyConfig as ad, CimplifyElement as ae, CimplifyElements as af, type ClaimConversationResult as ag, type ContentType as ah, type CustomerBooking as ai, type CustomerBookingServiceItem as aj, type CustomerServicePreferences as ak, type DayAvailability as al, type DeliveryFeeDetails as am, type DeliveryFeeResponse as an, type DeliveryOption as ao, type DeliveryOptionsQuery as ap, type DeliveryOptionsResponse as aq, DeliveryService as ar, type DepositResult as as, type DismissMessageResponse as at, ELEMENTS_AUTH_CONTACT_TYPES as au, ELEMENTS_AUTH_MODES as av, ELEMENTS_AUTH_PROMPTS as aw, ELEMENT_TYPES as ax, EVENT_TYPES as ay, type ElementAppearance as az, type ActivityRecommendationsResponse as b, PlacesService as b$, type GetOrdersOptions as b0, type GetProductsOptions as b1, type GroupOrderInfo as b2, type IframeToParentMessage as b3, InventoryService as b4, type LifecyclePhase as b5, type LineItem as b6, type LineType as b7, LinkService as b8, type LiteBootstrap as b9, type OrderHistory as bA, type OrderLineState as bB, type OrderLineStatus as bC, type OrderLocationInfo as bD, type OrderPaymentEvent as bE, type OrderPricingView as bF, OrderQueries as bG, type OrderSplitDetail as bH, type OrderStaffInfo as bI, type OrderStatus as bJ, type OrderTimestampsDTO as bK, type OrderType as bL, type Origin as bM, type OriginActor as bN, type OriginChannel as bO, type OtpResult as bP, type ParentToIframeMessage as bQ, type PaymentAuthorizationAdapter as bR, PaymentAuthorizationAdapterRegistry as bS, type PaymentAuthorizationContext as bT, type PaymentAuthorizationOutcome as bU, type PaymentInfoDTO as bV, type PaymentMethodInfo as bW, type PaymentState as bX, type PickupTime as bY, type PickupTimeType as bZ, type PlaceDetailsResponse as b_, type LiteDayHours as ba, type LiteHoursRange as bb, LiteService as bc, type Location as bd, type LocationBooking as be, type LocationTaxBehavior as bf, type LocationTaxOverrides as bg, type LocationTimeProfile as bh, type LocationWithDetails as bi, MESSAGE_TYPES as bj, type MobileMoneyDetails as bk, type NextAction as bl, type ObservabilityHooks as bm, type Ok as bn, type Order as bo, type OrderCustomerInfo as bp, type OrderDiscountInfo as bq, type OrderFilter as br, type OrderFulfillmentSummary as bs, type OrderGroup as bt, type OrderGroupDetails as bu, type OrderGroupPayment as bv, type OrderGroupPaymentState as bw, type OrderGroupPaymentStatus as bx, type OrderGroupPaymentSummary as by, type OrderGroupStatus as bz, ActivityService as c, type Table as c$, type PriceQuote as c0, type PricingOverrides as c1, type ProcessAndResolveOptions as c2, type ProcessCheckoutOptions as c3, type ProcessCheckoutResult as c4, type ProviderResolutionSource as c5, type QuoteBundleSelectionInput as c6, type QuoteCompositeSelectionInput as c7, type QuoteDynamicBuckets as c8, type QuoteStatus as c9, type SchedulingMetadata as cA, type SchedulingResult as cB, SchedulingService as cC, type SenderType as cD, type Service as cE, type ServiceAvailabilityParams as cF, type ServiceAvailabilityResult as cG, type ServiceCharge as cH, type ServiceNotes as cI, type ServiceScheduleRequest as cJ, type ServiceStatus as cK, type SessionActivityData as cL, type SessionChangeEvent as cM, type SessionMessage as cN, type SlotResourceInfo as cO, type SlotStaffInfo as cP, type Staff as cQ, type StaffAssignment as cR, type StaffRole as cS, type StaffScheduleItem as cT, type StockLevel as cU, type StockStatus as cV, type StoreCreditBalance as cW, StoreCreditQueries as cX, type StorefrontBootstrap as cY, SubscriptionService as cZ, SupportService as c_, type QuoteUiMessage as ca, type ReadRequestOptions as cb, type RefreshQuoteInput as cc, type RefreshQuoteResult as cd, type RefundOrderInput as ce, type RelatedCandidate as cf, type RelatedProduct as cg, type RelatedProductsEnrichment as ch, type RelationType as ci, type ReminderMethod as cj, type ReminderSettings as ck, type ReorderResult as cl, type RequestContext as cm, type RequestErrorEvent as cn, type RequestOptions as co, type RequestSource as cp, type RequestStartEvent as cq, type RequestSuccessEvent as cr, type RescheduleBookingInput as cs, type RescheduleBookingResult as ct, type RescheduleHistoryRecord as cu, type ResourceAssignment as cv, type ResourceInfo as cw, type Result as cx, type RetryEvent as cy, type Room as cz, type ActivityStateResponse as d, type TimeRange as d0, type TimeRanges as d1, type TimeSlot as d2, type TrackCategoryViewOptions as d3, type TrackProductViewOptions as d4, type UpdateOrderStatusInput as d5, type UpdateProfileInput as d6, type UploadInitResponse as d7, type UploadResult as d8, UploadService as d9, combine as da, combineObject as db, createCimplifyClient as dc, createDefaultPaymentAuthorizationAdapterRegistry as dd, createElements as de, err as df, flatMap as dg, fromPromise as dh, getOrElse as di, isErr as dj, isOk as dk, mapError as dl, mapResult as dm, ok as dn, toNullable as dp, tryCatch as dq, unwrap as dr, type AddressInfo as e, type AmountToPay as f, AuthService as g, type AuthStatus as h, type AuthenticatedCustomer as i, type AuthenticatedData as j, type AuthorizeCardPopupOptions as k, type AutocompletePrediction as l, type AutocompleteResponse as m, type AvailabilityResult as n, type AvailableSlot as o, type BookingModificationType as p, type BookingStatus as q, type BookingWithDetails as r, type BufferTimes as s, type Business as t, type BusinessDetailsDTO as u, type BusinessHours as v, type BusinessPreferences as w, BusinessService as x, type BusinessSettings as y, type BusinessWithLocations as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AppHandle, C as CreateAppOptions } from './server-
|
|
1
|
+
import { ac as CimplifyClient } from './client-BfpNjJ_a.mjs';
|
|
2
|
+
import { A as AppHandle, C as CreateAppOptions } from './server-C7FyLdrz.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test client + fixtures.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AppHandle, C as CreateAppOptions } from './server-
|
|
1
|
+
import { ac as CimplifyClient } from './client-DHBwvh7U.js';
|
|
2
|
+
import { A as AppHandle, C as CreateAppOptions } from './server-DoXIpSd7.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test client + fixtures.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as ProductWithPrice } from './price-
|
|
3
|
-
import {
|
|
1
|
+
import { aU as Money, af as CurrencyCode, bc as PricePathTaxInfo, be as Product, bs as ProductWithDetails, bv as QuantityPricingTier, a$ as PaymentErrorDetails, b4 as PaymentResponse, b6 as PaymentStatusResponse } from './payment-H5LoIvXU.js';
|
|
2
|
+
import { P as ProductWithPrice } from './price-C2RqscMY.js';
|
|
3
|
+
import { z as MobileMoneyProvider } from './link-cuNVYc2s.js';
|
|
4
4
|
import { CountryCode } from 'libphonenumber-js';
|
|
5
5
|
|
|
6
6
|
declare const CURRENCY_SYMBOLS: Record<string, string>;
|
|
@@ -40,6 +40,7 @@ declare function formatPriceRange(min: number, max: number, currency?: CurrencyC
|
|
|
40
40
|
|
|
41
41
|
declare function categorizePaymentError(error: Error, errorCode?: string): PaymentErrorDetails;
|
|
42
42
|
declare function normalizePaymentResponse(response: unknown): PaymentResponse;
|
|
43
|
+
declare const PAYMENT_TERMINAL_FAILURE_STATUSES: readonly ["failed", "cancelled", "voided", "abandoned", "refunded", "refund_pending", "reversed", "disputed"];
|
|
43
44
|
declare function isPaymentStatusSuccess(status: string | undefined): boolean;
|
|
44
45
|
declare function isPaymentStatusFailure(status: string | undefined): boolean;
|
|
45
46
|
declare function isPaymentStatusRequiresAction(status: string | undefined): boolean;
|
|
@@ -58,6 +59,15 @@ declare const MOBILE_MONEY_PROVIDERS: {
|
|
|
58
59
|
readonly prefix: readonly ["026", "027", "056", "057"];
|
|
59
60
|
};
|
|
60
61
|
};
|
|
62
|
+
type CanonicalMobileMoneyProvider = Extract<MobileMoneyProvider, "mtn" | "telecel" | "airteltigo" | "mpesa">;
|
|
63
|
+
/** Normalize route-catalog and legacy network aliases to storefront provider codes. */
|
|
64
|
+
declare function canonicalMobileMoneyProvider(provider: string | null | undefined): CanonicalMobileMoneyProvider | null;
|
|
65
|
+
/**
|
|
66
|
+
* Validate an external payment-authorization URL before browser navigation.
|
|
67
|
+
* Provider payloads are data, not executable navigation instructions: only
|
|
68
|
+
* HTTPS is accepted outside local development.
|
|
69
|
+
*/
|
|
70
|
+
declare function paymentAuthorizationUrl(value: unknown): string | null;
|
|
61
71
|
declare function detectMobileMoneyProvider(phoneNumber: string): "mtn" | "vodafone" | "airtel" | null;
|
|
62
72
|
|
|
63
73
|
interface PhoneNormalizationOptions {
|
|
@@ -68,4 +78,4 @@ declare function resolvePhoneCountryCode(options?: PhoneNormalizationOptions): C
|
|
|
68
78
|
declare function normalizePhoneToE164(raw: string, options?: PhoneNormalizationOptions): string | null;
|
|
69
79
|
declare function isValidPhoneForContext(raw: string, options?: PhoneNormalizationOptions): boolean;
|
|
70
80
|
|
|
71
|
-
export {
|
|
81
|
+
export { isTaxInclusive as A, isValidPhoneForContext as B, CURRENCY_SYMBOLS as C, normalizePaymentResponse as D, normalizePhoneToE164 as E, normalizeStatusResponse as F, parsePrice as G, paymentAuthorizationUrl as H, resolvePhoneCountryCode as I, MOBILE_MONEY_PROVIDERS as M, PAYMENT_TERMINAL_FAILURE_STATUSES as P, type CanonicalMobileMoneyProvider as a, categorizePaymentError as b, canonicalMobileMoneyProvider as c, detectMobileMoneyProvider as d, formatNumberCompact as e, formatMoney as f, formatPrice as g, formatPriceAdjustment as h, formatPriceCompact as i, formatPriceRange as j, formatPriceWithTax as k, formatProductPrice as l, getBasePrice as m, getCurrencySymbol as n, getDiscountPercentage as o, getDisplayPrice as p, getMarkupPercentage as q, getPriceRange as r, getProductCurrency as s, getTaxAmount as t, getUnitPriceAtQuantity as u, hasTaxInfo as v, isOnSale as w, isPaymentStatusFailure as x, isPaymentStatusRequiresAction as y, isPaymentStatusSuccess as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as ProductWithPrice } from './price-
|
|
3
|
-
import {
|
|
1
|
+
import { aU as Money, af as CurrencyCode, bc as PricePathTaxInfo, be as Product, bs as ProductWithDetails, bv as QuantityPricingTier, a$ as PaymentErrorDetails, b4 as PaymentResponse, b6 as PaymentStatusResponse } from './payment-H5LoIvXU.mjs';
|
|
2
|
+
import { P as ProductWithPrice } from './price-BvePgDXe.mjs';
|
|
3
|
+
import { z as MobileMoneyProvider } from './link-cuNVYc2s.mjs';
|
|
4
4
|
import { CountryCode } from 'libphonenumber-js';
|
|
5
5
|
|
|
6
6
|
declare const CURRENCY_SYMBOLS: Record<string, string>;
|
|
@@ -40,6 +40,7 @@ declare function formatPriceRange(min: number, max: number, currency?: CurrencyC
|
|
|
40
40
|
|
|
41
41
|
declare function categorizePaymentError(error: Error, errorCode?: string): PaymentErrorDetails;
|
|
42
42
|
declare function normalizePaymentResponse(response: unknown): PaymentResponse;
|
|
43
|
+
declare const PAYMENT_TERMINAL_FAILURE_STATUSES: readonly ["failed", "cancelled", "voided", "abandoned", "refunded", "refund_pending", "reversed", "disputed"];
|
|
43
44
|
declare function isPaymentStatusSuccess(status: string | undefined): boolean;
|
|
44
45
|
declare function isPaymentStatusFailure(status: string | undefined): boolean;
|
|
45
46
|
declare function isPaymentStatusRequiresAction(status: string | undefined): boolean;
|
|
@@ -58,6 +59,15 @@ declare const MOBILE_MONEY_PROVIDERS: {
|
|
|
58
59
|
readonly prefix: readonly ["026", "027", "056", "057"];
|
|
59
60
|
};
|
|
60
61
|
};
|
|
62
|
+
type CanonicalMobileMoneyProvider = Extract<MobileMoneyProvider, "mtn" | "telecel" | "airteltigo" | "mpesa">;
|
|
63
|
+
/** Normalize route-catalog and legacy network aliases to storefront provider codes. */
|
|
64
|
+
declare function canonicalMobileMoneyProvider(provider: string | null | undefined): CanonicalMobileMoneyProvider | null;
|
|
65
|
+
/**
|
|
66
|
+
* Validate an external payment-authorization URL before browser navigation.
|
|
67
|
+
* Provider payloads are data, not executable navigation instructions: only
|
|
68
|
+
* HTTPS is accepted outside local development.
|
|
69
|
+
*/
|
|
70
|
+
declare function paymentAuthorizationUrl(value: unknown): string | null;
|
|
61
71
|
declare function detectMobileMoneyProvider(phoneNumber: string): "mtn" | "vodafone" | "airtel" | null;
|
|
62
72
|
|
|
63
73
|
interface PhoneNormalizationOptions {
|
|
@@ -68,4 +78,4 @@ declare function resolvePhoneCountryCode(options?: PhoneNormalizationOptions): C
|
|
|
68
78
|
declare function normalizePhoneToE164(raw: string, options?: PhoneNormalizationOptions): string | null;
|
|
69
79
|
declare function isValidPhoneForContext(raw: string, options?: PhoneNormalizationOptions): boolean;
|
|
70
80
|
|
|
71
|
-
export {
|
|
81
|
+
export { isTaxInclusive as A, isValidPhoneForContext as B, CURRENCY_SYMBOLS as C, normalizePaymentResponse as D, normalizePhoneToE164 as E, normalizeStatusResponse as F, parsePrice as G, paymentAuthorizationUrl as H, resolvePhoneCountryCode as I, MOBILE_MONEY_PROVIDERS as M, PAYMENT_TERMINAL_FAILURE_STATUSES as P, type CanonicalMobileMoneyProvider as a, categorizePaymentError as b, canonicalMobileMoneyProvider as c, detectMobileMoneyProvider as d, formatNumberCompact as e, formatMoney as f, formatPrice as g, formatPriceAdjustment as h, formatPriceCompact as i, formatPriceRange as j, formatPriceWithTax as k, formatProductPrice as l, getBasePrice as m, getCurrencySymbol as n, getDiscountPercentage as o, getDisplayPrice as p, getMarkupPercentage as q, getPriceRange as r, getProductCurrency as s, getTaxAmount as t, getUnitPriceAtQuantity as u, hasTaxInfo as v, isOnSale as w, isPaymentStatusFailure as x, isPaymentStatusRequiresAction as y, isPaymentStatusSuccess as z };
|