PluginProbe ʕ •ᴥ•ʔ
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 2.13.0
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v2.13.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 3 years ago services 2 years ago store 2 years ago testing 3 years ago components.d.ts 2 years ago global.d.ts 3 years ago index.d.ts 2 years ago stencil-public-runtime.d.ts 3 years ago types.d.ts 2 years ago
types.d.ts
1084 lines
1 import { ObservableMap } from '@stencil/store';
2 import { IconLibraryMutator, IconLibraryResolver } from './components/ui/icon/library';
3 declare global {
4 interface Window {
5 grecaptcha: any;
6 surecart?: {
7 product?: {
8 store: ObservableMap<any>;
9 state: any;
10 update: Function;
11 };
12 };
13 wp: {
14 apiFetch: any;
15 blocks: any;
16 i18n: any;
17 };
18 dataLayer: any;
19 gtag: any;
20 sc?: {
21 store?: {
22 product?: any;
23 };
24 };
25 scStore: any;
26 registerSureCartIconPath: (path: string) => void;
27 registerSureCartIconLibrary: (name: string, options: {
28 resolver: IconLibraryResolver;
29 mutator?: IconLibraryMutator;
30 }) => void;
31 scIcons: {
32 path: string;
33 };
34 scData: {
35 cdn_root: string;
36 root_url: string;
37 page_id: string;
38 do_not_persist_cart: boolean;
39 nonce: string;
40 base_url: string;
41 nonce_endpoint: string;
42 recaptcha_site_key: string;
43 theme: string;
44 product_data: {
45 checkout_link: string;
46 mode: 'live' | 'test';
47 form: {
48 ID: number;
49 };
50 product: Product;
51 };
52 pages: {
53 dashboard: string;
54 checkout: string;
55 };
56 currency: string;
57 is_claimed: string;
58 claim_url: string;
59 admin_url: string;
60 user_permissions: {
61 manage_sc_shop_settings: boolean;
62 };
63 };
64 ceRegisterIconLibrary: any;
65 ResizeObserver: any;
66 }
67 }
68 export type RecursivePartial<T> = {
69 [P in keyof T]?: RecursivePartial<T[P]>;
70 };
71 interface Model {
72 created_at: number;
73 updated_at: number;
74 }
75 export interface ChoiceItem extends Object {
76 value: string;
77 label: string;
78 description?: string;
79 disabled?: boolean;
80 checked?: boolean;
81 unavailable?: boolean;
82 choices?: ChoiceItem[];
83 suffix?: string;
84 suffixDescription?: string;
85 icon?: string;
86 }
87 export type ChoiceType = 'all' | 'single' | 'multiple';
88 export interface Price {
89 id: string;
90 name: string;
91 description?: string;
92 amount: number;
93 currency: string;
94 recurring: boolean;
95 recurring_interval?: 'week' | 'month' | 'year' | 'never';
96 recurring_interval_count?: number;
97 trial_duration_days?: number;
98 ad_hoc: boolean;
99 ad_hoc_max_amount: number;
100 ad_hoc_min_amount: number;
101 scratch_amount: number;
102 setup_fee_enabled: boolean;
103 setup_fee_amount: number;
104 setup_fee_name: string;
105 setup_fee_trial_enabled: boolean;
106 recurring_period_count: number;
107 archived: boolean;
108 product_id?: string;
109 archived_at?: string;
110 created_at: number;
111 updated_at: number;
112 product?: Product | string;
113 position: number;
114 metadata: {
115 [key: string]: string;
116 };
117 }
118 export interface VariantOption {
119 id: string;
120 object: string;
121 name: string;
122 position: number;
123 product: Product | string;
124 updated_at: number;
125 created_at: number;
126 label: string;
127 labels: string;
128 values: Array<string>;
129 }
130 export interface Bump {
131 id: string;
132 object: 'bump';
133 amount_off: number;
134 archived: boolean;
135 archived_at: number;
136 auto_apply: boolean;
137 filter_match_type: 'all' | 'any' | 'none';
138 filters: any;
139 metadata: any;
140 name: string;
141 percent_off: number;
142 price: string | Price;
143 priority: 1 | 2 | 3 | 4 | 5;
144 created_at: number;
145 updated_at: number;
146 }
147 export type Prices = {
148 [id: string]: Price;
149 };
150 export interface Media {
151 id: string;
152 object: 'media';
153 byte_size: number;
154 content_type: string;
155 extension: string;
156 filename: string;
157 public_access: boolean;
158 release_json: any;
159 alt: string;
160 title: string;
161 url?: string;
162 url_expires_at?: number;
163 updated_at: number;
164 created_at: number;
165 }
166 export interface Download {
167 id: string;
168 object: 'download';
169 archived: boolean;
170 archived_at?: number;
171 media: string | Media;
172 name?: string;
173 product: string | Product;
174 update_at: number;
175 created_at: number;
176 url?: string;
177 }
178 export type FormState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalizing' | 'paying' | 'confirming' | 'confirmed' | 'paid' | 'failure' | 'expired' | 'redirecting';
179 export type FormStateSetter = 'RESOLVE' | 'REJECT' | 'FINALIZE' | 'PAYING' | 'PAID' | 'EXPIRE' | 'FETCH';
180 export interface License {
181 id: string;
182 object: 'license';
183 activation_limit: number;
184 key: string;
185 activations?: {
186 object: 'list';
187 pagination: Pagination;
188 data: Array<Activation>;
189 };
190 status: 'inactive' | 'active' | 'revoked';
191 purchase: string | Purchase;
192 created_at: number;
193 updated_at: number;
194 }
195 export interface CancellationReason {
196 id: string;
197 object: 'cancellation_reason';
198 archived: boolean;
199 comment_enabled: false;
200 comment_prompt: string | null;
201 coupon_enabled: boolean;
202 label: string;
203 position: number;
204 archived_at: number;
205 discarded_at: number;
206 created_at: number;
207 updated_at: number;
208 }
209 export interface Period {
210 id: string;
211 object: 'period';
212 ad_hoc_amount?: number;
213 checkout: string | Checkout;
214 customer_id: string | Customer;
215 end_at?: number;
216 next_payment_retry_at: number;
217 payment_retry_count: number;
218 price: string | Price;
219 purchase_id: string | Purchase;
220 quantity: number;
221 renewal: boolean;
222 skip_proration: boolean;
223 start_at: number;
224 status: 'draft';
225 subscription: string | Subscription;
226 created_at: number;
227 updated_at: number;
228 }
229 export interface Activation {
230 id: string;
231 object: 'activation';
232 name: string;
233 counted: boolean;
234 fingerprint: string;
235 license: string | License;
236 created_at: number;
237 updated_at: number;
238 }
239 export interface Variant {
240 id: string;
241 amount: number;
242 available_stock: number;
243 currency: string;
244 current_version: boolean;
245 held_stock: number;
246 stock: number;
247 object: 'variant';
248 image?: string | Media;
249 image_url?: string;
250 option_1?: string | null;
251 option_2?: string | null;
252 option_3?: string | null;
253 position: number;
254 product: string | Product;
255 sku?: string | null;
256 created_at: number;
257 updated_at: number;
258 }
259 export interface ProductMetrics {
260 currency: string;
261 max_price_amount: number;
262 min_price_amount: number;
263 prices_count: number;
264 }
265 export interface Product extends Object {
266 id: string;
267 name: string;
268 description: string;
269 archived: boolean;
270 archived_at: string;
271 metadata: any;
272 image_url: string;
273 recurring: boolean;
274 tax_category: string;
275 tax_enabled: boolean;
276 purchase_limit: number;
277 metrics: ProductMetrics;
278 permalink: string;
279 weight: number;
280 weight_unit: 'kg' | 'lb' | 'g' | 'oz';
281 featured_product_media?: string | ProductMedia;
282 prices: {
283 object: 'list';
284 pagination: Pagination;
285 data: Array<Price>;
286 };
287 variants: {
288 object: 'list';
289 pagination: Pagination;
290 data: Array<Variant>;
291 };
292 variant_options: {
293 object: 'list';
294 pagination: Pagination;
295 data: Array<VariantOption>;
296 };
297 product_medias: {
298 object: 'list';
299 pagination: Pagination;
300 data: Array<ProductMedia>;
301 };
302 downloads: {
303 object: 'list';
304 pagination: Pagination;
305 data: Array<Download>;
306 };
307 stock_enabled: boolean;
308 allow_out_of_stock_purchases: boolean;
309 stock: number;
310 available_stock: number;
311 held_stock: number;
312 created_at: number;
313 updated_at: number;
314 }
315 export type Products = {
316 [id: string]: Product;
317 };
318 export interface Collection extends Object {
319 id: string;
320 name: string;
321 description: string;
322 image_url: string;
323 created_at: number;
324 updated_at: number;
325 }
326 export interface Coupon extends Model {
327 id: string;
328 object: 'coupon';
329 amount_off: number;
330 valid?: boolean;
331 expired: boolean;
332 currency: string;
333 duration: string;
334 duration_in_months: number;
335 max_redemptions: number;
336 metadata: Object;
337 name: string;
338 percent_off: number;
339 redeem_by: number;
340 times_redeemed: number;
341 }
342 export interface LineItemData extends Object {
343 id?: string;
344 price_id?: string;
345 bump?: string;
346 quantity: number;
347 ad_hoc_amount?: number;
348 variant?: string;
349 }
350 export type LineItemsData = {
351 [id: string]: Array<LineItemData>;
352 };
353 export interface LineItem extends Object {
354 id?: string;
355 ad_hoc_amount?: number;
356 name: string;
357 object: string;
358 quantity: number;
359 checkout: string | Checkout;
360 bump: string | Bump;
361 fees?: {
362 object: 'list';
363 pagination: Pagination;
364 data: Array<Fee>;
365 };
366 bump_amount: number;
367 discount_amount: number;
368 subtotal_amount: number;
369 total_amount: number;
370 scratch_amount: number;
371 total_savings_amount: number;
372 created_at: number;
373 updated_at: number;
374 price?: Price;
375 price_id: string;
376 variant_options: Array<string>;
377 variant?: Variant;
378 }
379 export interface DeletedItem {
380 cache_status: string;
381 deleted: boolean;
382 id: string;
383 object: string;
384 }
385 export interface Fee {
386 id: string;
387 object: 'fee';
388 amount: number;
389 description: string;
390 fee_type: 'manual' | 'bump' | 'setup';
391 line_item: string | LineItem;
392 created_at: number;
393 updated_at: number;
394 }
395 export interface InvoiceItem extends LineItem {
396 }
397 export interface PriceChoice {
398 id: string;
399 product_id: string;
400 quantity: number;
401 enabled: boolean;
402 selected?: boolean;
403 variant?: string | null;
404 }
405 export type CheckoutState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalized' | 'paid' | 'failure';
406 export type TaxStatus = 'disabled' | 'address_invalid' | 'reverse_charged' | 'tax_registration_not_found' | 'tax_zone_not_found' | 'estimated' | 'calculated';
407 export interface Invoice extends Object {
408 id: string;
409 object: 'invoice';
410 currency: string;
411 amount_due: number;
412 invoice_items: {
413 object: 'list';
414 pagination: Pagination;
415 data: Array<InvoiceItem>;
416 };
417 discount_amount: number;
418 live_mode: boolean;
419 metadata: object;
420 number: string;
421 period_end_at: number;
422 period_start_at: number;
423 proration_amount: number;
424 processor_data: {
425 stripe: object;
426 };
427 status: OrderStatus;
428 subtotal_amount: number;
429 tax_amount: number;
430 tax_status: TaxStatus;
431 tax_label: string;
432 total_amount: number;
433 billing_address: string | BillingAddress;
434 charge: string | Charge;
435 customer: string | Customer;
436 discount: string | object;
437 payment_intent: string | PaymentIntent;
438 payment_method: string | PaymentMethod;
439 shipping_address: string | ShippingAddress;
440 subscription: string | Subscription;
441 tax_identifier: string | object;
442 url: string;
443 created_at: number;
444 updated_at: number;
445 }
446 export interface BillingAddress extends Address {
447 }
448 export interface ShippingAddress extends Address {
449 }
450 export interface ProductGroup {
451 id: string;
452 object: 'product_group';
453 archived: boolean;
454 archived_at: number;
455 metadata: object;
456 name: string;
457 created_at: number;
458 updated_at: number;
459 }
460 export interface ProductMedia {
461 id: string;
462 object: 'product_media';
463 position: number;
464 url: null;
465 media: string | Media;
466 product: string | Product;
467 created_at: number;
468 updated_at: number;
469 }
470 export interface Charge extends Object {
471 amount: number;
472 created_at: number;
473 currency: string;
474 customer: string | Customer;
475 external_charge_id: string;
476 fully_refunded: boolean;
477 id: string;
478 invoice: string | Invoice;
479 live_mode: boolean;
480 object: 'charge';
481 checkout: string | Checkout;
482 payment_method: string | PaymentMethod;
483 refunded_amount: number;
484 status: 'pending' | 'succeeded' | 'failed';
485 updated_at: number;
486 }
487 export interface TaxIdentifier {
488 id: string;
489 number: string;
490 number_type: string;
491 object: 'tax_identifier';
492 eu_vat_verified: boolean;
493 created_at: number;
494 updated_at: number;
495 }
496 export interface TaxProtocol {
497 id: string;
498 object: 'tax_protocol';
499 ca_tax_enabled: boolean;
500 eu_micro_exemption_enabled: boolean;
501 eu_tax_enabled: boolean;
502 eu_vat_required: boolean;
503 eu_vat_unverified_behavior: 'error' | 'apply_reverse_charge' | 'skip_reverse_charge';
504 eu_vat_local_reverse_charge: boolean;
505 tax_enabled: boolean;
506 address: string | Address;
507 ca_tax_identifier: string | TaxIdentifier;
508 eu_tax_identifier: string | TaxIdentifier;
509 created_at: number;
510 updated_at: number;
511 }
512 export interface Order extends Object {
513 id?: string;
514 object: 'order';
515 number?: string;
516 order_type?: 'checkout' | 'subscription';
517 statement_url?: string;
518 status?: OrderStatus;
519 shipment_status?: OrderShipmentStatus;
520 checkout?: Checkout | string;
521 created_at: number;
522 updated_at: number;
523 }
524 export interface ShippingChoice {
525 amount: number;
526 checkout: string | Checkout;
527 currency: string;
528 id: string;
529 object: 'shipping_choice';
530 shipping_method: string | ShippingMethod;
531 created_at: number;
532 updated_at: number;
533 }
534 export interface ShippingMethod {
535 name: string;
536 description: string;
537 id: string;
538 object: 'shipping_method';
539 position: number;
540 created_at: number;
541 updated_at: number;
542 }
543 export interface Checkout extends Object {
544 id?: string;
545 status?: 'canceled' | 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'processing';
546 staged_payment_intents: {
547 object: 'list';
548 pagination: Pagination;
549 data: Array<PaymentIntent>;
550 };
551 abandoned_checkout_enabled: boolean;
552 bump_amount: number;
553 payment_method_required?: boolean;
554 manual_payment: boolean;
555 manual_payment_method?: string | ManualPaymentMethod;
556 reusable_payment_method_required?: boolean;
557 number?: string;
558 amount_due?: number;
559 trial_amount?: number;
560 charge?: string | Charge;
561 name?: string;
562 first_name?: string;
563 last_name?: string;
564 email?: string;
565 phone?: string;
566 live_mode?: boolean;
567 currency?: string;
568 total_amount?: number;
569 subtotal_amount?: number;
570 full_amount?: number;
571 proration_amount?: number;
572 total_savings_amount?: number;
573 applied_balance_amount?: number;
574 discounts?: number;
575 shipping_address_required?: boolean;
576 tax_enabled: boolean;
577 tax_amount: number;
578 email_exists: boolean;
579 tax_inclusive_amount: number;
580 tax_exclusive_amount: number;
581 tax_status: 'disabled' | 'address_invalid' | 'estimated' | 'calculated';
582 tax_label: string;
583 tax_percent: number;
584 line_items: lineItems;
585 recommended_bumps?: {
586 object: 'list';
587 pagination: Pagination;
588 data: Array<Bump>;
589 };
590 metadata?: any;
591 payment_intent?: PaymentIntent;
592 payment_method?: PaymentMethod;
593 order?: string | Order;
594 customer: string | Customer;
595 subscriptions: {
596 object: 'list';
597 pagination: Pagination;
598 data: Array<Subscription>;
599 };
600 purchases: {
601 object: 'list';
602 pagination: Pagination;
603 data: Array<Purchase>;
604 };
605 discount_amount?: number;
606 discount?: DiscountResponse;
607 billing_address?: string | Address;
608 shipping_amount?: number;
609 shipping_address?: string | Address;
610 shipping_enabled?: boolean;
611 shipping_choices?: {
612 object: 'list';
613 pagination: Pagination;
614 data: Array<ShippingChoice>;
615 };
616 selected_shipping_choice?: string | ShippingChoice;
617 selected_shipping_choice_required: boolean;
618 processor_data?: ProcessorData;
619 tax_identifier?: {
620 number: string;
621 number_type: string;
622 };
623 url: string;
624 created_at?: number;
625 variant: string;
626 }
627 export interface ShippingMethod {
628 id: string;
629 object: 'shipping_method';
630 description: string | null;
631 name: string;
632 position: number;
633 created_at: number;
634 updated_at: number;
635 }
636 export interface ShippingChoice {
637 id: string;
638 object: 'shipping_choice';
639 amount: number;
640 currency: string;
641 checkout: string | Checkout;
642 shipping_method: string | ShippingMethod;
643 created_at: number;
644 updated_at: number;
645 }
646 export interface ProcessorData {
647 stripe: {
648 account_id: string;
649 publishable_key: string;
650 client_secret?: string;
651 type: 'payment' | 'setup';
652 };
653 paypal: {
654 account_id: string;
655 client_id: string;
656 merchant_initiated: boolean;
657 };
658 mollie?: {
659 account_id: 'string';
660 checkout_url: 'string';
661 };
662 paystack: {
663 account_id: string;
664 public_key: string;
665 access_code: string;
666 };
667 }
668 export interface ManualPaymentMethod {
669 id: string;
670 object: 'manual_payment_method';
671 archived: boolean;
672 archived_at: number;
673 description: string;
674 instructions: string;
675 name: string;
676 created_at: number;
677 updated_at: number;
678 }
679 export interface PaymentMethodType {
680 id: string;
681 description: string;
682 image: string;
683 }
684 export interface Processor {
685 id: string;
686 live_mode: boolean;
687 processor_data: {
688 account_id: string;
689 recurring_enabled: boolean;
690 client_id: string;
691 merchant_initiated?: boolean;
692 };
693 recurring_enabled: boolean;
694 supported_currencies: Array<string>;
695 processor_type: 'paypal' | 'stripe' | 'mollie';
696 }
697 export interface Purchase {
698 id: string;
699 object: 'purchase';
700 live_mode: boolean;
701 quantity: number;
702 revoked: boolean;
703 revoked_at: number;
704 customer: string | Customer;
705 invoice_item: string | InvoiceItem;
706 invoice: string | Invoice;
707 line_item: string | LineItem;
708 order: string | Order;
709 product: string | Product;
710 refund: string | Refund;
711 subscription: string | Subscription;
712 license: string | License;
713 created_at: number;
714 updated_at: number;
715 }
716 export interface Refund {
717 id: string;
718 object: 'refund';
719 amount: number;
720 currency: string;
721 external_refund_id: string;
722 live_mode: boolean;
723 metadata: object;
724 reason: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'expired_uncaptured_charge';
725 status: 'pending' | 'succeeded' | 'failed' | 'canceled';
726 charge: string | Charge;
727 customer: string | Customer;
728 revoked_purchases: null | Array<Purchase>;
729 created_at: number;
730 updated_at: number;
731 }
732 export interface Subscription extends Object {
733 id: string;
734 object: 'subscription';
735 currency?: string;
736 status: SubscriptionStatus;
737 live_mode: boolean;
738 external_subscription_id: string;
739 current_cancellation_act: string | CancellationAct;
740 trial_end_at: number;
741 processor_type: 'stripe' | 'paypal';
742 order: Order;
743 customer: Customer;
744 discount: DiscountResponse;
745 finite: boolean;
746 pending_update: {
747 ad_hoc_amount?: number;
748 price?: string;
749 quantity?: number;
750 variant?: string;
751 };
752 purchase: Purchase | string;
753 cancel_at_period_end: number | false;
754 current_period: string | Period;
755 current_period_end_at: number | false;
756 current_period_start_at: number | false;
757 remaining_period_count: number | null;
758 ended_at: number;
759 end_behavior: 'cancel' | 'complete';
760 payment_method: PaymentMethod | string;
761 price: Price;
762 ad_hoc_amount: number;
763 variant?: Variant | string;
764 variant_options?: Array<string>;
765 created_at: number;
766 updated_at: number;
767 restore_at?: number;
768 }
769 export interface CancellationAct {
770 id: string;
771 object: 'cancellation_act';
772 cancellation_reason: string | CancellationReason;
773 comment: string;
774 coupon_applied: boolean;
775 preserved: boolean;
776 subscription: string | Subscription;
777 performed_at: number;
778 created_at: number;
779 updated_at: number;
780 }
781 export interface SubscriptionProtocol {
782 id: string;
783 object: 'subscription_protocol';
784 cancel_behavior: 'pending' | 'immediate';
785 downgrade_behavior: 'pending' | 'immediate';
786 payment_retry_window_weeks: number;
787 upgrade_behavior: 'pending' | 'immediate';
788 preservation_enabled: boolean;
789 preservation_locales: {
790 reasons_title: string;
791 reasons_description: string;
792 skip_link: string;
793 preserve_title: string;
794 preserve_description: string;
795 preserve_button: string;
796 cancel_link: string;
797 };
798 preservation_coupon: Coupon | string;
799 created_at: number;
800 updated_at: number;
801 }
802 export type SubscriptionStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'completed';
803 export type CheckoutStatus = 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'requires_approval';
804 export type OrderStatus = 'paid' | 'payment_failed' | 'processing' | 'void' | 'canceled';
805 export type OrderFulFillmentStatus = 'fulfilled' | 'unfulfilled' | 'partially_fulfilled' | 'scheduled' | 'on_hold';
806 export type OrderShipmentStatus = 'unshipped' | 'shipped' | 'partially_shipped' | 'delivered' | 'unshippable';
807 export type FulfillmentStatus = 'unshipped' | 'shipped' | 'delivered' | 'unshippable';
808 export type ReturnRequestStatus = 'open' | 'completed';
809 export interface PaymentMethod extends Object {
810 id: string;
811 object: 'payment_method';
812 live_mode: boolean;
813 external_payment_method_id: string;
814 processor_type: 'stripe' | 'paypal';
815 paypal_account: any;
816 type: string;
817 bank_account: BankAccount | string;
818 payment_instrument: PaymentInstrument | string;
819 payment_intent: PaymentIntent | string;
820 billing_agreement?: BillingAgreement | string;
821 card: any;
822 customer: Customer | string;
823 created_at: number;
824 updated_at: number;
825 }
826 export interface BankAccount {
827 id: string;
828 account_type: 'checking' | 'savings';
829 account_holder_type: 'individual' | 'company';
830 bank_name: string;
831 last4: string;
832 created_at: number;
833 updated_at: number;
834 }
835 export interface PaymentInstrument {
836 id: string;
837 instrument_type: string;
838 metadata: any;
839 object: 'payment_instrument';
840 created_at: number;
841 updated_at: number;
842 }
843 export interface BillingAgreement {
844 email: string;
845 external_customer_id: string;
846 first_name: string;
847 id: string;
848 last_name: string;
849 phone: string;
850 object: 'billing_agreement';
851 created_at: number;
852 updated_at: number;
853 }
854 export interface Pagination {
855 count: number;
856 limit: number;
857 page: number;
858 url: string;
859 }
860 export interface lineItems extends Object {
861 object: 'list';
862 pagination: Pagination;
863 data: Array<LineItem>;
864 }
865 export interface Promotion extends Object {
866 code: string;
867 created_at: number;
868 expired: boolean;
869 id: string;
870 max_redemptions: number;
871 metadata: Object;
872 object: 'promotion';
873 redeem_by: string;
874 times_redeemed: number;
875 }
876 export interface DiscountResponse {
877 coupon?: Coupon;
878 id: string;
879 object: 'discount';
880 promotion: Promotion;
881 }
882 export interface ResponseError {
883 code?: string;
884 message: string;
885 data?: {
886 http_status: string;
887 status?: number;
888 type: string;
889 };
890 additional_errors?: Array<{
891 code: string;
892 message: string;
893 data: {
894 attribute: string;
895 options: Array<string>;
896 type: string;
897 };
898 }>;
899 }
900 export type ProcessorName = 'stripe' | 'paypal' | 'paypal-card';
901 export interface VerificationCode {
902 id: string;
903 object: 'verification_code';
904 code: number;
905 verified: boolean;
906 verified_at: number | null;
907 created_at: number;
908 updated_at: number;
909 }
910 export interface PaymentIntent extends Object {
911 id: string;
912 object: 'payment_intent';
913 amount: number;
914 currency: string;
915 processor_type: 'stripe' | 'paypal';
916 status: 'pending' | 'succeeded' | 'canceled';
917 external_intent_id: string;
918 live_mode: boolean;
919 processor_data: ProcessorData;
920 customer: Customer | string;
921 created_at: number;
922 updated_at: number;
923 }
924 export interface PaymentIntents {
925 stripe?: PaymentIntent;
926 paypal?: PaymentIntent;
927 }
928 export interface SetupIntent extends Object {
929 id: string;
930 object: 'setup_intent';
931 processor_type: 'stripe' | 'paypal';
932 status: 'pending' | 'succeeded' | 'canceled';
933 external_intent_id: string;
934 live_mode: boolean;
935 processor_data: ProcessorData;
936 customer: Customer | string;
937 created_at: number;
938 updated_at: number;
939 }
940 export interface WordPressUser {
941 id: number;
942 display_name: string;
943 first_name: string;
944 last_name: string;
945 email: string;
946 }
947 export interface Customer extends Object {
948 id: string;
949 email: string;
950 name?: string;
951 first_name?: string;
952 last_name?: string;
953 phone?: string;
954 billing_address?: string | Address;
955 shipping_address?: string | Address;
956 billing_matches_shipping: boolean;
957 live_mode: boolean;
958 unsubscribed: boolean;
959 default_payment_method: string | PaymentMethod;
960 tax_identifier: {
961 number: string;
962 number_type: string;
963 };
964 created_at: number;
965 updated_at: number;
966 }
967 export interface Address extends Object {
968 name?: string;
969 line_1?: string;
970 line_2?: string;
971 city?: string;
972 state?: string;
973 postal_code?: string;
974 country?: string;
975 }
976 export interface Fulfillment {
977 id: string;
978 object: 'fulfillment';
979 number: string;
980 shipment_status: FulfillmentStatus;
981 trackings: {
982 object: 'list';
983 pagination: Pagination;
984 data: Array<Tracking>;
985 };
986 fulfillment_items: {
987 object: 'list';
988 pagination: Pagination;
989 data: Array<FulfillmentItem>;
990 };
991 }
992 export interface FulfillmentItem {
993 id: string;
994 line_item: LineItem;
995 quantity: number;
996 fulfillment: string | Fulfillment;
997 }
998 export interface Tracking {
999 courier_name?: string;
1000 number: string;
1001 url: string;
1002 }
1003 export interface PriceData extends Object {
1004 price_id: string;
1005 quantity: number;
1006 removeable: boolean;
1007 }
1008 export type TaxZone = {
1009 label: string;
1010 label_small: string;
1011 };
1012 export type TaxZones = {
1013 [key in 'ca_gst' | 'au_abn' | 'gb_vat' | 'eu_vat' | 'other']: TaxZone;
1014 };
1015 export type RuleName = 'total' | 'coupons' | 'products' | 'shipping_country' | 'billing_country' | 'processors';
1016 export type ArrayOperators = 'all' | 'any' | 'none' | 'exist' | 'not_exist';
1017 export type NumberOperators = '==' | '!=' | '<' | '>' | '<=' | '>=';
1018 export interface RuleGroup {
1019 group_id: string;
1020 rules: Rule[];
1021 }
1022 export interface Rule {
1023 condition: RuleName;
1024 operator: NumberOperators | ArrayOperators;
1025 value: string | string[] | {
1026 value: string;
1027 }[];
1028 }
1029 export interface ProductCollection {
1030 id: string;
1031 object: string;
1032 name: string;
1033 description?: string;
1034 position?: number;
1035 slug: string;
1036 image?: string;
1037 products_count: number;
1038 products?: Product[];
1039 }
1040 export interface GoogleAnalyticsItem {
1041 item_id: string;
1042 item_name: string;
1043 item_variant?: string;
1044 item_category?: string;
1045 item_category2?: string;
1046 item_category3?: string;
1047 item_category4?: string;
1048 item_category5?: string;
1049 price: number;
1050 quantity: number;
1051 coupon?: string;
1052 currency: string;
1053 discount?: number;
1054 }
1055 export interface FeaturedProductMediaAttributes {
1056 alt: string;
1057 url: string;
1058 title: string;
1059 }
1060 export interface PaymentInfoAddedParams {
1061 checkout_id: string;
1062 processor_type: 'paypal' | 'stripe' | 'mollie' | 'paystack';
1063 payment_method: {
1064 billing_details: {
1065 name: string;
1066 email: string;
1067 };
1068 };
1069 }
1070 export interface CheckoutInitiatedParams {
1071 transaction_id: string;
1072 value: number;
1073 currency: string;
1074 coupon?: string;
1075 tax?: number;
1076 items: Array<{
1077 item_name: string;
1078 discount: number;
1079 price: number;
1080 quantity: number;
1081 }>;
1082 }
1083 export {};
1084