PluginProbe ʕ •ᴥ•ʔ
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 3.0.0-beta1
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v3.0.0-beta1
4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.11.1 1.11.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.13.0 2.14.0 2.14.1 2.15.0 2.15.1 2.16.0 2.16.1 2.16.2 2.16.3 2.17.0 2.17.1 2.17.2 2.18.0 2.19.0 2.19.2 2.19.3 2.19.4 2.2.0 2.2.1 2.20.0 2.20.1 2.20.2 2.20.3 2.20.4 2.20.5 2.20.6 2.21.0 2.22.0 2.22.1 2.23.0 2.24.0 2.25.0 2.25.1 2.25.2 2.26.0 2.27.0 2.27.1 2.28.0 2.29.0 2.29.1 2.29.2 2.29.3 2.29.4 2.3.0 2.3.1 2.30.0 2.31.0 2.31.1 2.31.2 2.31.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.40.0 2.40.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.9.0 3.0.0 3.0.0-RC1 3.0.0-RC2 3.0.0-beta1 3.0.0-beta2 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.10.0 3.10.1 3.11.0 3.12.0 3.13.0 3.13.1 3.13.2 3.13.3 3.13.4 3.14.0 3.15.0 3.15.1 3.15.2 3.15.3 3.15.4 3.15.5 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.16.6 3.16.7 3.16.8 3.17.0 3.17.1 3.17.2 3.17.3 3.17.4 3.17.5 3.17.6 3.18.0 3.19.0 3.19.1 3.19.2 3.2.0 3.2.1 3.2.2 3.20.0 3.20.1 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 trunk 4.1.0 0.2.19.1 4.1.1 1.0.0 4.2.0 1.0.1 1.0.2
surecart / dist / components / types / types.d.ts
surecart / dist / components / types Last commit date
components 2 years ago functions 2 years ago global 4 years ago services 2 years ago store 2 years ago testing 2 years ago components.d.ts 2 years ago global.d.ts 4 years ago index.d.ts 2 years ago stencil-public-runtime.d.ts 2 years ago types.d.ts 2 years ago
types.d.ts
1245 lines
1 import { ObservableMap } from '@stencil/store';
2 import { IconLibraryMutator, IconLibraryResolver } from './components/ui/icon/library';
3 import { StripeElementChangeEvent } from '@stripe/stripe-js';
4 declare global {
5 interface Window {
6 grecaptcha: any;
7 surecart?: {
8 product?: {
9 store: ObservableMap<any>;
10 state: any;
11 update: Function;
12 };
13 };
14 wp: {
15 apiFetch: any;
16 blocks: any;
17 i18n: any;
18 };
19 dataLayer: any;
20 gtag: any;
21 fbq: any;
22 sc?: {
23 store?: {
24 product?: any;
25 products?: any;
26 };
27 checkout?: {
28 addLineItem: (data: any) => void;
29 };
30 cart?: {
31 toggle: (open: boolean) => void;
32 };
33 };
34 scStore: any;
35 registerSureCartIconPath: (path: string) => void;
36 registerSureCartIconLibrary: (name: string, options: {
37 resolver: IconLibraryResolver;
38 mutator?: IconLibraryMutator;
39 }) => void;
40 scIcons: {
41 path: string;
42 };
43 scData: {
44 cdn_root: string;
45 root_url: string;
46 account_id: string;
47 account_slug: string;
48 api_url: string;
49 plugin_url: string;
50 page_id: string;
51 persist_cart: 'browser' | 'url' | false;
52 nonce: string;
53 base_url: string;
54 nonce_endpoint: string;
55 recaptcha_site_key: string;
56 theme: string;
57 product_data: {
58 checkout_link: string;
59 mode: 'live' | 'test';
60 form: {
61 ID: number;
62 };
63 product: Product;
64 };
65 pages: {
66 dashboard: string;
67 checkout: string;
68 };
69 currency: string;
70 is_claimed: string;
71 claim_url: string;
72 admin_url: string;
73 user_permissions: {
74 manage_sc_shop_settings: boolean;
75 };
76 };
77 ceRegisterIconLibrary: any;
78 ResizeObserver: any;
79 }
80 }
81 export type RecursivePartial<T> = {
82 [P in keyof T]?: RecursivePartial<T[P]>;
83 };
84 interface Model {
85 created_at: number;
86 updated_at: number;
87 }
88 export interface ChoiceItem extends Object {
89 value: string;
90 label: string;
91 description?: string;
92 disabled?: boolean;
93 checked?: boolean;
94 unavailable?: boolean;
95 choices?: ChoiceItem[];
96 suffix?: string;
97 suffixDescription?: string;
98 icon?: string;
99 }
100 export type ChoiceType = 'all' | 'single' | 'multiple';
101 export interface Price {
102 id: string;
103 name: string;
104 description?: string;
105 amount: number;
106 full_amount: number;
107 currency: string;
108 recurring: boolean;
109 recurring_interval?: 'week' | 'month' | 'year' | 'never';
110 recurring_interval_count?: number;
111 trial_duration_days?: number;
112 ad_hoc: boolean;
113 ad_hoc_max_amount: number;
114 ad_hoc_min_amount: number;
115 scratch_amount: number;
116 setup_fee_enabled: boolean;
117 setup_fee_amount: number;
118 setup_fee_name: string;
119 setup_fee_trial_enabled: boolean;
120 recurring_period_count: number;
121 archived: boolean;
122 product_id?: string;
123 archived_at?: string;
124 created_at: number;
125 updated_at: number;
126 product?: Product | string;
127 position: number;
128 portal_subscription_update_enabled: boolean;
129 metadata: {
130 [key: string]: string;
131 };
132 }
133 export interface VariantOption {
134 id: string;
135 object: string;
136 name: string;
137 position: number;
138 product: Product | string;
139 updated_at: number;
140 created_at: number;
141 label: string;
142 labels: string;
143 values: Array<string>;
144 }
145 export interface Bump {
146 id: string;
147 object: 'bump';
148 amount_off: number;
149 archived: boolean;
150 archived_at: number;
151 auto_apply: boolean;
152 filter_match_type: 'all' | 'any' | 'none';
153 filters: any;
154 metadata: any;
155 name: string;
156 percent_off: number;
157 price: string | Price;
158 priority: 1 | 2 | 3 | 4 | 5;
159 created_at: number;
160 updated_at: number;
161 }
162 export interface UpsellFunnel {
163 id: string;
164 object: 'upsell_funnel';
165 archived: boolean;
166 enabled: boolean;
167 filter_match_type: 'all' | 'any' | 'none';
168 filter_price_ids: string[];
169 filter_product_ids: string[];
170 metadata: any;
171 name: string;
172 priority: number;
173 upsells: {
174 object: 'list';
175 pagination: Pagination;
176 data: Array<Upsell>;
177 };
178 archived_at: number;
179 discarded_at: number;
180 created_at: number;
181 updated_at: number;
182 }
183 export interface Upsell {
184 id: string;
185 object: 'upsell';
186 amount_off: number;
187 metadata: any;
188 fee_description: string;
189 duplicate_purchase_behavior: 'allow' | 'block' | 'block_within_checkout';
190 percent_off: number;
191 price: string | Price;
192 step: 'initial' | 'accepted' | 'declined';
193 upsell_funnel: string | UpsellFunnel;
194 permalink: string;
195 discarded_at: number;
196 created_at: number;
197 updated_at: number;
198 }
199 export type Prices = {
200 [id: string]: Price;
201 };
202 export interface Media {
203 id: string;
204 object: 'media';
205 byte_size: number;
206 content_type: string;
207 extension: string;
208 filename: string;
209 public_access: boolean;
210 release_json: any;
211 alt: string;
212 title: string;
213 url?: string;
214 url_expires_at?: number;
215 updated_at: number;
216 created_at: number;
217 }
218 export interface Download {
219 id: string;
220 object: 'download';
221 archived: boolean;
222 archived_at?: number;
223 media: string | Media;
224 name?: string;
225 product: string | Product;
226 update_at: number;
227 created_at: number;
228 url?: string;
229 }
230 export type FormState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalizing' | 'paying' | 'confirming' | 'confirmed' | 'paid' | 'failure' | 'expired' | 'redirecting';
231 export type FormStateSetter = 'RESOLVE' | 'REJECT' | 'FINALIZE' | 'PAYING' | 'PAID' | 'EXPIRE' | 'FETCH';
232 export interface License {
233 id: string;
234 object: 'license';
235 activation_limit: number;
236 activation_count: number;
237 key: string;
238 activations?: {
239 object: 'list';
240 pagination: Pagination;
241 data: Array<Activation>;
242 };
243 status: 'inactive' | 'active' | 'revoked';
244 purchase: string | Purchase;
245 created_at: number;
246 updated_at: number;
247 }
248 export interface CancellationReason {
249 id: string;
250 object: 'cancellation_reason';
251 archived: boolean;
252 comment_enabled: false;
253 comment_prompt: string | null;
254 coupon_enabled: boolean;
255 label: string;
256 position: number;
257 archived_at: number;
258 discarded_at: number;
259 created_at: number;
260 updated_at: number;
261 }
262 export interface Period {
263 id: string;
264 object: 'period';
265 ad_hoc_amount?: number;
266 checkout: string | Checkout;
267 customer_id: string | Customer;
268 end_at?: number;
269 next_payment_retry_at: number;
270 payment_retry_count: number;
271 price: string | Price;
272 purchase_id: string | Purchase;
273 quantity: number;
274 renewal: boolean;
275 skip_proration: boolean;
276 start_at: number;
277 status: 'draft';
278 subscription: string | Subscription;
279 created_at: number;
280 updated_at: number;
281 }
282 export interface Activation {
283 id: string;
284 object: 'activation';
285 name: string;
286 counted: boolean;
287 fingerprint: string;
288 license: string | License;
289 created_at: number;
290 updated_at: number;
291 }
292 export interface Variant {
293 id: string;
294 amount: number;
295 available_stock: number;
296 currency: string;
297 current_version: boolean;
298 held_stock: number;
299 stock: number;
300 object: 'variant';
301 image?: string | Media;
302 image_url?: string;
303 option_1?: string | null;
304 option_2?: string | null;
305 option_3?: string | null;
306 position: number;
307 product: string | Product;
308 sku?: string | null;
309 created_at: number;
310 updated_at: number;
311 }
312 export interface ProductMetrics {
313 currency: string;
314 max_price_amount: number;
315 min_price_amount: number;
316 prices_count: number;
317 }
318 export interface Product extends Object {
319 id: string;
320 name: string;
321 description: string;
322 archived: boolean;
323 archived_at: string;
324 metadata: any;
325 image_url: string;
326 recurring: boolean;
327 tax_category: string;
328 tax_enabled: boolean;
329 purchase_limit: number;
330 metrics: ProductMetrics;
331 line_item_image: ImageAttributes;
332 permalink: string;
333 weight: number;
334 weight_unit: 'kg' | 'lb' | 'g' | 'oz';
335 featured_product_media?: string | ProductMedia;
336 prices: {
337 object: 'list';
338 pagination: Pagination;
339 data: Array<Price>;
340 };
341 variants: {
342 object: 'list';
343 pagination: Pagination;
344 data: Array<Variant>;
345 };
346 variant_options: {
347 object: 'list';
348 pagination: Pagination;
349 data: Array<VariantOption>;
350 };
351 product_medias: {
352 object: 'list';
353 pagination: Pagination;
354 data: Array<ProductMedia>;
355 };
356 downloads: {
357 object: 'list';
358 pagination: Pagination;
359 data: Array<Download>;
360 };
361 product_collections: {
362 object: 'list';
363 pagination: Pagination;
364 data: Array<Collection>;
365 };
366 stock_enabled: boolean;
367 allow_out_of_stock_purchases: boolean;
368 stock: number;
369 available_stock: number;
370 held_stock: number;
371 created_at: number;
372 updated_at: number;
373 }
374 export type Products = {
375 [id: string]: Product;
376 };
377 export interface Collection extends Object {
378 id: string;
379 name: string;
380 description: string;
381 image_url: string;
382 created_at: number;
383 updated_at: number;
384 }
385 export interface Coupon extends Model {
386 id: string;
387 object: 'coupon';
388 amount_off: number;
389 valid?: boolean;
390 expired: boolean;
391 currency: string;
392 duration: string;
393 duration_in_months: number;
394 max_redemptions: number;
395 metadata: Object;
396 name: string;
397 percent_off: number;
398 redeem_by: number;
399 times_redeemed: number;
400 }
401 export interface LineItemData extends Object {
402 id?: string;
403 price_id?: string;
404 variant_id?: string;
405 bump?: string;
406 quantity: number;
407 ad_hoc_amount?: number;
408 variant?: string;
409 }
410 export type LineItemsData = {
411 [id: string]: Array<LineItemData>;
412 };
413 export interface ImageAttributes {
414 src: string;
415 alt?: string;
416 class?: string;
417 decoding?: string;
418 height?: number;
419 loading?: string;
420 sizes?: string;
421 srcset?: string;
422 width?: number;
423 }
424 export interface LineItem extends Object {
425 id?: string;
426 ad_hoc_amount?: number;
427 name: string;
428 object: string;
429 quantity: number;
430 checkout: string | Checkout;
431 bump: string | Bump;
432 image: ImageAttributes;
433 fees?: {
434 object: 'list';
435 pagination: Pagination;
436 data: Array<Fee>;
437 };
438 bump_amount: number;
439 discount_amount: number;
440 subtotal_amount: number;
441 total_amount: number;
442 trial_amount: number;
443 tax_amount: number;
444 fees_amount: number;
445 scratch_amount: number;
446 trial: boolean;
447 total_savings_amount: number;
448 created_at: number;
449 updated_at: number;
450 price?: Price;
451 price_id: string;
452 purchasable_status: 'price_gone' | 'price_old_version' | 'variant_mising' | 'variant_gone' | 'variant_old_version' | 'out_of_stock' | 'exceeds_purchase_limit' | 'purchasable';
453 purchasable_status_display: string;
454 variant_options: Array<string>;
455 variant?: Variant;
456 }
457 export interface DeletedItem {
458 cache_status: string;
459 deleted: boolean;
460 id: string;
461 object: string;
462 }
463 export interface Fee {
464 id: string;
465 object: 'fee';
466 amount: number;
467 description: string;
468 fee_type: 'manual' | 'bump' | 'setup' | 'upsell';
469 line_item: string | LineItem;
470 created_at: number;
471 updated_at: number;
472 }
473 export interface InvoiceItem extends LineItem {
474 }
475 export interface PriceChoice {
476 id: string;
477 product_id: string;
478 quantity: number;
479 enabled: boolean;
480 selected?: boolean;
481 variant?: string | null;
482 }
483 export type CheckoutState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalized' | 'paid' | 'failure';
484 export type TaxStatus = 'disabled' | 'address_invalid' | 'reverse_charged' | 'tax_registration_not_found' | 'tax_zone_not_found' | 'estimated' | 'calculated';
485 export interface Invoice extends Object {
486 id: string;
487 object: 'invoice';
488 currency: string;
489 amount_due: number;
490 invoice_items: {
491 object: 'list';
492 pagination: Pagination;
493 data: Array<InvoiceItem>;
494 };
495 discount_amount: number;
496 live_mode: boolean;
497 metadata: object;
498 number: string;
499 period_end_at: number;
500 period_start_at: number;
501 proration_amount: number;
502 processor_data: {
503 stripe: object;
504 };
505 status: OrderStatus;
506 subtotal_amount: number;
507 tax_amount: number;
508 tax_status: TaxStatus;
509 tax_label: string;
510 total_amount: number;
511 billing_address: string | BillingAddress;
512 charge: string | Charge;
513 customer: string | Customer;
514 discount: string | object;
515 payment_intent: string | PaymentIntent;
516 payment_method: string | PaymentMethod;
517 shipping_address: string | ShippingAddress;
518 subscription: string | Subscription;
519 tax_identifier: string | object;
520 url: string;
521 created_at: number;
522 updated_at: number;
523 }
524 export interface BillingAddress extends Address {
525 }
526 export interface ShippingAddress extends Address {
527 }
528 export interface ProductGroup {
529 id: string;
530 object: 'product_group';
531 archived: boolean;
532 archived_at: number;
533 metadata: object;
534 name: string;
535 created_at: number;
536 updated_at: number;
537 }
538 export interface ProductMedia {
539 id: string;
540 object: 'product_media';
541 position: number;
542 url: null;
543 media: string | Media;
544 product: string | Product;
545 created_at: number;
546 updated_at: number;
547 }
548 export interface Charge extends Object {
549 amount: number;
550 created_at: number;
551 currency: string;
552 customer: string | Customer;
553 external_charge_id: string;
554 fully_refunded: boolean;
555 id: string;
556 invoice: string | Invoice;
557 live_mode: boolean;
558 object: 'charge';
559 checkout: string | Checkout;
560 payment_method: string | PaymentMethod;
561 refunded_amount: number;
562 status: 'pending' | 'succeeded' | 'failed';
563 updated_at: number;
564 }
565 export interface TaxIdentifier {
566 id: string;
567 number: string;
568 number_type: string;
569 object: 'tax_identifier';
570 eu_vat_verified: boolean;
571 created_at: number;
572 updated_at: number;
573 }
574 export interface TaxProtocol {
575 id: string;
576 object: 'tax_protocol';
577 ca_tax_enabled: boolean;
578 eu_micro_exemption_enabled: boolean;
579 eu_tax_enabled: boolean;
580 eu_vat_required: boolean;
581 eu_vat_unverified_behavior: 'error' | 'apply_reverse_charge' | 'skip_reverse_charge';
582 eu_vat_local_reverse_charge: boolean;
583 tax_enabled: boolean;
584 address: string | Address;
585 ca_tax_identifier: string | TaxIdentifier;
586 eu_tax_identifier: string | TaxIdentifier;
587 created_at: number;
588 updated_at: number;
589 }
590 export interface Order extends Object {
591 id?: string;
592 object: 'order';
593 number?: string;
594 order_type?: 'checkout' | 'subscription';
595 statement_url?: string;
596 status?: OrderStatus;
597 shipment_status?: OrderShipmentStatus;
598 checkout?: Checkout | string;
599 created_at: number;
600 updated_at: number;
601 }
602 export interface ShippingChoice {
603 amount: number;
604 checkout: string | Checkout;
605 currency: string;
606 id: string;
607 object: 'shipping_choice';
608 shipping_method: string | ShippingMethod;
609 created_at: number;
610 updated_at: number;
611 }
612 export interface ShippingMethod {
613 name: string;
614 description: string;
615 id: string;
616 object: 'shipping_method';
617 position: number;
618 created_at: number;
619 updated_at: number;
620 }
621 export interface Checkout extends Object {
622 id?: string;
623 status?: 'canceled' | 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'processing';
624 staged_payment_intents: {
625 object: 'list';
626 pagination: Pagination;
627 data: Array<PaymentIntent>;
628 };
629 abandoned_checkout_enabled: boolean;
630 billing_matches_shipping: boolean;
631 bump_amount: number;
632 payment_method_required?: boolean;
633 manual_payment: boolean;
634 manual_payment_method?: string | ManualPaymentMethod;
635 reusable_payment_method_required?: boolean;
636 number?: string;
637 amount_due?: number;
638 trial_amount?: number;
639 charge?: string | Charge;
640 name?: string;
641 first_name?: string;
642 last_name?: string;
643 email?: string;
644 phone?: string;
645 live_mode?: boolean;
646 currency?: string;
647 total_amount?: number;
648 subtotal_amount?: number;
649 full_amount?: number;
650 proration_amount?: number;
651 total_savings_amount?: number;
652 applied_balance_amount?: number;
653 discounts?: number;
654 shipping_address_required?: boolean;
655 tax_enabled: boolean;
656 tax_amount: number;
657 email_exists: boolean;
658 tax_inclusive_amount: number;
659 tax_exclusive_amount: number;
660 tax_status: 'disabled' | 'address_invalid' | 'estimated' | 'calculated';
661 tax_label: string;
662 tax_percent: number;
663 line_items: lineItems;
664 recommended_bumps?: {
665 object: 'list';
666 pagination: Pagination;
667 data: Array<Bump>;
668 };
669 current_upsell: Upsell;
670 recommended_upsells?: {
671 object: 'list';
672 pagination: Pagination;
673 data: Array<Upsell>;
674 };
675 metadata?: any;
676 payment_intent?: PaymentIntent;
677 payment_method?: PaymentMethod;
678 order?: string | Order;
679 customer: string | Customer;
680 subscriptions: {
681 object: 'list';
682 pagination: Pagination;
683 data: Array<Subscription>;
684 };
685 purchases: {
686 object: 'list';
687 pagination: Pagination;
688 data: Array<Purchase>;
689 };
690 discount_amount?: number;
691 discount?: DiscountResponse;
692 billing_address?: string | Address;
693 shipping_amount?: number;
694 shipping_address?: string | Address;
695 shipping_enabled?: boolean;
696 shipping_choices?: {
697 object: 'list';
698 pagination: Pagination;
699 data: Array<ShippingChoice>;
700 };
701 selected_shipping_choice?: string | ShippingChoice;
702 selected_shipping_choice_required: boolean;
703 processor_data?: ProcessorData;
704 tax_identifier?: {
705 number: string;
706 number_type: string;
707 };
708 url: string;
709 created_at?: number;
710 updated_at: number;
711 variant: string;
712 upsells_expire_at?: number;
713 }
714 export interface ShippingMethod {
715 id: string;
716 object: 'shipping_method';
717 description: string | null;
718 name: string;
719 position: number;
720 created_at: number;
721 updated_at: number;
722 }
723 export interface ShippingChoice {
724 id: string;
725 object: 'shipping_choice';
726 amount: number;
727 currency: string;
728 checkout: string | Checkout;
729 shipping_method: string | ShippingMethod;
730 created_at: number;
731 updated_at: number;
732 }
733 export interface ProcessorData {
734 stripe: {
735 account_id: string;
736 publishable_key: string;
737 client_secret?: string;
738 type: 'payment' | 'setup';
739 };
740 paypal: {
741 account_id: string;
742 client_id: string;
743 merchant_initiated: boolean;
744 };
745 mollie?: {
746 account_id: 'string';
747 checkout_url: 'string';
748 };
749 paystack: {
750 account_id: string;
751 public_key: string;
752 access_code: string;
753 };
754 }
755 export interface ManualPaymentMethod {
756 id: string;
757 object: 'manual_payment_method';
758 archived: boolean;
759 archived_at: number;
760 description: string;
761 instructions: string;
762 name: string;
763 created_at: number;
764 updated_at: number;
765 }
766 export interface PaymentMethodType {
767 id: string;
768 description: string;
769 image: string;
770 }
771 export interface Processor {
772 id: string;
773 live_mode: boolean;
774 processor_data: {
775 account_id: string;
776 recurring_enabled: boolean;
777 client_id: string;
778 merchant_initiated?: boolean;
779 };
780 recurring_enabled: boolean;
781 supported_currencies: Array<string>;
782 processor_type: 'paypal' | 'stripe' | 'mollie' | 'mock';
783 }
784 export interface Purchase {
785 id: string;
786 object: 'purchase';
787 live_mode: boolean;
788 quantity: number;
789 revoked: boolean;
790 revoked_at: number;
791 customer: string | Customer;
792 invoice_item: string | InvoiceItem;
793 invoice: string | Invoice;
794 line_item: string | LineItem;
795 order: string | Order;
796 product: string | Product;
797 refund: string | Refund;
798 subscription: string | Subscription;
799 license: string | License;
800 created_at: number;
801 updated_at: number;
802 }
803 export interface Refund {
804 id: string;
805 object: 'refund';
806 amount: number;
807 currency: string;
808 external_refund_id: string;
809 live_mode: boolean;
810 metadata: object;
811 reason: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'expired_uncaptured_charge';
812 status: 'pending' | 'succeeded' | 'failed' | 'canceled';
813 charge: string | Charge;
814 customer: string | Customer;
815 revoked_purchases: null | Array<Purchase>;
816 created_at: number;
817 updated_at: number;
818 }
819 export interface Subscription extends Object {
820 id: string;
821 object: 'subscription';
822 currency?: string;
823 status: SubscriptionStatus;
824 live_mode: boolean;
825 external_subscription_id: string;
826 current_cancellation_act: string | CancellationAct;
827 trial_end_at: number;
828 processor_type: 'stripe' | 'paypal';
829 order: Order;
830 customer: Customer;
831 discount: DiscountResponse;
832 finite: boolean;
833 pending_update: {
834 ad_hoc_amount?: number;
835 price?: string;
836 quantity?: number;
837 variant?: string;
838 };
839 purchase: Purchase | string;
840 cancel_at_period_end: number | false;
841 current_period: string | Period;
842 current_period_end_at: number | false;
843 current_period_start_at: number | false;
844 remaining_period_count: number | null;
845 ended_at: number;
846 end_behavior: 'cancel' | 'complete';
847 payment_method: PaymentMethod | string;
848 manual_payment_method: ManualPaymentMethod | string;
849 manual_payment: boolean;
850 price: Price;
851 ad_hoc_amount: number;
852 variant?: Variant | string;
853 variant_options?: Array<string>;
854 created_at: number;
855 updated_at: number;
856 restore_at?: number;
857 }
858 export interface CancellationAct {
859 id: string;
860 object: 'cancellation_act';
861 cancellation_reason: string | CancellationReason;
862 comment: string;
863 coupon_applied: boolean;
864 preserved: boolean;
865 subscription: string | Subscription;
866 performed_at: number;
867 created_at: number;
868 updated_at: number;
869 }
870 export interface SubscriptionProtocol {
871 id: string;
872 object: 'subscription_protocol';
873 cancel_behavior: 'pending' | 'immediate';
874 downgrade_behavior: 'pending' | 'immediate';
875 payment_retry_window_weeks: number;
876 upgrade_behavior: 'pending' | 'immediate';
877 preservation_enabled: boolean;
878 preservation_locales: {
879 reasons_title: string;
880 reasons_description: string;
881 skip_link: string;
882 preserve_title: string;
883 preserve_description: string;
884 preserve_button: string;
885 cancel_link: string;
886 };
887 preservation_coupon: Coupon | string;
888 created_at: number;
889 updated_at: number;
890 }
891 export type SubscriptionStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'completed';
892 export type CheckoutStatus = 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'requires_approval';
893 export type OrderStatus = 'paid' | 'payment_failed' | 'processing' | 'void' | 'canceled';
894 export type OrderFulFillmentStatus = 'fulfilled' | 'unfulfilled' | 'partially_fulfilled' | 'scheduled' | 'on_hold';
895 export type OrderShipmentStatus = 'unshipped' | 'shipped' | 'partially_shipped' | 'delivered' | 'unshippable';
896 export type FulfillmentStatus = 'unshipped' | 'shipped' | 'delivered' | 'unshippable';
897 export type ReturnRequestStatus = 'open' | 'completed';
898 export interface PaymentMethod extends Object {
899 id: string;
900 object: 'payment_method';
901 live_mode: boolean;
902 external_payment_method_id: string;
903 processor_type: 'stripe' | 'paypal';
904 paypal_account: any;
905 type: string;
906 bank_account: BankAccount | string;
907 payment_instrument: PaymentInstrument | string;
908 payment_intent: PaymentIntent | string;
909 billing_agreement?: BillingAgreement | string;
910 card: any;
911 customer: Customer | string;
912 created_at: number;
913 updated_at: number;
914 }
915 export interface BankAccount {
916 id: string;
917 account_type: 'checking' | 'savings';
918 account_holder_type: 'individual' | 'company';
919 bank_name: string;
920 last4: string;
921 created_at: number;
922 updated_at: number;
923 }
924 export interface PaymentInstrument {
925 id: string;
926 instrument_type: string;
927 metadata: any;
928 object: 'payment_instrument';
929 created_at: number;
930 updated_at: number;
931 }
932 export interface BillingAgreement {
933 email: string;
934 external_customer_id: string;
935 first_name: string;
936 id: string;
937 last_name: string;
938 phone: string;
939 object: 'billing_agreement';
940 created_at: number;
941 updated_at: number;
942 }
943 export interface Pagination {
944 count: number;
945 limit: number;
946 page: number;
947 url: string;
948 }
949 export interface lineItems extends Object {
950 object: 'list';
951 pagination: Pagination;
952 data: Array<LineItem>;
953 }
954 export interface Promotion extends Object {
955 code: string;
956 created_at: number;
957 expired: boolean;
958 id: string;
959 max_redemptions: number;
960 metadata: Object;
961 object: 'promotion';
962 redeem_by: string;
963 times_redeemed: number;
964 }
965 export interface DiscountResponse {
966 coupon?: Coupon;
967 id: string;
968 object: 'discount';
969 promotion: Promotion;
970 redeemable_status: string;
971 }
972 export interface ResponseError {
973 code?: string;
974 message: string;
975 data?: {
976 http_status: string;
977 status?: number;
978 type: string;
979 };
980 additional_errors?: Array<{
981 code: string;
982 message: string;
983 data: {
984 attribute: string;
985 options: Array<string>;
986 type: string;
987 };
988 }>;
989 }
990 export type ProcessorName = 'stripe' | 'paypal' | 'paypal-card';
991 export interface VerificationCode {
992 id: string;
993 object: 'verification_code';
994 code: number;
995 verified: boolean;
996 verified_at: number | null;
997 created_at: number;
998 updated_at: number;
999 }
1000 export interface PaymentIntent extends Object {
1001 id: string;
1002 object: 'payment_intent';
1003 amount: number;
1004 currency: string;
1005 processor_type: 'stripe' | 'paypal';
1006 status: 'pending' | 'succeeded' | 'canceled';
1007 external_intent_id: string;
1008 live_mode: boolean;
1009 processor_data: ProcessorData;
1010 customer: Customer | string;
1011 created_at: number;
1012 updated_at: number;
1013 payment_method: PaymentMethod | string;
1014 }
1015 export interface PaymentIntents {
1016 stripe?: PaymentIntent;
1017 paypal?: PaymentIntent;
1018 }
1019 export interface SetupIntent extends Object {
1020 id: string;
1021 object: 'setup_intent';
1022 processor_type: 'stripe' | 'paypal';
1023 status: 'pending' | 'succeeded' | 'canceled';
1024 external_intent_id: string;
1025 live_mode: boolean;
1026 processor_data: ProcessorData;
1027 customer: Customer | string;
1028 created_at: number;
1029 updated_at: number;
1030 }
1031 export interface WordPressUser {
1032 id: number;
1033 display_name: string;
1034 first_name: string;
1035 last_name: string;
1036 email: string;
1037 }
1038 export interface Customer extends Object {
1039 id: string;
1040 email: string;
1041 name?: string;
1042 first_name?: string;
1043 last_name?: string;
1044 phone?: string;
1045 billing_address?: string | Address;
1046 billing_address_display?: string | Address;
1047 shipping_address?: string | Address;
1048 billing_matches_shipping: boolean;
1049 live_mode: boolean;
1050 unsubscribed: boolean;
1051 default_payment_method: string | PaymentMethod;
1052 tax_identifier: {
1053 number: string;
1054 number_type: string;
1055 };
1056 created_at: number;
1057 updated_at: number;
1058 }
1059 export interface Address extends Object {
1060 name?: string;
1061 line_1?: string;
1062 line_2?: string;
1063 city?: string;
1064 state?: string;
1065 postal_code?: string;
1066 country?: string;
1067 }
1068 export interface Fulfillment {
1069 id: string;
1070 object: 'fulfillment';
1071 number: string;
1072 shipment_status: FulfillmentStatus;
1073 trackings: {
1074 object: 'list';
1075 pagination: Pagination;
1076 data: Array<Tracking>;
1077 };
1078 fulfillment_items: {
1079 object: 'list';
1080 pagination: Pagination;
1081 data: Array<FulfillmentItem>;
1082 };
1083 }
1084 export interface FulfillmentItem {
1085 id: string;
1086 line_item: LineItem;
1087 quantity: number;
1088 fulfillment: string | Fulfillment;
1089 }
1090 export interface Tracking {
1091 courier_name?: string;
1092 number: string;
1093 url: string;
1094 }
1095 export interface PriceData extends Object {
1096 price_id: string;
1097 quantity: number;
1098 removeable: boolean;
1099 }
1100 export type TaxZone = {
1101 label: string;
1102 label_small: string;
1103 };
1104 export type TaxZones = {
1105 [key in 'ca_gst' | 'au_abn' | 'gb_vat' | 'eu_vat' | 'other']: TaxZone;
1106 };
1107 export type RuleName = 'total' | 'coupons' | 'products' | 'shipping_country' | 'billing_country' | 'processors';
1108 export type ArrayOperators = 'all' | 'any' | 'none' | 'exist' | 'not_exist';
1109 export type NumberOperators = '==' | '!=' | '<' | '>' | '<=' | '>=';
1110 export interface RuleGroup {
1111 group_id: string;
1112 rules: Rule[];
1113 }
1114 export interface Rule {
1115 condition: RuleName;
1116 operator: NumberOperators | ArrayOperators;
1117 value: string | string[] | {
1118 value: string;
1119 }[];
1120 }
1121 export interface ProductCollection {
1122 id: string;
1123 object: string;
1124 name: string;
1125 description?: string;
1126 position?: number;
1127 slug: string;
1128 image?: string;
1129 products_count: number;
1130 products?: Product[];
1131 }
1132 export interface GoogleAnalyticsItem {
1133 item_id: string;
1134 item_name: string;
1135 item_variant?: string;
1136 item_category?: string;
1137 item_category2?: string;
1138 item_category3?: string;
1139 item_category4?: string;
1140 item_category5?: string;
1141 price: number;
1142 quantity: number;
1143 coupon?: string;
1144 currency: string;
1145 discount?: number;
1146 }
1147 export interface ProductState {
1148 formId: number;
1149 mode: 'live' | 'test';
1150 product: Product;
1151 prices: Price[];
1152 variants: Variant[];
1153 variant_options: VariantOption[];
1154 quantity: number;
1155 selectedPrice: Price;
1156 total: number;
1157 busy: boolean;
1158 disabled: boolean;
1159 checkoutUrl: string;
1160 adHocAmount: number;
1161 dialog: string;
1162 line_item: LineItemData;
1163 error: string;
1164 selectedVariant?: Variant;
1165 variantValues: {
1166 option_1?: string;
1167 option_2?: string;
1168 option_3?: string;
1169 };
1170 isProductPage?: boolean;
1171 }
1172 export interface FeaturedProductMediaAttributes {
1173 alt: string;
1174 url: string;
1175 title: string;
1176 }
1177 export interface PaymentInfoAddedParams {
1178 checkout_id: string;
1179 processor_type: 'paypal' | 'stripe' | 'mollie' | 'paystack';
1180 currency: string;
1181 total_amount: number;
1182 line_items?: lineItems;
1183 payment_method: {
1184 billing_details: {
1185 name: string;
1186 email: string;
1187 };
1188 };
1189 }
1190 export interface CheckoutInitiatedParams {
1191 transaction_id: string;
1192 value: number;
1193 currency: string;
1194 coupon?: string;
1195 tax?: number;
1196 items: Array<{
1197 item_name: string;
1198 discount: number;
1199 price: number;
1200 quantity: number;
1201 }>;
1202 }
1203 export interface ProductsSearchedParams {
1204 searchString: string;
1205 searchCollections?: string[];
1206 searchResultCount: number;
1207 searchResultIds: string[];
1208 }
1209 export interface ProductsViewedParams {
1210 products: Product[];
1211 pageTitle: string;
1212 collectionId?: string;
1213 }
1214 export type NoticeType = 'default' | 'info' | 'success' | 'warning' | 'error';
1215 interface AdditionalError {
1216 code: string;
1217 message: string;
1218 data: {
1219 attribute: string;
1220 type: string;
1221 options: {
1222 if: string[];
1223 value: string;
1224 };
1225 };
1226 }
1227 export interface ScNoticeStore {
1228 type: NoticeType | 'default';
1229 code: string;
1230 message: string;
1231 data?: {
1232 status: number;
1233 type: string;
1234 http_status: string;
1235 };
1236 additional_errors?: AdditionalError[] | null;
1237 dismissible?: boolean;
1238 }
1239 export interface CustomStripeElementChangeEvent extends StripeElementChangeEvent {
1240 value?: {
1241 type: string;
1242 };
1243 }
1244 export {};
1245