@lockerverse/sdk 0.2.41 → 0.2.43
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/README.md +87 -39
- package/dist/checkout.d.ts +2 -2
- package/dist/checkout.d.ts.map +1 -1
- package/dist/checkout.js +1 -1
- package/dist/checkout.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/signup.d.ts +1 -1
- package/dist/signup.js +1 -1
- package/dist/transport.js +1 -1
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +67 -63
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ type LockerverseCatalog = {
|
|
|
25
25
|
widget: LockerverseWidgetConfiguration;
|
|
26
26
|
};
|
|
27
27
|
type LockerverseCommunityBranding = {
|
|
28
|
-
accentColor: string
|
|
29
|
-
imageUrl: string
|
|
28
|
+
accentColor: string;
|
|
29
|
+
imageUrl: string;
|
|
30
30
|
name: string;
|
|
31
31
|
};
|
|
32
32
|
type LockerverseCheckoutPricingPolicy = {
|
|
@@ -37,6 +37,9 @@ type LockerversePaymentConfiguration = {
|
|
|
37
37
|
currency: "usd";
|
|
38
38
|
publishableKey: string;
|
|
39
39
|
};
|
|
40
|
+
type LockerverseCheckoutPaymentConfiguration = LockerversePaymentConfiguration & {
|
|
41
|
+
connectedAccountId: string | null;
|
|
42
|
+
};
|
|
40
43
|
type LockerverseWidgetFields = {
|
|
41
44
|
memberId: boolean;
|
|
42
45
|
merchSize: boolean;
|
|
@@ -81,8 +84,8 @@ type LockerverseWidgetConfiguration = {
|
|
|
81
84
|
showCommunityBranding: boolean;
|
|
82
85
|
title: string | null;
|
|
83
86
|
};
|
|
84
|
-
type LockerverseSdkErrorCode = "signup_load_failed" | "signup_submit_failed" | "
|
|
85
|
-
type LockerverseSdkOperation = "
|
|
87
|
+
type LockerverseSdkErrorCode = "widget_load_failed" | "signup_load_failed" | "signup_submit_failed" | "total_calculation_failed" | "payment_submit_failed" | "payment_status_failed" | "invalid_selection";
|
|
88
|
+
type LockerverseSdkOperation = "load_widget" | "load_signup" | "submit_signup" | "calculate_total" | "submit_payment" | "get_payment_status" | "update_selection";
|
|
86
89
|
declare class LockerverseSdkError extends Error {
|
|
87
90
|
readonly code: LockerverseSdkErrorCode;
|
|
88
91
|
readonly operation: LockerverseSdkOperation;
|
|
@@ -99,68 +102,81 @@ declare class LockerverseSdkError extends Error {
|
|
|
99
102
|
status?: number;
|
|
100
103
|
});
|
|
101
104
|
}
|
|
102
|
-
type
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
111
|
-
type LockerverseCheckoutItem = {
|
|
112
|
-
productSlug: string;
|
|
105
|
+
type LockerverseCheckoutLineItem = {
|
|
106
|
+
productId: string;
|
|
107
|
+
productName: string;
|
|
108
|
+
listingId: string;
|
|
109
|
+
listingSlug: string;
|
|
110
|
+
acceptsDiscounts: boolean;
|
|
111
|
+
pricingMode: "fixed" | "custom";
|
|
112
|
+
paymentOption: LockerversePaymentOption;
|
|
113
113
|
quantity: number;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
amountCents: number;
|
|
117
|
-
};
|
|
118
|
-
type LockerverseCreateCheckoutSessionInput = {
|
|
119
|
-
email?: string;
|
|
120
|
-
includeServiceFee?: boolean;
|
|
121
|
-
items: LockerverseCheckoutItem[];
|
|
122
|
-
metadata?: Record<string, string>;
|
|
123
|
-
requestKey: string;
|
|
124
|
-
returnUrl: string;
|
|
125
|
-
tipCents?: number;
|
|
114
|
+
unitAmountCents: number;
|
|
115
|
+
subtotalCents: number;
|
|
126
116
|
};
|
|
127
|
-
type
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
clientSecret: string;
|
|
131
|
-
connectedAccountId: string | null;
|
|
132
|
-
paymentReference: string;
|
|
133
|
-
pricing: LockerverseCheckoutPricingSnapshot;
|
|
134
|
-
sessionId: string;
|
|
117
|
+
type LockerverseAppliedDiscount = {
|
|
118
|
+
percentageOff: number;
|
|
119
|
+
source: "email_list" | "promo_code";
|
|
135
120
|
};
|
|
136
|
-
type
|
|
121
|
+
type LockerverseCheckoutAmounts = {
|
|
122
|
+
amountCents: number;
|
|
123
|
+
discountableSubtotalCents: number;
|
|
137
124
|
discountCents: number;
|
|
138
|
-
includeServiceFee: boolean;
|
|
139
125
|
serviceFeeCents: number;
|
|
140
126
|
subtotalCents: number;
|
|
141
127
|
tipCents: number;
|
|
142
128
|
totalCents: number;
|
|
143
129
|
};
|
|
144
|
-
type
|
|
145
|
-
|
|
130
|
+
type LockerverseCheckoutQuote = LockerverseCheckoutAmounts & {
|
|
131
|
+
appliedDiscount: LockerverseAppliedDiscount | null;
|
|
132
|
+
authoritative: true;
|
|
146
133
|
paymentReference: string;
|
|
147
|
-
|
|
134
|
+
payment: LockerverseCheckoutPaymentConfiguration;
|
|
135
|
+
paymentOption: "one-time";
|
|
136
|
+
lineItems: LockerverseCheckoutLineItem[];
|
|
137
|
+
};
|
|
138
|
+
type LockerverseCheckoutPricingInput = {
|
|
139
|
+
email?: string;
|
|
140
|
+
includeServiceFee?: boolean;
|
|
141
|
+
promoCode?: string;
|
|
142
|
+
tipCents?: number;
|
|
148
143
|
};
|
|
149
|
-
type
|
|
150
|
-
|
|
144
|
+
type LockerversePaymentStatus = "action_required" | "failed" | "pending" | "success";
|
|
145
|
+
type LockerversePaymentResult = {
|
|
146
|
+
checkoutId: string;
|
|
151
147
|
paymentReference: string;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
checkoutStatus: LockerversePaymentStatus;
|
|
149
|
+
clientSecret: string | null;
|
|
150
|
+
requiresAction: boolean;
|
|
151
|
+
status: string | null;
|
|
155
152
|
};
|
|
156
|
-
type
|
|
153
|
+
type LockerversePaymentSubmission = {
|
|
154
|
+
confirmationToken: string;
|
|
157
155
|
customFieldAnswers?: LockerverseCustomFieldAnswer[];
|
|
158
156
|
email: string;
|
|
159
157
|
memberId?: string;
|
|
160
158
|
merchSize?: "XS" | "S" | "M" | "L" | "XL" | "XXL" | "XXXL";
|
|
161
|
-
|
|
159
|
+
metadata?: Record<string, string>;
|
|
162
160
|
phone?: string;
|
|
163
161
|
};
|
|
162
|
+
type LockerverseCheckoutItem = {
|
|
163
|
+
productId: string;
|
|
164
|
+
quantity: number;
|
|
165
|
+
} | {
|
|
166
|
+
productId: string;
|
|
167
|
+
amountCents: number;
|
|
168
|
+
};
|
|
169
|
+
type LockerverseCalculateTotalInput = LockerverseCheckoutPricingInput & {
|
|
170
|
+
items: LockerverseCheckoutItem[];
|
|
171
|
+
};
|
|
172
|
+
type LockerversePreparedCheckout = Readonly<LockerverseCheckoutQuote & {
|
|
173
|
+
items: readonly LockerverseCheckoutItem[];
|
|
174
|
+
pricing: Readonly<LockerverseCheckoutPricingInput>;
|
|
175
|
+
}>;
|
|
176
|
+
type LockerverseSubmitPaymentInput = {
|
|
177
|
+
checkout: LockerversePreparedCheckout;
|
|
178
|
+
submission: LockerversePaymentSubmission;
|
|
179
|
+
};
|
|
164
180
|
type CreateLockerverseWidgetBaseOptions = {
|
|
165
181
|
communitySlug: string;
|
|
166
182
|
fetch?: typeof globalThis.fetch;
|
|
@@ -177,23 +193,11 @@ type CreateLockerverseWidgetOptions = CreateLockerverseWidgetBaseOptions & ({
|
|
|
177
193
|
environment?: "production";
|
|
178
194
|
});
|
|
179
195
|
type LockerverseCheckoutClient = {
|
|
180
|
-
|
|
181
|
-
createSession: (input: LockerverseCreateCheckoutSessionInput) => Promise<LockerverseCheckoutSession>;
|
|
196
|
+
calculateTotal: (input: LockerverseCalculateTotalInput) => Promise<LockerversePreparedCheckout>;
|
|
182
197
|
getPaymentStatus: (paymentReference: string) => Promise<LockerversePaymentResult>;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
promoCode?: string;
|
|
186
|
-
}) => Promise<LockerverseCheckoutSessionDiscount>;
|
|
187
|
-
updateSessionDetails: (input: LockerverseCheckoutSessionDetailsInput) => Promise<{
|
|
188
|
-
paymentReference: string;
|
|
189
|
-
totalCents: number;
|
|
190
|
-
}>;
|
|
191
|
-
updateSessionPricing: (input: {
|
|
192
|
-
includeServiceFee: boolean;
|
|
193
|
-
paymentReference: string;
|
|
194
|
-
tipCents: number;
|
|
195
|
-
}) => Promise<LockerverseCheckoutSessionPricing>;
|
|
198
|
+
load: () => Promise<LockerverseCatalog>;
|
|
199
|
+
submitPayment: (input: LockerverseSubmitPaymentInput) => Promise<LockerversePaymentResult>;
|
|
196
200
|
};
|
|
197
201
|
//#endregion
|
|
198
|
-
export {
|
|
202
|
+
export { LockerverseSdkOperation as A, LockerversePaymentResult as C, LockerverseProduct as D, LockerversePreparedCheckout as E, LockerverseWidgetFields as F, LockerverseSubmitPaymentInput as M, LockerverseTextCustomField as N, LockerverseSdkError as O, LockerverseWidgetConfiguration as P, LockerversePaymentOption as S, LockerversePaymentSubmission as T, LockerverseCustomFieldAnswerValue as _, LockerverseCatalog as a, LockerverseMultiOptionCustomField as b, LockerverseCheckoutItem as c, LockerverseCheckoutPricingInput as d, LockerverseCheckoutPricingPolicy as f, LockerverseCustomFieldAnswer as g, LockerverseCustomField as h, LockerverseCalculateTotalInput as i, LockerverseSingleOptionCustomField as j, LockerverseSdkErrorCode as k, LockerverseCheckoutLineItem as l, LockerverseCommunityBranding as m, LOCKERVERSE_SDK_VERSION as n, LockerverseCheckoutAmounts as o, LockerverseCheckoutQuote as p, LockerverseAppliedDiscount as r, LockerverseCheckoutClient as s, CreateLockerverseWidgetOptions as t, LockerverseCheckoutPaymentConfiguration as u, LockerverseCustomFieldOption as v, LockerversePaymentStatus as w, LockerversePaymentConfiguration as x, LockerverseEnvironment as y };
|
|
199
203
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";KAEY;KACA;cAEC;KAED;EACV;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV,WAAW;EACX,SAAS;EACT,eAAe;EACf,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EAAiC;EAAY;;KAEpD;EACH;EACA;EACA;;KAGU,6BAA6B;EACvC;;KAGU,qCAAqC;EAC/C,SAAS;EACT;;KAGU,oCAAoC;EAC9C,SAAS;EACT;;KAGU,yBACR,6BACA,qCACA;KAEQ,kCACV,cAAc,0BACZ,cAAc;KAEN,6BACV,cAAc,yBAAyB,0BACrC,cAAc;EACZ,SAAS;EAAa,OAAO,kCAAkC;;KAGzD;EACV,cAAc;EACd;EACA,QAAQ;EACR;EACA;EACA;EACA;;KAGU;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";KAEY;KACA;cAEC;KAED;EACV;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV,WAAW;EACX,SAAS;EACT,eAAe;EACf,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;;KAGU,0CACV;EACE;;KAGQ;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EAAiC;EAAY;;KAEpD;EACH;EACA;EACA;;KAGU,6BAA6B;EACvC;;KAGU,qCAAqC;EAC/C,SAAS;EACT;;KAGU,oCAAoC;EAC9C,SAAS;EACT;;KAGU,yBACR,6BACA,qCACA;KAEQ,kCACV,cAAc,0BACZ,cAAc;KAEN,6BACV,cAAc,yBAAyB,0BACrC,cAAc;EACZ,SAAS;EAAa,OAAO,kCAAkC;;KAGzD;EACV,cAAc;EACd;EACA,QAAQ;EACR;EACA;EACA;EACA;;KAGU;KASA;cASC,4BAA4B;WAC9B,MAAM;WACN,WAAW;WACX;WACA;WACA;WACA;EAEG,cACV,MACA,SACA,WACA,YACA,qBACA;IAEA,MAAM;IACN;IACA,WAAW;IACX;IACA;IACA;;;KAaQ;EACV;EACA;EACA;EACA;EACA;EACA;EACA,eAAe;EACf;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU,2BAA2B;EACrC,iBAAiB;EACjB;EACA;EACA,SAAS;EACT;EACA,WAAW;;KAGD;EACV;EACA;EACA;EACA;;KAGU;KAMA;EACV;EACA;EACA,gBAAgB;EAChB;EACA;EACA;;KAGU;EACV;EACA,qBAAqB;EACrB;EACA;EACA;EACA,WAAW;EACX;;KAGU;EACN;EAAmB;;EACnB;EAAmB;;KAEb,iCAAiC;EAC3C,OAAO;;KAGG,8BAA8B,SACxC;EACE,gBAAgB;EAChB,SAAS,SAAS;;KAIV;EACV,UAAU;EACV,YAAY;;KAGT;EACH;EACA,eAAe,WAAW;EAC1B,WAAW,OAAO;EAClB;EACA;EACA;;KAGU,iCACV;EAGQ;EACA,aAAa;;EAGb;EACA;;KAIE;EACV,iBACE,OAAO,mCACJ,QAAQ;EACb,mBACE,6BACG,QAAQ;EACb,YAAY,QAAQ;EACpB,gBACE,OAAO,kCACJ,QAAQ"}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=`0.2.
|
|
1
|
+
const e=`0.2.43`;var t=class extends Error{code;operation;reportable;recoveryRecommended;sdkVersion;status;constructor({code:t,message:n,operation:r,reportable:i,recoveryRecommended:a=!1,status:o}){super(n),this.name=`LockerverseSdkError`,this.code=t,this.operation=r,this.reportable=i,this.recoveryRecommended=a,this.sdkVersion=e,this.status=o}};export{t as n,e as t};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["packageMetadata.version"],"sources":["../package.json","../src/types.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\" with { type: \"json\" };\n\nexport type LockerversePaymentOption = \"one-time\" | \"monthly\" | \"annually\";\nexport type LockerverseEnvironment = \"development\" | \"production\";\n\nexport const LOCKERVERSE_SDK_VERSION = packageMetadata.version;\n\nexport type LockerverseProduct = {\n id: string;\n listingId: string;\n slug: string;\n name: string;\n description: string | null;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n amountCents: number | null;\n minimumAmountCents: number | null;\n minimumQuantity: number | null;\n maximumQuantity: number | null;\n inventoryQuantity: number | null;\n acceptsDiscounts: boolean;\n};\n\nexport type LockerverseCatalog = {\n community: LockerverseCommunityBranding | null;\n payment: LockerversePaymentConfiguration;\n pricingPolicy: LockerverseCheckoutPricingPolicy;\n products: LockerverseProduct[];\n widget: LockerverseWidgetConfiguration;\n};\n\nexport type LockerverseCommunityBranding = {\n accentColor: string
|
|
1
|
+
{"version":3,"file":"types.js","names":["packageMetadata.version"],"sources":["../package.json","../src/types.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\" with { type: \"json\" };\n\nexport type LockerversePaymentOption = \"one-time\" | \"monthly\" | \"annually\";\nexport type LockerverseEnvironment = \"development\" | \"production\";\n\nexport const LOCKERVERSE_SDK_VERSION = packageMetadata.version;\n\nexport type LockerverseProduct = {\n id: string;\n listingId: string;\n slug: string;\n name: string;\n description: string | null;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n amountCents: number | null;\n minimumAmountCents: number | null;\n minimumQuantity: number | null;\n maximumQuantity: number | null;\n inventoryQuantity: number | null;\n acceptsDiscounts: boolean;\n};\n\nexport type LockerverseCatalog = {\n community: LockerverseCommunityBranding | null;\n payment: LockerversePaymentConfiguration;\n pricingPolicy: LockerverseCheckoutPricingPolicy;\n products: LockerverseProduct[];\n widget: LockerverseWidgetConfiguration;\n};\n\nexport type LockerverseCommunityBranding = {\n accentColor: string;\n imageUrl: string;\n name: string;\n};\n\nexport type LockerverseCheckoutPricingPolicy = {\n currency: \"usd\";\n serviceFeeRateBasisPoints: number;\n};\n\nexport type LockerversePaymentConfiguration = {\n currency: \"usd\";\n publishableKey: string;\n};\n\nexport type LockerverseCheckoutPaymentConfiguration =\n LockerversePaymentConfiguration & {\n connectedAccountId: string | null;\n };\n\nexport type LockerverseWidgetFields = {\n memberId: boolean;\n merchSize: boolean;\n phone: boolean;\n promoCode: boolean;\n serviceFee: boolean;\n shipping: boolean;\n tipping: boolean;\n};\n\nexport type LockerverseCustomFieldOption = { id: string; label: string };\n\ntype LockerverseCustomFieldBase = {\n id: string;\n label: string;\n required: boolean;\n};\n\nexport type LockerverseTextCustomField = LockerverseCustomFieldBase & {\n type: \"text\" | \"textarea\";\n};\n\nexport type LockerverseSingleOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"radio\" | \"select\";\n};\n\nexport type LockerverseMultiOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"checkboxes\" | \"multi_select\";\n};\n\nexport type LockerverseCustomField =\n | LockerverseTextCustomField\n | LockerverseSingleOptionCustomField\n | LockerverseMultiOptionCustomField;\n\nexport type LockerverseCustomFieldAnswerValue<\n Field extends LockerverseCustomField,\n> = Field extends LockerverseMultiOptionCustomField ? string[] : string;\n\nexport type LockerverseCustomFieldAnswer<\n Field extends LockerverseCustomField = LockerverseCustomField,\n> = Field extends LockerverseCustomField\n ? { fieldId: Field[\"id\"]; value: LockerverseCustomFieldAnswerValue<Field> }\n : never;\n\nexport type LockerverseWidgetConfiguration = {\n customFields: LockerverseCustomField[];\n description: string | null;\n fields: LockerverseWidgetFields;\n id: string;\n name: string;\n showCommunityBranding: boolean;\n title: string | null;\n};\n\nexport type LockerverseSdkErrorCode =\n | \"widget_load_failed\"\n | \"signup_load_failed\"\n | \"signup_submit_failed\"\n | \"total_calculation_failed\"\n | \"payment_submit_failed\"\n | \"payment_status_failed\"\n | \"invalid_selection\";\n\nexport type LockerverseSdkOperation =\n | \"load_widget\"\n | \"load_signup\"\n | \"submit_signup\"\n | \"calculate_total\"\n | \"submit_payment\"\n | \"get_payment_status\"\n | \"update_selection\";\n\nexport class LockerverseSdkError extends Error {\n readonly code: LockerverseSdkErrorCode;\n readonly operation: LockerverseSdkOperation;\n readonly reportable: boolean;\n readonly recoveryRecommended: boolean;\n readonly sdkVersion: string;\n readonly status: number | undefined;\n\n constructor({\n code,\n message,\n operation,\n reportable,\n recoveryRecommended = false,\n status,\n }: {\n code: LockerverseSdkErrorCode;\n message: string;\n operation: LockerverseSdkOperation;\n reportable: boolean;\n recoveryRecommended?: boolean;\n status?: number;\n }) {\n super(message);\n this.name = \"LockerverseSdkError\";\n this.code = code;\n this.operation = operation;\n this.reportable = reportable;\n this.recoveryRecommended = recoveryRecommended;\n this.sdkVersion = LOCKERVERSE_SDK_VERSION;\n this.status = status;\n }\n}\n\nexport type LockerverseCheckoutLineItem = {\n productId: string;\n productName: string;\n listingId: string;\n listingSlug: string;\n acceptsDiscounts: boolean;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n quantity: number;\n unitAmountCents: number;\n subtotalCents: number;\n};\n\nexport type LockerverseAppliedDiscount = {\n percentageOff: number;\n source: \"email_list\" | \"promo_code\";\n};\n\nexport type LockerverseCheckoutAmounts = {\n amountCents: number;\n discountableSubtotalCents: number;\n discountCents: number;\n serviceFeeCents: number;\n subtotalCents: number;\n tipCents: number;\n totalCents: number;\n};\n\nexport type LockerverseCheckoutQuote = LockerverseCheckoutAmounts & {\n appliedDiscount: LockerverseAppliedDiscount | null;\n authoritative: true;\n paymentReference: string;\n payment: LockerverseCheckoutPaymentConfiguration;\n paymentOption: \"one-time\";\n lineItems: LockerverseCheckoutLineItem[];\n};\n\nexport type LockerverseCheckoutPricingInput = {\n email?: string;\n includeServiceFee?: boolean;\n promoCode?: string;\n tipCents?: number;\n};\n\nexport type LockerversePaymentStatus =\n | \"action_required\"\n | \"failed\"\n | \"pending\"\n | \"success\";\n\nexport type LockerversePaymentResult = {\n checkoutId: string;\n paymentReference: string;\n checkoutStatus: LockerversePaymentStatus;\n clientSecret: string | null;\n requiresAction: boolean;\n status: string | null;\n};\n\nexport type LockerversePaymentSubmission = {\n confirmationToken: string;\n customFieldAnswers?: LockerverseCustomFieldAnswer[];\n email: string;\n memberId?: string;\n merchSize?: \"XS\" | \"S\" | \"M\" | \"L\" | \"XL\" | \"XXL\" | \"XXXL\";\n metadata?: Record<string, string>;\n phone?: string;\n};\n\nexport type LockerverseCheckoutItem =\n | { productId: string; quantity: number }\n | { productId: string; amountCents: number };\n\nexport type LockerverseCalculateTotalInput = LockerverseCheckoutPricingInput & {\n items: LockerverseCheckoutItem[];\n};\n\nexport type LockerversePreparedCheckout = Readonly<\n LockerverseCheckoutQuote & {\n items: readonly LockerverseCheckoutItem[];\n pricing: Readonly<LockerverseCheckoutPricingInput>;\n }\n>;\n\nexport type LockerverseSubmitPaymentInput = {\n checkout: LockerversePreparedCheckout;\n submission: LockerversePaymentSubmission;\n};\n\ntype CreateLockerverseWidgetBaseOptions = {\n communitySlug: string;\n fetch?: typeof globalThis.fetch;\n onError?: (error: LockerverseSdkError) => void;\n requestTimeoutMs?: number;\n sentryDsn?: string | null;\n widgetSlug: string;\n};\n\nexport type CreateLockerverseWidgetOptions =\n CreateLockerverseWidgetBaseOptions &\n (\n | {\n apiBaseUrl: string;\n environment: LockerverseEnvironment;\n }\n | {\n apiBaseUrl?: undefined;\n environment?: \"production\";\n }\n );\n\nexport type LockerverseCheckoutClient = {\n calculateTotal: (\n input: LockerverseCalculateTotalInput\n ) => Promise<LockerversePreparedCheckout>;\n getPaymentStatus: (\n paymentReference: string\n ) => Promise<LockerversePaymentResult>;\n load: () => Promise<LockerverseCatalog>;\n submitPayment: (\n input: LockerverseSubmitPaymentInput\n ) => Promise<LockerversePaymentResult>;\n};\n"],"mappings":"ACKA,MAAa,EAA0BA,SA0HvC,IAAa,EAAb,cAAyC,KAAM,CAC7C,KACA,UACA,WACA,oBACA,WACA,OAEA,YAAY,CACV,OACA,UACA,YACA,aACA,sBAAsB,GACtB,UAQC,CACD,MAAM,CAAO,EACb,KAAK,KAAO,sBACZ,KAAK,KAAO,EACZ,KAAK,UAAY,EACjB,KAAK,WAAa,EAClB,KAAK,oBAAsB,EAC3B,KAAK,WAAa,EAClB,KAAK,OAAS,CAChB,CACF"}
|