@cimplify/sdk 0.6.1 → 0.6.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/{ads-DRfobDQ9.d.mts → ads-Cz14AMnc.d.mts} +119 -3
- package/dist/{ads-DRfobDQ9.d.ts → ads-Cz14AMnc.d.ts} +119 -3
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1908 -903
- package/dist/index.mjs +1906 -904
- package/dist/react.d.mts +30 -3
- package/dist/react.d.ts +30 -3
- package/dist/react.js +215 -1
- package/dist/react.mjs +217 -4
- package/package.json +5 -1
|
@@ -1775,7 +1775,7 @@ interface LocationAppointment {
|
|
|
1775
1775
|
service_status: ServiceStatus;
|
|
1776
1776
|
}
|
|
1777
1777
|
|
|
1778
|
-
type PaymentStatus = "pending" | "processing" | "success" | "failed" | "refunded" | "captured" | "cancelled";
|
|
1778
|
+
type PaymentStatus = "pending" | "processing" | "created" | "pending_confirmation" | "success" | "succeeded" | "failed" | "declined" | "authorized" | "refunded" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_action" | "requires_payment_method" | "requires_capture" | "captured" | "cancelled" | "completed" | "voided" | "error" | "unknown";
|
|
1779
1779
|
type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
|
|
1780
1780
|
type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
|
|
1781
1781
|
/** Authorization types for payment verification (OTP, PIN, etc.) */
|
|
@@ -1832,7 +1832,7 @@ interface PaymentResponse {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
/** Payment status polling response */
|
|
1834
1834
|
interface PaymentStatusResponse {
|
|
1835
|
-
status:
|
|
1835
|
+
status: PaymentStatus;
|
|
1836
1836
|
paid: boolean;
|
|
1837
1837
|
amount?: Money;
|
|
1838
1838
|
currency?: string;
|
|
@@ -2195,6 +2195,56 @@ interface CheckoutResult {
|
|
|
2195
2195
|
quote_id: string;
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
+
type CheckoutStatus = "preparing" | "recovering" | "processing" | "awaiting_authorization" | "polling" | "finalizing" | "success" | "failed";
|
|
2199
|
+
interface CheckoutStatusContext {
|
|
2200
|
+
display_text?: string;
|
|
2201
|
+
authorization_type?: "otp" | "pin";
|
|
2202
|
+
poll_attempt?: number;
|
|
2203
|
+
max_poll_attempts?: number;
|
|
2204
|
+
order_id?: string;
|
|
2205
|
+
order_number?: string;
|
|
2206
|
+
provider?: string;
|
|
2207
|
+
}
|
|
2208
|
+
interface ProcessCheckoutOptions {
|
|
2209
|
+
cart_id: string;
|
|
2210
|
+
order_type: "delivery" | "pickup" | "dine_in";
|
|
2211
|
+
location_id?: string;
|
|
2212
|
+
notes?: string;
|
|
2213
|
+
scheduled_time?: string;
|
|
2214
|
+
tip_amount?: number;
|
|
2215
|
+
enroll_in_link?: boolean;
|
|
2216
|
+
pay_currency?: string;
|
|
2217
|
+
timeout_ms?: number;
|
|
2218
|
+
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
2219
|
+
}
|
|
2220
|
+
interface ProcessCheckoutResult {
|
|
2221
|
+
success: boolean;
|
|
2222
|
+
order?: {
|
|
2223
|
+
id: string;
|
|
2224
|
+
order_number: string;
|
|
2225
|
+
status: string;
|
|
2226
|
+
total: string;
|
|
2227
|
+
currency: string;
|
|
2228
|
+
};
|
|
2229
|
+
error?: {
|
|
2230
|
+
code: string;
|
|
2231
|
+
message: string;
|
|
2232
|
+
recoverable: boolean;
|
|
2233
|
+
};
|
|
2234
|
+
enrolled_in_link?: boolean;
|
|
2235
|
+
}
|
|
2236
|
+
interface ProcessAndResolveOptions {
|
|
2237
|
+
enroll_in_link?: boolean;
|
|
2238
|
+
poll_interval_ms?: number;
|
|
2239
|
+
max_poll_attempts?: number;
|
|
2240
|
+
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
2241
|
+
on_authorization_required?: (type: "otp" | "pin", submit: (code: string) => Promise<void>) => void | Promise<void>;
|
|
2242
|
+
return_url?: string;
|
|
2243
|
+
signal?: AbortSignal;
|
|
2244
|
+
}
|
|
2245
|
+
type AbortablePromise<T> = Promise<T> & {
|
|
2246
|
+
abort: () => void;
|
|
2247
|
+
};
|
|
2198
2248
|
|
|
2199
2249
|
declare function generateIdempotencyKey(): string;
|
|
2200
2250
|
declare class CheckoutService {
|
|
@@ -2206,6 +2256,7 @@ declare class CheckoutService {
|
|
|
2206
2256
|
pollPaymentStatus(orderId: string): Promise<Result<PaymentStatusResponse, CimplifyError>>;
|
|
2207
2257
|
updateOrderCustomer(orderId: string, customer: CheckoutCustomerInfo): Promise<Result<Order, CimplifyError>>;
|
|
2208
2258
|
verifyPayment(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
2259
|
+
processAndResolve(data: CheckoutFormData & ProcessAndResolveOptions): Promise<Result<ProcessCheckoutResult, CimplifyError>>;
|
|
2209
2260
|
}
|
|
2210
2261
|
|
|
2211
2262
|
interface GetOrdersOptions {
|
|
@@ -3028,6 +3079,8 @@ declare const MESSAGE_TYPES: {
|
|
|
3028
3079
|
readonly GET_DATA: "get_data";
|
|
3029
3080
|
readonly REFRESH_TOKEN: "refresh_token";
|
|
3030
3081
|
readonly LOGOUT: "logout";
|
|
3082
|
+
readonly PROCESS_CHECKOUT: "process_checkout";
|
|
3083
|
+
readonly ABORT_CHECKOUT: "abort_checkout";
|
|
3031
3084
|
readonly READY: "ready";
|
|
3032
3085
|
readonly HEIGHT_CHANGE: "height_change";
|
|
3033
3086
|
readonly AUTHENTICATED: "authenticated";
|
|
@@ -3038,6 +3091,8 @@ declare const MESSAGE_TYPES: {
|
|
|
3038
3091
|
readonly PAYMENT_METHOD_SELECTED: "payment_method_selected";
|
|
3039
3092
|
readonly TOKEN_REFRESHED: "token_refreshed";
|
|
3040
3093
|
readonly LOGOUT_COMPLETE: "logout_complete";
|
|
3094
|
+
readonly CHECKOUT_STATUS: "checkout_status";
|
|
3095
|
+
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
3041
3096
|
};
|
|
3042
3097
|
interface ElementsOptions {
|
|
3043
3098
|
linkUrl?: string;
|
|
@@ -3076,10 +3131,21 @@ interface PaymentMethodInfo {
|
|
|
3076
3131
|
phone_number?: string;
|
|
3077
3132
|
label?: string;
|
|
3078
3133
|
}
|
|
3134
|
+
interface AuthenticatedCustomer {
|
|
3135
|
+
name: string;
|
|
3136
|
+
email: string | null;
|
|
3137
|
+
phone: string | null;
|
|
3138
|
+
}
|
|
3139
|
+
type ElementsCustomerInfo = {
|
|
3140
|
+
name: string;
|
|
3141
|
+
email: string | null;
|
|
3142
|
+
phone: string | null;
|
|
3143
|
+
} | null;
|
|
3079
3144
|
interface AuthenticatedData {
|
|
3080
3145
|
accountId: string;
|
|
3081
3146
|
customerId: string;
|
|
3082
3147
|
token: string;
|
|
3148
|
+
customer: AuthenticatedCustomer;
|
|
3083
3149
|
}
|
|
3084
3150
|
interface ElementsCheckoutData {
|
|
3085
3151
|
cart_id: string;
|
|
@@ -3104,7 +3170,10 @@ interface ElementsCheckoutResult {
|
|
|
3104
3170
|
type ParentToIframeMessage = {
|
|
3105
3171
|
type: typeof MESSAGE_TYPES.INIT;
|
|
3106
3172
|
businessId: string;
|
|
3173
|
+
publicKey: string;
|
|
3174
|
+
demoMode?: boolean;
|
|
3107
3175
|
prefillEmail?: string;
|
|
3176
|
+
appearance?: ElementAppearance;
|
|
3108
3177
|
} | {
|
|
3109
3178
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
3110
3179
|
token: string;
|
|
@@ -3114,6 +3183,22 @@ type ParentToIframeMessage = {
|
|
|
3114
3183
|
type: typeof MESSAGE_TYPES.REFRESH_TOKEN;
|
|
3115
3184
|
} | {
|
|
3116
3185
|
type: typeof MESSAGE_TYPES.LOGOUT;
|
|
3186
|
+
} | {
|
|
3187
|
+
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
3188
|
+
cart_id: string;
|
|
3189
|
+
order_type: "delivery" | "pickup" | "dine_in";
|
|
3190
|
+
location_id?: string;
|
|
3191
|
+
notes?: string;
|
|
3192
|
+
scheduled_time?: string;
|
|
3193
|
+
tip_amount?: number;
|
|
3194
|
+
pay_currency?: string;
|
|
3195
|
+
enroll_in_link?: boolean;
|
|
3196
|
+
address?: AddressInfo;
|
|
3197
|
+
customer: ElementsCustomerInfo;
|
|
3198
|
+
account_id?: string;
|
|
3199
|
+
customer_id?: string;
|
|
3200
|
+
} | {
|
|
3201
|
+
type: typeof MESSAGE_TYPES.ABORT_CHECKOUT;
|
|
3117
3202
|
};
|
|
3118
3203
|
type IframeToParentMessage = {
|
|
3119
3204
|
type: typeof MESSAGE_TYPES.READY;
|
|
@@ -3126,6 +3211,7 @@ type IframeToParentMessage = {
|
|
|
3126
3211
|
accountId: string;
|
|
3127
3212
|
customerId: string;
|
|
3128
3213
|
token: string;
|
|
3214
|
+
customer: AuthenticatedCustomer;
|
|
3129
3215
|
} | {
|
|
3130
3216
|
type: typeof MESSAGE_TYPES.REQUIRES_OTP;
|
|
3131
3217
|
contactMasked: string;
|
|
@@ -3149,6 +3235,26 @@ type IframeToParentMessage = {
|
|
|
3149
3235
|
token: string;
|
|
3150
3236
|
} | {
|
|
3151
3237
|
type: typeof MESSAGE_TYPES.LOGOUT_COMPLETE;
|
|
3238
|
+
} | {
|
|
3239
|
+
type: typeof MESSAGE_TYPES.CHECKOUT_STATUS;
|
|
3240
|
+
status: CheckoutStatus;
|
|
3241
|
+
context: CheckoutStatusContext;
|
|
3242
|
+
} | {
|
|
3243
|
+
type: typeof MESSAGE_TYPES.CHECKOUT_COMPLETE;
|
|
3244
|
+
success: boolean;
|
|
3245
|
+
order?: {
|
|
3246
|
+
id: string;
|
|
3247
|
+
order_number: string;
|
|
3248
|
+
status: string;
|
|
3249
|
+
total: string;
|
|
3250
|
+
currency: string;
|
|
3251
|
+
};
|
|
3252
|
+
error?: {
|
|
3253
|
+
code: string;
|
|
3254
|
+
message: string;
|
|
3255
|
+
recoverable: boolean;
|
|
3256
|
+
};
|
|
3257
|
+
enrolled_in_link?: boolean;
|
|
3152
3258
|
};
|
|
3153
3259
|
declare const EVENT_TYPES: {
|
|
3154
3260
|
readonly READY: "ready";
|
|
@@ -3171,16 +3277,23 @@ declare class CimplifyElements {
|
|
|
3171
3277
|
private accessToken;
|
|
3172
3278
|
private accountId;
|
|
3173
3279
|
private customerId;
|
|
3280
|
+
private customerData;
|
|
3174
3281
|
private addressData;
|
|
3175
3282
|
private paymentData;
|
|
3283
|
+
private checkoutInProgress;
|
|
3284
|
+
private activeCheckoutAbort;
|
|
3176
3285
|
private boundHandleMessage;
|
|
3177
3286
|
constructor(client: CimplifyClient, businessId: string, options?: ElementsOptions);
|
|
3178
3287
|
create(type: ElementType, options?: ElementOptions): CimplifyElement;
|
|
3179
3288
|
getElement(type: ElementType): CimplifyElement | undefined;
|
|
3180
3289
|
destroy(): void;
|
|
3181
3290
|
submitCheckout(data: ElementsCheckoutData): Promise<ElementsCheckoutResult>;
|
|
3291
|
+
processCheckout(options: ProcessCheckoutOptions): AbortablePromise<ProcessCheckoutResult>;
|
|
3182
3292
|
isAuthenticated(): boolean;
|
|
3183
3293
|
getAccessToken(): string | null;
|
|
3294
|
+
getPublicKey(): string;
|
|
3295
|
+
getAppearance(): ElementsOptions["appearance"];
|
|
3296
|
+
private hydrateCustomerData;
|
|
3184
3297
|
private handleMessage;
|
|
3185
3298
|
_setAddressData(data: AddressInfo): void;
|
|
3186
3299
|
_setPaymentData(data: PaymentMethodInfo): void;
|
|
@@ -3204,6 +3317,8 @@ declare class CimplifyElement {
|
|
|
3204
3317
|
off(event: ElementEventType, handler: ElementEventHandler): void;
|
|
3205
3318
|
getData(): Promise<unknown>;
|
|
3206
3319
|
sendMessage(message: ParentToIframeMessage): void;
|
|
3320
|
+
getContentWindow(): Window | null;
|
|
3321
|
+
isMounted(): boolean;
|
|
3207
3322
|
private createIframe;
|
|
3208
3323
|
private handleMessage;
|
|
3209
3324
|
private emit;
|
|
@@ -3252,6 +3367,7 @@ declare class CimplifyClient {
|
|
|
3252
3367
|
/** @deprecated Use setAccessToken() instead */
|
|
3253
3368
|
setSessionToken(token: string | null): void;
|
|
3254
3369
|
getAccessToken(): string | null;
|
|
3370
|
+
getPublicKey(): string;
|
|
3255
3371
|
setAccessToken(token: string | null): void;
|
|
3256
3372
|
clearSession(): void;
|
|
3257
3373
|
/** Set the active location/branch for all subsequent requests */
|
|
@@ -3322,4 +3438,4 @@ interface AdContextValue {
|
|
|
3322
3438
|
isLoading: boolean;
|
|
3323
3439
|
}
|
|
3324
3440
|
|
|
3325
|
-
export { type CheckoutFormData as $, type ApiError as A, BusinessService as B, CimplifyClient as C, createElements as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, ELEMENT_TYPES as H, InventoryService as I, type ElementsOptions as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type ElementOptions as N, OrderQueries as O, type PaymentErrorDetails as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ElementType as V, type ElementEventType as W, type CheckoutMode as X, type CheckoutOrderType as Y, type CheckoutPaymentMethod as Z, type CheckoutStep as _, type PaymentResponse as a, type
|
|
3441
|
+
export { type CheckoutFormData as $, type ApiError as A, BusinessService as B, CimplifyClient as C, createElements as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, ELEMENT_TYPES as H, InventoryService as I, type ElementsOptions as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type ElementOptions as N, OrderQueries as O, type PaymentErrorDetails as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ElementType as V, type ElementEventType as W, type CheckoutMode as X, type CheckoutOrderType as Y, type CheckoutPaymentMethod as Z, type CheckoutStep as _, type PaymentResponse as a, type VariantDisplayAttribute as a$, type CheckoutResult as a0, type ProcessCheckoutOptions as a1, type ProcessCheckoutResult as a2, type ProcessAndResolveOptions as a3, type CheckoutStatus as a4, type CheckoutStatusContext as a5, type AbortablePromise as a6, type MobileMoneyProvider as a7, type DeviceType as a8, type ContactType as a9, isRetryableError as aA, type Result as aB, type Ok as aC, type Err as aD, ok as aE, err as aF, isOk as aG, isErr as aH, mapResult as aI, mapError as aJ, flatMap as aK, getOrElse as aL, unwrap as aM, toNullable as aN, fromPromise as aO, tryCatch as aP, combine as aQ, combineObject as aR, type ProductType as aS, type InventoryType as aT, type VariantStrategy as aU, type DigitalProductType as aV, type DepositType as aW, type SalesChannel as aX, type Product as aY, type ProductWithDetails as aZ, type ProductVariant as a_, CHECKOUT_MODE as aa, ORDER_TYPE as ab, PAYMENT_METHOD as ac, CHECKOUT_STEP as ad, PAYMENT_STATE as ae, PICKUP_TIME_TYPE as af, MOBILE_MONEY_PROVIDER as ag, AUTHORIZATION_TYPE as ah, DEVICE_TYPE as ai, CONTACT_TYPE as aj, LINK_QUERY as ak, LINK_MUTATION as al, AUTH_MUTATION as am, CHECKOUT_MUTATION as an, PAYMENT_MUTATION as ao, ORDER_MUTATION as ap, DEFAULT_CURRENCY as aq, DEFAULT_COUNTRY as ar, type Money as as, type Currency as at, type PaginationParams as au, type Pagination as av, ErrorCode as aw, type ErrorCodeType as ax, CimplifyError as ay, isCimplifyError as az, type PaymentStatusResponse as b, type Cart as b$, type VariantAxis as b0, type VariantAxisWithValues as b1, type VariantAxisValue as b2, type ProductVariantValue as b3, type VariantLocationAvailability as b4, type VariantAxisSelection as b5, type AddOn as b6, type AddOnWithOptions as b7, type AddOnOption as b8, type AddOnOptionPrice as b9, type LocationProductPrice as bA, type ProductAvailability as bB, type ProductTimeProfile as bC, type CartStatus as bD, type CartChannel as bE, type PriceSource as bF, type AdjustmentType as bG, type PriceAdjustment as bH, type TaxPathComponent as bI, type PricePathTaxInfo as bJ, type PriceDecisionPath as bK, type ChosenPrice as bL, type BenefitType as bM, type AppliedDiscount as bN, type DiscountBreakdown as bO, type DiscountDetails as bP, type SelectedAddOnOption as bQ, type AddOnDetails as bR, type CartAddOn as bS, type VariantDetails as bT, type BundleSelectionInput as bU, type BundleStoredSelection as bV, type BundleSelectionData as bW, type CompositeStoredSelection as bX, type CompositePriceBreakdown as bY, type CompositeSelectionData as bZ, type LineConfiguration as b_, type ProductAddOn as ba, type Category as bb, type CategorySummary as bc, type Collection as bd, type CollectionSummary as be, type CollectionProduct as bf, type BundlePriceType as bg, type Bundle as bh, type BundleSummary as bi, type BundleProduct as bj, type BundleWithDetails as bk, type BundleComponentData as bl, type BundleComponentInfo as bm, type CompositePricingMode as bn, type GroupPricingBehavior as bo, type ComponentSourceType as bp, type Composite as bq, type CompositeWithDetails as br, type ComponentGroup as bs, type ComponentGroupWithComponents as bt, type CompositeComponent as bu, type ComponentSelectionInput as bv, type CompositePriceResult as bw, type ComponentPriceBreakdown as bx, type PriceEntryType as by, type Price as bz, createCimplifyClient as c, type PaymentStatus as c$, type CartItem as c0, type CartTotals as c1, type DisplayCart as c2, type DisplayCartItem as c3, type DisplayAddOn as c4, type DisplayAddOnOption as c5, type UICartBusiness as c6, type UICartLocation as c7, type UICartCustomer as c8, type UICartPricing as c9, type OrderGroupPayment as cA, type OrderSplitDetail as cB, type OrderGroupPaymentSummary as cC, type OrderGroupDetails as cD, type OrderPaymentEvent as cE, type OrderFilter as cF, type CheckoutInput as cG, type UpdateOrderStatusInput as cH, type CancelOrderInput as cI, type RefundOrderInput as cJ, type ServiceStatus as cK, type StaffRole as cL, type ReminderMethod as cM, type CustomerServicePreferences as cN, type BufferTimes as cO, type ReminderSettings as cP, type CancellationPolicy as cQ, type ServiceNotes as cR, type PricingOverrides as cS, type SchedulingMetadata as cT, type StaffAssignment as cU, type ResourceAssignment as cV, type SchedulingResult as cW, type DepositResult as cX, type ServiceScheduleRequest as cY, type StaffScheduleItem as cZ, type LocationAppointment as c_, type AddOnOptionDetails as ca, type AddOnGroupDetails as cb, type VariantDetailsDTO as cc, type CartItemDetails as cd, type UICart as ce, type UICartResponse as cf, type AddToCartInput as cg, type UpdateCartItemInput as ch, type CartSummary as ci, type OrderStatus as cj, type PaymentState as ck, type OrderChannel as cl, type LineType as cm, type OrderLineState as cn, type OrderLineStatus as co, type FulfillmentType as cp, type FulfillmentStatus as cq, type FulfillmentLink as cr, type OrderFulfillmentSummary as cs, type FeeBearerType as ct, type AmountToPay as cu, type LineItem as cv, type Order as cw, type OrderHistory as cx, type OrderGroupPaymentState as cy, type OrderGroup as cz, type CimplifyConfig as d, type CustomerAddress as d$, type PaymentProvider as d0, type PaymentMethodType as d1, type AuthorizationType as d2, type PaymentProcessingState as d3, type PaymentMethod as d4, type Payment as d5, type InitializePaymentResult as d6, type SubmitAuthorizationInput as d7, type BusinessType as d8, type BusinessPreferences as d9, type ResourceType as dA, type Service as dB, type ServiceWithStaff as dC, type Staff as dD, type TimeSlot as dE, type AvailableSlot as dF, type DayAvailability as dG, type BookingStatus as dH, type Booking as dI, type BookingWithDetails as dJ, type GetAvailableSlotsInput as dK, type CheckSlotAvailabilityInput as dL, type RescheduleBookingInput as dM, type CancelBookingInput as dN, type ServiceAvailabilityParams as dO, type ServiceAvailabilityResult as dP, type StockOwnershipType as dQ, type StockStatus as dR, type Stock as dS, type StockLevel as dT, type ProductStock as dU, type VariantStock as dV, type LocationStock as dW, type AvailabilityCheck as dX, type AvailabilityResult as dY, type InventorySummary as dZ, type Customer as d_, type Business as da, type LocationTaxBehavior as db, type LocationTaxOverrides as dc, type Location as dd, type TimeRange as de, type TimeRanges as df, type LocationTimeProfile as dg, type Table as dh, type Room as di, type ServiceCharge as dj, type StorefrontBootstrap as dk, type BusinessWithLocations as dl, type LocationWithDetails as dm, type BusinessSettings as dn, type BusinessHours as dp, type CategoryInfo as dq, type ServiceAvailabilityRule as dr, type ServiceAvailabilityException as ds, type StaffAvailabilityRule as dt, type StaffAvailabilityException as du, type ResourceAvailabilityRule as dv, type ResourceAvailabilityException as dw, type StaffBookingProfile as dx, type ServiceStaffRequirement as dy, type BookingRequirementOverride as dz, CatalogueQueries as e, type CustomerMobileMoney as e0, type CustomerLinkPreferences as e1, type LinkData as e2, type CreateAddressInput as e3, type UpdateAddressInput as e4, type CreateMobileMoneyInput as e5, type EnrollmentData as e6, type AddressData as e7, type MobileMoneyData as e8, type EnrollAndLinkOrderInput as e9, type PaymentMethodInfo as eA, type AuthenticatedCustomer as eB, type ElementsCustomerInfo as eC, type AuthenticatedData as eD, type ElementsCheckoutData as eE, type ElementsCheckoutResult as eF, type ParentToIframeMessage as eG, type IframeToParentMessage as eH, type ElementEventHandler as eI, type AdSlot as eJ, type AdPosition as eK, type AdTheme as eL, type AdConfig as eM, type AdCreative as eN, type AdContextValue as eO, type LinkStatusResult as ea, type LinkEnrollResult as eb, type EnrollAndLinkOrderResult as ec, type LinkSession as ed, type RevokeSessionResult as ee, type RevokeAllSessionsResult as ef, type RequestOtpInput as eg, type VerifyOtpInput as eh, type AuthResponse as ei, type PickupTimeType as ej, type PickupTime as ek, type CheckoutAddressInfo as el, type MobileMoneyDetails as em, type CheckoutCustomerInfo as en, type FxQuoteRequest as eo, type FxQuote as ep, type FxRateResponse as eq, type RequestContext as er, type RequestStartEvent as es, type RequestSuccessEvent as et, type RequestErrorEvent as eu, type RetryEvent as ev, type SessionChangeEvent as ew, type ObservabilityHooks as ex, type ElementAppearance as ey, type AddressInfo as ez, type QuoteBundleSelectionInput as f, type QuoteStatus as g, type QuoteDynamicBuckets as h, type QuoteUiMessage as i, type PriceQuote as j, type RefreshQuoteResult as k, CartOperations as l, CheckoutService as m, generateIdempotencyKey as n, type GetOrdersOptions as o, AuthService as p, type AuthStatus as q, type OtpResult as r, type ChangePasswordInput as s, SchedulingService as t, LiteService as u, FxService as v, type LiteBootstrap as w, type KitchenOrderResult as x, CimplifyElements as y, CimplifyElement as z };
|
|
@@ -1775,7 +1775,7 @@ interface LocationAppointment {
|
|
|
1775
1775
|
service_status: ServiceStatus;
|
|
1776
1776
|
}
|
|
1777
1777
|
|
|
1778
|
-
type PaymentStatus = "pending" | "processing" | "success" | "failed" | "refunded" | "captured" | "cancelled";
|
|
1778
|
+
type PaymentStatus = "pending" | "processing" | "created" | "pending_confirmation" | "success" | "succeeded" | "failed" | "declined" | "authorized" | "refunded" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_action" | "requires_payment_method" | "requires_capture" | "captured" | "cancelled" | "completed" | "voided" | "error" | "unknown";
|
|
1779
1779
|
type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
|
|
1780
1780
|
type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
|
|
1781
1781
|
/** Authorization types for payment verification (OTP, PIN, etc.) */
|
|
@@ -1832,7 +1832,7 @@ interface PaymentResponse {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
/** Payment status polling response */
|
|
1834
1834
|
interface PaymentStatusResponse {
|
|
1835
|
-
status:
|
|
1835
|
+
status: PaymentStatus;
|
|
1836
1836
|
paid: boolean;
|
|
1837
1837
|
amount?: Money;
|
|
1838
1838
|
currency?: string;
|
|
@@ -2195,6 +2195,56 @@ interface CheckoutResult {
|
|
|
2195
2195
|
quote_id: string;
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
+
type CheckoutStatus = "preparing" | "recovering" | "processing" | "awaiting_authorization" | "polling" | "finalizing" | "success" | "failed";
|
|
2199
|
+
interface CheckoutStatusContext {
|
|
2200
|
+
display_text?: string;
|
|
2201
|
+
authorization_type?: "otp" | "pin";
|
|
2202
|
+
poll_attempt?: number;
|
|
2203
|
+
max_poll_attempts?: number;
|
|
2204
|
+
order_id?: string;
|
|
2205
|
+
order_number?: string;
|
|
2206
|
+
provider?: string;
|
|
2207
|
+
}
|
|
2208
|
+
interface ProcessCheckoutOptions {
|
|
2209
|
+
cart_id: string;
|
|
2210
|
+
order_type: "delivery" | "pickup" | "dine_in";
|
|
2211
|
+
location_id?: string;
|
|
2212
|
+
notes?: string;
|
|
2213
|
+
scheduled_time?: string;
|
|
2214
|
+
tip_amount?: number;
|
|
2215
|
+
enroll_in_link?: boolean;
|
|
2216
|
+
pay_currency?: string;
|
|
2217
|
+
timeout_ms?: number;
|
|
2218
|
+
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
2219
|
+
}
|
|
2220
|
+
interface ProcessCheckoutResult {
|
|
2221
|
+
success: boolean;
|
|
2222
|
+
order?: {
|
|
2223
|
+
id: string;
|
|
2224
|
+
order_number: string;
|
|
2225
|
+
status: string;
|
|
2226
|
+
total: string;
|
|
2227
|
+
currency: string;
|
|
2228
|
+
};
|
|
2229
|
+
error?: {
|
|
2230
|
+
code: string;
|
|
2231
|
+
message: string;
|
|
2232
|
+
recoverable: boolean;
|
|
2233
|
+
};
|
|
2234
|
+
enrolled_in_link?: boolean;
|
|
2235
|
+
}
|
|
2236
|
+
interface ProcessAndResolveOptions {
|
|
2237
|
+
enroll_in_link?: boolean;
|
|
2238
|
+
poll_interval_ms?: number;
|
|
2239
|
+
max_poll_attempts?: number;
|
|
2240
|
+
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
2241
|
+
on_authorization_required?: (type: "otp" | "pin", submit: (code: string) => Promise<void>) => void | Promise<void>;
|
|
2242
|
+
return_url?: string;
|
|
2243
|
+
signal?: AbortSignal;
|
|
2244
|
+
}
|
|
2245
|
+
type AbortablePromise<T> = Promise<T> & {
|
|
2246
|
+
abort: () => void;
|
|
2247
|
+
};
|
|
2198
2248
|
|
|
2199
2249
|
declare function generateIdempotencyKey(): string;
|
|
2200
2250
|
declare class CheckoutService {
|
|
@@ -2206,6 +2256,7 @@ declare class CheckoutService {
|
|
|
2206
2256
|
pollPaymentStatus(orderId: string): Promise<Result<PaymentStatusResponse, CimplifyError>>;
|
|
2207
2257
|
updateOrderCustomer(orderId: string, customer: CheckoutCustomerInfo): Promise<Result<Order, CimplifyError>>;
|
|
2208
2258
|
verifyPayment(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
2259
|
+
processAndResolve(data: CheckoutFormData & ProcessAndResolveOptions): Promise<Result<ProcessCheckoutResult, CimplifyError>>;
|
|
2209
2260
|
}
|
|
2210
2261
|
|
|
2211
2262
|
interface GetOrdersOptions {
|
|
@@ -3028,6 +3079,8 @@ declare const MESSAGE_TYPES: {
|
|
|
3028
3079
|
readonly GET_DATA: "get_data";
|
|
3029
3080
|
readonly REFRESH_TOKEN: "refresh_token";
|
|
3030
3081
|
readonly LOGOUT: "logout";
|
|
3082
|
+
readonly PROCESS_CHECKOUT: "process_checkout";
|
|
3083
|
+
readonly ABORT_CHECKOUT: "abort_checkout";
|
|
3031
3084
|
readonly READY: "ready";
|
|
3032
3085
|
readonly HEIGHT_CHANGE: "height_change";
|
|
3033
3086
|
readonly AUTHENTICATED: "authenticated";
|
|
@@ -3038,6 +3091,8 @@ declare const MESSAGE_TYPES: {
|
|
|
3038
3091
|
readonly PAYMENT_METHOD_SELECTED: "payment_method_selected";
|
|
3039
3092
|
readonly TOKEN_REFRESHED: "token_refreshed";
|
|
3040
3093
|
readonly LOGOUT_COMPLETE: "logout_complete";
|
|
3094
|
+
readonly CHECKOUT_STATUS: "checkout_status";
|
|
3095
|
+
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
3041
3096
|
};
|
|
3042
3097
|
interface ElementsOptions {
|
|
3043
3098
|
linkUrl?: string;
|
|
@@ -3076,10 +3131,21 @@ interface PaymentMethodInfo {
|
|
|
3076
3131
|
phone_number?: string;
|
|
3077
3132
|
label?: string;
|
|
3078
3133
|
}
|
|
3134
|
+
interface AuthenticatedCustomer {
|
|
3135
|
+
name: string;
|
|
3136
|
+
email: string | null;
|
|
3137
|
+
phone: string | null;
|
|
3138
|
+
}
|
|
3139
|
+
type ElementsCustomerInfo = {
|
|
3140
|
+
name: string;
|
|
3141
|
+
email: string | null;
|
|
3142
|
+
phone: string | null;
|
|
3143
|
+
} | null;
|
|
3079
3144
|
interface AuthenticatedData {
|
|
3080
3145
|
accountId: string;
|
|
3081
3146
|
customerId: string;
|
|
3082
3147
|
token: string;
|
|
3148
|
+
customer: AuthenticatedCustomer;
|
|
3083
3149
|
}
|
|
3084
3150
|
interface ElementsCheckoutData {
|
|
3085
3151
|
cart_id: string;
|
|
@@ -3104,7 +3170,10 @@ interface ElementsCheckoutResult {
|
|
|
3104
3170
|
type ParentToIframeMessage = {
|
|
3105
3171
|
type: typeof MESSAGE_TYPES.INIT;
|
|
3106
3172
|
businessId: string;
|
|
3173
|
+
publicKey: string;
|
|
3174
|
+
demoMode?: boolean;
|
|
3107
3175
|
prefillEmail?: string;
|
|
3176
|
+
appearance?: ElementAppearance;
|
|
3108
3177
|
} | {
|
|
3109
3178
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
3110
3179
|
token: string;
|
|
@@ -3114,6 +3183,22 @@ type ParentToIframeMessage = {
|
|
|
3114
3183
|
type: typeof MESSAGE_TYPES.REFRESH_TOKEN;
|
|
3115
3184
|
} | {
|
|
3116
3185
|
type: typeof MESSAGE_TYPES.LOGOUT;
|
|
3186
|
+
} | {
|
|
3187
|
+
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
3188
|
+
cart_id: string;
|
|
3189
|
+
order_type: "delivery" | "pickup" | "dine_in";
|
|
3190
|
+
location_id?: string;
|
|
3191
|
+
notes?: string;
|
|
3192
|
+
scheduled_time?: string;
|
|
3193
|
+
tip_amount?: number;
|
|
3194
|
+
pay_currency?: string;
|
|
3195
|
+
enroll_in_link?: boolean;
|
|
3196
|
+
address?: AddressInfo;
|
|
3197
|
+
customer: ElementsCustomerInfo;
|
|
3198
|
+
account_id?: string;
|
|
3199
|
+
customer_id?: string;
|
|
3200
|
+
} | {
|
|
3201
|
+
type: typeof MESSAGE_TYPES.ABORT_CHECKOUT;
|
|
3117
3202
|
};
|
|
3118
3203
|
type IframeToParentMessage = {
|
|
3119
3204
|
type: typeof MESSAGE_TYPES.READY;
|
|
@@ -3126,6 +3211,7 @@ type IframeToParentMessage = {
|
|
|
3126
3211
|
accountId: string;
|
|
3127
3212
|
customerId: string;
|
|
3128
3213
|
token: string;
|
|
3214
|
+
customer: AuthenticatedCustomer;
|
|
3129
3215
|
} | {
|
|
3130
3216
|
type: typeof MESSAGE_TYPES.REQUIRES_OTP;
|
|
3131
3217
|
contactMasked: string;
|
|
@@ -3149,6 +3235,26 @@ type IframeToParentMessage = {
|
|
|
3149
3235
|
token: string;
|
|
3150
3236
|
} | {
|
|
3151
3237
|
type: typeof MESSAGE_TYPES.LOGOUT_COMPLETE;
|
|
3238
|
+
} | {
|
|
3239
|
+
type: typeof MESSAGE_TYPES.CHECKOUT_STATUS;
|
|
3240
|
+
status: CheckoutStatus;
|
|
3241
|
+
context: CheckoutStatusContext;
|
|
3242
|
+
} | {
|
|
3243
|
+
type: typeof MESSAGE_TYPES.CHECKOUT_COMPLETE;
|
|
3244
|
+
success: boolean;
|
|
3245
|
+
order?: {
|
|
3246
|
+
id: string;
|
|
3247
|
+
order_number: string;
|
|
3248
|
+
status: string;
|
|
3249
|
+
total: string;
|
|
3250
|
+
currency: string;
|
|
3251
|
+
};
|
|
3252
|
+
error?: {
|
|
3253
|
+
code: string;
|
|
3254
|
+
message: string;
|
|
3255
|
+
recoverable: boolean;
|
|
3256
|
+
};
|
|
3257
|
+
enrolled_in_link?: boolean;
|
|
3152
3258
|
};
|
|
3153
3259
|
declare const EVENT_TYPES: {
|
|
3154
3260
|
readonly READY: "ready";
|
|
@@ -3171,16 +3277,23 @@ declare class CimplifyElements {
|
|
|
3171
3277
|
private accessToken;
|
|
3172
3278
|
private accountId;
|
|
3173
3279
|
private customerId;
|
|
3280
|
+
private customerData;
|
|
3174
3281
|
private addressData;
|
|
3175
3282
|
private paymentData;
|
|
3283
|
+
private checkoutInProgress;
|
|
3284
|
+
private activeCheckoutAbort;
|
|
3176
3285
|
private boundHandleMessage;
|
|
3177
3286
|
constructor(client: CimplifyClient, businessId: string, options?: ElementsOptions);
|
|
3178
3287
|
create(type: ElementType, options?: ElementOptions): CimplifyElement;
|
|
3179
3288
|
getElement(type: ElementType): CimplifyElement | undefined;
|
|
3180
3289
|
destroy(): void;
|
|
3181
3290
|
submitCheckout(data: ElementsCheckoutData): Promise<ElementsCheckoutResult>;
|
|
3291
|
+
processCheckout(options: ProcessCheckoutOptions): AbortablePromise<ProcessCheckoutResult>;
|
|
3182
3292
|
isAuthenticated(): boolean;
|
|
3183
3293
|
getAccessToken(): string | null;
|
|
3294
|
+
getPublicKey(): string;
|
|
3295
|
+
getAppearance(): ElementsOptions["appearance"];
|
|
3296
|
+
private hydrateCustomerData;
|
|
3184
3297
|
private handleMessage;
|
|
3185
3298
|
_setAddressData(data: AddressInfo): void;
|
|
3186
3299
|
_setPaymentData(data: PaymentMethodInfo): void;
|
|
@@ -3204,6 +3317,8 @@ declare class CimplifyElement {
|
|
|
3204
3317
|
off(event: ElementEventType, handler: ElementEventHandler): void;
|
|
3205
3318
|
getData(): Promise<unknown>;
|
|
3206
3319
|
sendMessage(message: ParentToIframeMessage): void;
|
|
3320
|
+
getContentWindow(): Window | null;
|
|
3321
|
+
isMounted(): boolean;
|
|
3207
3322
|
private createIframe;
|
|
3208
3323
|
private handleMessage;
|
|
3209
3324
|
private emit;
|
|
@@ -3252,6 +3367,7 @@ declare class CimplifyClient {
|
|
|
3252
3367
|
/** @deprecated Use setAccessToken() instead */
|
|
3253
3368
|
setSessionToken(token: string | null): void;
|
|
3254
3369
|
getAccessToken(): string | null;
|
|
3370
|
+
getPublicKey(): string;
|
|
3255
3371
|
setAccessToken(token: string | null): void;
|
|
3256
3372
|
clearSession(): void;
|
|
3257
3373
|
/** Set the active location/branch for all subsequent requests */
|
|
@@ -3322,4 +3438,4 @@ interface AdContextValue {
|
|
|
3322
3438
|
isLoading: boolean;
|
|
3323
3439
|
}
|
|
3324
3440
|
|
|
3325
|
-
export { type CheckoutFormData as $, type ApiError as A, BusinessService as B, CimplifyClient as C, createElements as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, ELEMENT_TYPES as H, InventoryService as I, type ElementsOptions as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type ElementOptions as N, OrderQueries as O, type PaymentErrorDetails as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ElementType as V, type ElementEventType as W, type CheckoutMode as X, type CheckoutOrderType as Y, type CheckoutPaymentMethod as Z, type CheckoutStep as _, type PaymentResponse as a, type
|
|
3441
|
+
export { type CheckoutFormData as $, type ApiError as A, BusinessService as B, CimplifyClient as C, createElements as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, ELEMENT_TYPES as H, InventoryService as I, type ElementsOptions as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type ElementOptions as N, OrderQueries as O, type PaymentErrorDetails as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ElementType as V, type ElementEventType as W, type CheckoutMode as X, type CheckoutOrderType as Y, type CheckoutPaymentMethod as Z, type CheckoutStep as _, type PaymentResponse as a, type VariantDisplayAttribute as a$, type CheckoutResult as a0, type ProcessCheckoutOptions as a1, type ProcessCheckoutResult as a2, type ProcessAndResolveOptions as a3, type CheckoutStatus as a4, type CheckoutStatusContext as a5, type AbortablePromise as a6, type MobileMoneyProvider as a7, type DeviceType as a8, type ContactType as a9, isRetryableError as aA, type Result as aB, type Ok as aC, type Err as aD, ok as aE, err as aF, isOk as aG, isErr as aH, mapResult as aI, mapError as aJ, flatMap as aK, getOrElse as aL, unwrap as aM, toNullable as aN, fromPromise as aO, tryCatch as aP, combine as aQ, combineObject as aR, type ProductType as aS, type InventoryType as aT, type VariantStrategy as aU, type DigitalProductType as aV, type DepositType as aW, type SalesChannel as aX, type Product as aY, type ProductWithDetails as aZ, type ProductVariant as a_, CHECKOUT_MODE as aa, ORDER_TYPE as ab, PAYMENT_METHOD as ac, CHECKOUT_STEP as ad, PAYMENT_STATE as ae, PICKUP_TIME_TYPE as af, MOBILE_MONEY_PROVIDER as ag, AUTHORIZATION_TYPE as ah, DEVICE_TYPE as ai, CONTACT_TYPE as aj, LINK_QUERY as ak, LINK_MUTATION as al, AUTH_MUTATION as am, CHECKOUT_MUTATION as an, PAYMENT_MUTATION as ao, ORDER_MUTATION as ap, DEFAULT_CURRENCY as aq, DEFAULT_COUNTRY as ar, type Money as as, type Currency as at, type PaginationParams as au, type Pagination as av, ErrorCode as aw, type ErrorCodeType as ax, CimplifyError as ay, isCimplifyError as az, type PaymentStatusResponse as b, type Cart as b$, type VariantAxis as b0, type VariantAxisWithValues as b1, type VariantAxisValue as b2, type ProductVariantValue as b3, type VariantLocationAvailability as b4, type VariantAxisSelection as b5, type AddOn as b6, type AddOnWithOptions as b7, type AddOnOption as b8, type AddOnOptionPrice as b9, type LocationProductPrice as bA, type ProductAvailability as bB, type ProductTimeProfile as bC, type CartStatus as bD, type CartChannel as bE, type PriceSource as bF, type AdjustmentType as bG, type PriceAdjustment as bH, type TaxPathComponent as bI, type PricePathTaxInfo as bJ, type PriceDecisionPath as bK, type ChosenPrice as bL, type BenefitType as bM, type AppliedDiscount as bN, type DiscountBreakdown as bO, type DiscountDetails as bP, type SelectedAddOnOption as bQ, type AddOnDetails as bR, type CartAddOn as bS, type VariantDetails as bT, type BundleSelectionInput as bU, type BundleStoredSelection as bV, type BundleSelectionData as bW, type CompositeStoredSelection as bX, type CompositePriceBreakdown as bY, type CompositeSelectionData as bZ, type LineConfiguration as b_, type ProductAddOn as ba, type Category as bb, type CategorySummary as bc, type Collection as bd, type CollectionSummary as be, type CollectionProduct as bf, type BundlePriceType as bg, type Bundle as bh, type BundleSummary as bi, type BundleProduct as bj, type BundleWithDetails as bk, type BundleComponentData as bl, type BundleComponentInfo as bm, type CompositePricingMode as bn, type GroupPricingBehavior as bo, type ComponentSourceType as bp, type Composite as bq, type CompositeWithDetails as br, type ComponentGroup as bs, type ComponentGroupWithComponents as bt, type CompositeComponent as bu, type ComponentSelectionInput as bv, type CompositePriceResult as bw, type ComponentPriceBreakdown as bx, type PriceEntryType as by, type Price as bz, createCimplifyClient as c, type PaymentStatus as c$, type CartItem as c0, type CartTotals as c1, type DisplayCart as c2, type DisplayCartItem as c3, type DisplayAddOn as c4, type DisplayAddOnOption as c5, type UICartBusiness as c6, type UICartLocation as c7, type UICartCustomer as c8, type UICartPricing as c9, type OrderGroupPayment as cA, type OrderSplitDetail as cB, type OrderGroupPaymentSummary as cC, type OrderGroupDetails as cD, type OrderPaymentEvent as cE, type OrderFilter as cF, type CheckoutInput as cG, type UpdateOrderStatusInput as cH, type CancelOrderInput as cI, type RefundOrderInput as cJ, type ServiceStatus as cK, type StaffRole as cL, type ReminderMethod as cM, type CustomerServicePreferences as cN, type BufferTimes as cO, type ReminderSettings as cP, type CancellationPolicy as cQ, type ServiceNotes as cR, type PricingOverrides as cS, type SchedulingMetadata as cT, type StaffAssignment as cU, type ResourceAssignment as cV, type SchedulingResult as cW, type DepositResult as cX, type ServiceScheduleRequest as cY, type StaffScheduleItem as cZ, type LocationAppointment as c_, type AddOnOptionDetails as ca, type AddOnGroupDetails as cb, type VariantDetailsDTO as cc, type CartItemDetails as cd, type UICart as ce, type UICartResponse as cf, type AddToCartInput as cg, type UpdateCartItemInput as ch, type CartSummary as ci, type OrderStatus as cj, type PaymentState as ck, type OrderChannel as cl, type LineType as cm, type OrderLineState as cn, type OrderLineStatus as co, type FulfillmentType as cp, type FulfillmentStatus as cq, type FulfillmentLink as cr, type OrderFulfillmentSummary as cs, type FeeBearerType as ct, type AmountToPay as cu, type LineItem as cv, type Order as cw, type OrderHistory as cx, type OrderGroupPaymentState as cy, type OrderGroup as cz, type CimplifyConfig as d, type CustomerAddress as d$, type PaymentProvider as d0, type PaymentMethodType as d1, type AuthorizationType as d2, type PaymentProcessingState as d3, type PaymentMethod as d4, type Payment as d5, type InitializePaymentResult as d6, type SubmitAuthorizationInput as d7, type BusinessType as d8, type BusinessPreferences as d9, type ResourceType as dA, type Service as dB, type ServiceWithStaff as dC, type Staff as dD, type TimeSlot as dE, type AvailableSlot as dF, type DayAvailability as dG, type BookingStatus as dH, type Booking as dI, type BookingWithDetails as dJ, type GetAvailableSlotsInput as dK, type CheckSlotAvailabilityInput as dL, type RescheduleBookingInput as dM, type CancelBookingInput as dN, type ServiceAvailabilityParams as dO, type ServiceAvailabilityResult as dP, type StockOwnershipType as dQ, type StockStatus as dR, type Stock as dS, type StockLevel as dT, type ProductStock as dU, type VariantStock as dV, type LocationStock as dW, type AvailabilityCheck as dX, type AvailabilityResult as dY, type InventorySummary as dZ, type Customer as d_, type Business as da, type LocationTaxBehavior as db, type LocationTaxOverrides as dc, type Location as dd, type TimeRange as de, type TimeRanges as df, type LocationTimeProfile as dg, type Table as dh, type Room as di, type ServiceCharge as dj, type StorefrontBootstrap as dk, type BusinessWithLocations as dl, type LocationWithDetails as dm, type BusinessSettings as dn, type BusinessHours as dp, type CategoryInfo as dq, type ServiceAvailabilityRule as dr, type ServiceAvailabilityException as ds, type StaffAvailabilityRule as dt, type StaffAvailabilityException as du, type ResourceAvailabilityRule as dv, type ResourceAvailabilityException as dw, type StaffBookingProfile as dx, type ServiceStaffRequirement as dy, type BookingRequirementOverride as dz, CatalogueQueries as e, type CustomerMobileMoney as e0, type CustomerLinkPreferences as e1, type LinkData as e2, type CreateAddressInput as e3, type UpdateAddressInput as e4, type CreateMobileMoneyInput as e5, type EnrollmentData as e6, type AddressData as e7, type MobileMoneyData as e8, type EnrollAndLinkOrderInput as e9, type PaymentMethodInfo as eA, type AuthenticatedCustomer as eB, type ElementsCustomerInfo as eC, type AuthenticatedData as eD, type ElementsCheckoutData as eE, type ElementsCheckoutResult as eF, type ParentToIframeMessage as eG, type IframeToParentMessage as eH, type ElementEventHandler as eI, type AdSlot as eJ, type AdPosition as eK, type AdTheme as eL, type AdConfig as eM, type AdCreative as eN, type AdContextValue as eO, type LinkStatusResult as ea, type LinkEnrollResult as eb, type EnrollAndLinkOrderResult as ec, type LinkSession as ed, type RevokeSessionResult as ee, type RevokeAllSessionsResult as ef, type RequestOtpInput as eg, type VerifyOtpInput as eh, type AuthResponse as ei, type PickupTimeType as ej, type PickupTime as ek, type CheckoutAddressInfo as el, type MobileMoneyDetails as em, type CheckoutCustomerInfo as en, type FxQuoteRequest as eo, type FxQuote as ep, type FxRateResponse as eq, type RequestContext as er, type RequestStartEvent as es, type RequestSuccessEvent as et, type RequestErrorEvent as eu, type RetryEvent as ev, type SessionChangeEvent as ew, type ObservabilityHooks as ex, type ElementAppearance as ey, type AddressInfo as ez, type QuoteBundleSelectionInput as f, type QuoteStatus as g, type QuoteDynamicBuckets as h, type QuoteUiMessage as i, type PriceQuote as j, type RefreshQuoteResult as k, CartOperations as l, CheckoutService as m, generateIdempotencyKey as n, type GetOrdersOptions as o, AuthService as p, type AuthStatus as q, type OtpResult as r, type ChangePasswordInput as s, SchedulingService as t, LiteService as u, FxService as v, type LiteBootstrap as w, type KitchenOrderResult as x, CimplifyElements as y, CimplifyElement as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-
|
|
2
|
-
export {
|
|
1
|
+
import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-Cz14AMnc.mjs';
|
|
2
|
+
export { ah as AUTHORIZATION_TYPE, am as AUTH_MUTATION, a6 as AbortablePromise, eM as AdConfig, eO as AdContextValue, eN as AdCreative, eK as AdPosition, eJ as AdSlot, eL as AdTheme, b6 as AddOn, bR as AddOnDetails, cb as AddOnGroupDetails, b8 as AddOnOption, ca as AddOnOptionDetails, b9 as AddOnOptionPrice, b7 as AddOnWithOptions, cg as AddToCartInput, e7 as AddressData, ez as AddressInfo, bG as AdjustmentType, cu as AmountToPay, bN as AppliedDiscount, ei as AuthResponse, p as AuthService, q as AuthStatus, eB as AuthenticatedCustomer, eD as AuthenticatedData, d2 as AuthorizationType, dX as AvailabilityCheck, dY as AvailabilityResult, dF as AvailableSlot, bM as BenefitType, dI as Booking, dz as BookingRequirementOverride, dH as BookingStatus, dJ as BookingWithDetails, cO as BufferTimes, bh as Bundle, bl as BundleComponentData, bm as BundleComponentInfo, bg as BundlePriceType, bj as BundleProduct, bW as BundleSelectionData, bU as BundleSelectionInput, bV as BundleStoredSelection, bi as BundleSummary, bk as BundleWithDetails, da as Business, dp as BusinessHours, d9 as BusinessPreferences, B as BusinessService, dn as BusinessSettings, d8 as BusinessType, dl as BusinessWithLocations, aa as CHECKOUT_MODE, an as CHECKOUT_MUTATION, ad as CHECKOUT_STEP, aj as CONTACT_TYPE, dN as CancelBookingInput, cI as CancelOrderInput, cQ as CancellationPolicy, b$ as Cart, bS as CartAddOn, bE as CartChannel, c0 as CartItem, cd as CartItemDetails, l as CartOperations, bD as CartStatus, ci as CartSummary, c1 as CartTotals, e as CatalogueQueries, bb as Category, dq as CategoryInfo, bc as CategorySummary, s as ChangePasswordInput, dL as CheckSlotAvailabilityInput, el as CheckoutAddressInfo, en as CheckoutCustomerInfo, $ as CheckoutFormData, cG as CheckoutInput, X as CheckoutMode, m as CheckoutOperations, Y as CheckoutOrderType, Z as CheckoutPaymentMethod, a0 as CheckoutResult, m as CheckoutService, a4 as CheckoutStatus, a5 as CheckoutStatusContext, _ as CheckoutStep, bL as ChosenPrice, C as CimplifyClient, d as CimplifyConfig, z as CimplifyElement, y as CimplifyElements, ay as CimplifyError, bd as Collection, bf as CollectionProduct, be as CollectionSummary, bs as ComponentGroup, bt as ComponentGroupWithComponents, bx as ComponentPriceBreakdown, bv as ComponentSelectionInput, bp as ComponentSourceType, bq as Composite, bu as CompositeComponent, bY as CompositePriceBreakdown, bw as CompositePriceResult, bn as CompositePricingMode, bZ as CompositeSelectionData, bv as CompositeSelectionInput, bX as CompositeStoredSelection, br as CompositeWithDetails, a9 as ContactType, e3 as CreateAddressInput, e5 as CreateMobileMoneyInput, at as Currency, d_ as Customer, d$ as CustomerAddress, e1 as CustomerLinkPreferences, e0 as CustomerMobileMoney, cN as CustomerServicePreferences, ar as DEFAULT_COUNTRY, aq as DEFAULT_CURRENCY, ai as DEVICE_TYPE, dG as DayAvailability, cX as DepositResult, aW as DepositType, a8 as DeviceType, aV as DigitalProductType, bO as DiscountBreakdown, bP as DiscountDetails, c4 as DisplayAddOn, c5 as DisplayAddOnOption, c2 as DisplayCart, c3 as DisplayCartItem, H as ELEMENT_TYPES, E as EVENT_TYPES, ey as ElementAppearance, eI as ElementEventHandler, W as ElementEventType, N as ElementOptions, V as ElementType, eE as ElementsCheckoutData, eF as ElementsCheckoutResult, eC as ElementsCustomerInfo, J as ElementsOptions, e9 as EnrollAndLinkOrderInput, ec as EnrollAndLinkOrderResult, e6 as EnrollmentData, aD as Err, aw as ErrorCode, ax as ErrorCodeType, ct as FeeBearerType, F as FetchQuoteInput, cr as FulfillmentLink, cq as FulfillmentStatus, cp as FulfillmentType, ep as FxQuote, eo as FxQuoteRequest, eq as FxRateResponse, v as FxService, dK as GetAvailableSlotsInput, o as GetOrdersOptions, G as GetProductsOptions, bo as GroupPricingBehavior, eH as IframeToParentMessage, d6 as InitializePaymentResult, I as InventoryService, dZ as InventorySummary, aT as InventoryType, K as KitchenOrderItem, x as KitchenOrderResult, al as LINK_MUTATION, ak as LINK_QUERY, b_ as LineConfiguration, cv as LineItem, cm as LineType, e2 as LinkData, eb as LinkEnrollResult, L as LinkService, ed as LinkSession, ea as LinkStatusResult, w as LiteBootstrap, u as LiteService, dd as Location, c_ as LocationAppointment, bA as LocationProductPrice, dW as LocationStock, db as LocationTaxBehavior, dc as LocationTaxOverrides, dg as LocationTimeProfile, dm as LocationWithDetails, M as MESSAGE_TYPES, ag as MOBILE_MONEY_PROVIDER, e8 as MobileMoneyData, em as MobileMoneyDetails, a7 as MobileMoneyProvider, as as Money, ap as ORDER_MUTATION, ab as ORDER_TYPE, ex as ObservabilityHooks, aC as Ok, cw as Order, cl as OrderChannel, cF as OrderFilter, cs as OrderFulfillmentSummary, cz as OrderGroup, cD as OrderGroupDetails, cA as OrderGroupPayment, cy as OrderGroupPaymentState, cC as OrderGroupPaymentSummary, cx as OrderHistory, cn as OrderLineState, co as OrderLineStatus, cE as OrderPaymentEvent, O as OrderQueries, cB as OrderSplitDetail, cj as OrderStatus, r as OtpResult, ac as PAYMENT_METHOD, ao as PAYMENT_MUTATION, ae as PAYMENT_STATE, af as PICKUP_TIME_TYPE, av as Pagination, au as PaginationParams, eG as ParentToIframeMessage, d5 as Payment, d4 as PaymentMethod, eA as PaymentMethodInfo, d1 as PaymentMethodType, d3 as PaymentProcessingState, d0 as PaymentProvider, ck as PaymentState, c$ as PaymentStatus, ek as PickupTime, ej as PickupTimeType, bz as Price, bH as PriceAdjustment, bK as PriceDecisionPath, by as PriceEntryType, bJ as PricePathTaxInfo, j as PriceQuote, bF as PriceSource, cS as PricingOverrides, a3 as ProcessAndResolveOptions, a1 as ProcessCheckoutOptions, a2 as ProcessCheckoutResult, aY as Product, ba as ProductAddOn, bB as ProductAvailability, dU as ProductStock, bC as ProductTimeProfile, aS as ProductType, a_ as ProductVariant, b3 as ProductVariantValue, aZ as ProductWithDetails, f as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, h as QuoteDynamicBuckets, g as QuoteStatus, i as QuoteUiMessage, R as RefreshQuoteInput, k as RefreshQuoteResult, cJ as RefundOrderInput, cM as ReminderMethod, cP as ReminderSettings, er as RequestContext, eu as RequestErrorEvent, eg as RequestOtpInput, es as RequestStartEvent, et as RequestSuccessEvent, dM as RescheduleBookingInput, cV as ResourceAssignment, dw as ResourceAvailabilityException, dv as ResourceAvailabilityRule, dA as ResourceType, aB as Result, ev as RetryEvent, ef as RevokeAllSessionsResult, ee as RevokeSessionResult, di as Room, aX as SalesChannel, cT as SchedulingMetadata, cW as SchedulingResult, t as SchedulingService, S as SearchOptions, bQ as SelectedAddOnOption, dB as Service, ds as ServiceAvailabilityException, dO as ServiceAvailabilityParams, dP as ServiceAvailabilityResult, dr as ServiceAvailabilityRule, dj as ServiceCharge, cR as ServiceNotes, cY as ServiceScheduleRequest, dy as ServiceStaffRequirement, cK as ServiceStatus, dC as ServiceWithStaff, ew as SessionChangeEvent, dD as Staff, cU as StaffAssignment, du as StaffAvailabilityException, dt as StaffAvailabilityRule, dx as StaffBookingProfile, cL as StaffRole, cZ as StaffScheduleItem, dS as Stock, dT as StockLevel, dQ as StockOwnershipType, dR as StockStatus, dk as StorefrontBootstrap, d7 as SubmitAuthorizationInput, dh as Table, T as TableInfo, bI as TaxPathComponent, de as TimeRange, df as TimeRanges, dE as TimeSlot, ce as UICart, c6 as UICartBusiness, c8 as UICartCustomer, c7 as UICartLocation, c9 as UICartPricing, cf as UICartResponse, e4 as UpdateAddressInput, ch as UpdateCartItemInput, cH as UpdateOrderStatusInput, U as UpdateProfileInput, b0 as VariantAxis, b5 as VariantAxisSelection, b2 as VariantAxisValue, b1 as VariantAxisWithValues, bT as VariantDetails, cc as VariantDetailsDTO, a$ as VariantDisplayAttribute, b4 as VariantLocationAvailability, dV as VariantStock, aU as VariantStrategy, eh as VerifyOtpInput, aQ as combine, aR as combineObject, c as createCimplifyClient, D as createElements, aF as err, aK as flatMap, aO as fromPromise, n as generateIdempotencyKey, aL as getOrElse, az as isCimplifyError, aH as isErr, aG as isOk, aA as isRetryableError, aJ as mapError, aI as mapResult, aE as ok, aN as toNullable, aP as tryCatch, aM as unwrap } from './ads-Cz14AMnc.mjs';
|
|
3
3
|
|
|
4
4
|
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
|
5
5
|
type SortOrder = "asc" | "desc";
|
|
@@ -317,6 +317,9 @@ declare function categorizePaymentError(error: Error, errorCode?: string): Payme
|
|
|
317
317
|
* Normalize payment response from different formats into a standard PaymentResponse
|
|
318
318
|
*/
|
|
319
319
|
declare function normalizePaymentResponse(response: unknown): PaymentResponse;
|
|
320
|
+
declare function isPaymentStatusSuccess(status: string | undefined): boolean;
|
|
321
|
+
declare function isPaymentStatusFailure(status: string | undefined): boolean;
|
|
322
|
+
declare function isPaymentStatusRequiresAction(status: string | undefined): boolean;
|
|
320
323
|
/**
|
|
321
324
|
* Normalize payment status response into a standard format
|
|
322
325
|
*/
|
|
@@ -371,4 +374,4 @@ interface ApiResponse<T> {
|
|
|
371
374
|
metadata?: ResponseMetadata;
|
|
372
375
|
}
|
|
373
376
|
|
|
374
|
-
export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, type FrontendContext, MOBILE_MONEY_PROVIDERS, type MutationRequest, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, normalizePaymentResponse, normalizeStatusResponse, parsePrice, query };
|
|
377
|
+
export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, type FrontendContext, MOBILE_MONEY_PROVIDERS, type MutationRequest, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, normalizePaymentResponse, normalizeStatusResponse, parsePrice, query };
|