components
2 weeks ago
functions
1 month ago
global
4 years ago
services
1 month ago
store
1 month ago
testing
1 year ago
components.d.ts
2 weeks ago
global.d.ts
4 years ago
index.d.ts
1 month ago
stencil-public-runtime.d.ts
1 year ago
types.d.ts
1 week ago
types.d.ts
1534 lines
| 1 | import { ObservableMap } from '@stencil/store'; |
| 2 | import { StripeElementChangeEvent } from '@stripe/stripe-js'; |
| 3 | export type IconLibraryResolver = (name: string) => string; |
| 4 | export type IconLibraryMutator = (svg: SVGElement) => void; |
| 5 | export interface IconLibraryOptions { |
| 6 | resolver: IconLibraryResolver; |
| 7 | mutator?: IconLibraryMutator; |
| 8 | } |
| 9 | declare global { |
| 10 | interface Window { |
| 11 | grecaptcha: any; |
| 12 | surecart?: { |
| 13 | product?: { |
| 14 | store: ObservableMap<any>; |
| 15 | state: any; |
| 16 | update: Function; |
| 17 | }; |
| 18 | }; |
| 19 | wp: { |
| 20 | apiFetch: any; |
| 21 | blocks: any; |
| 22 | i18n: any; |
| 23 | hooks: { |
| 24 | applyFilters?: (filterName: string, defaultValue: any, ...args: any[]) => any; |
| 25 | }; |
| 26 | }; |
| 27 | dataLayer: any; |
| 28 | gtag: any; |
| 29 | fbq: any; |
| 30 | sc?: { |
| 31 | store?: { |
| 32 | product?: any; |
| 33 | products?: any; |
| 34 | }; |
| 35 | checkout?: { |
| 36 | addLineItem: (data: any) => void; |
| 37 | }; |
| 38 | cart?: { |
| 39 | toggle: (open: boolean) => void; |
| 40 | }; |
| 41 | }; |
| 42 | scStore: any; |
| 43 | registerSureCartIconPath: (path: string) => void; |
| 44 | registerSureCartIconLibrary: (name: string, options: IconLibraryOptions) => void; |
| 45 | scIcons: { |
| 46 | path: string; |
| 47 | }; |
| 48 | scData: { |
| 49 | cdn_root: string; |
| 50 | root_url: string; |
| 51 | account_id: string; |
| 52 | account_slug: string; |
| 53 | locale: string; |
| 54 | api_url: string; |
| 55 | home_url: string; |
| 56 | plugin_url: string; |
| 57 | page_id: string; |
| 58 | persist_cart: 'browser' | 'url' | false; |
| 59 | nonce: string; |
| 60 | base_url: string; |
| 61 | nonce_endpoint: string; |
| 62 | recaptcha_site_key: string; |
| 63 | theme: string; |
| 64 | product_data: { |
| 65 | checkout_link: string; |
| 66 | mode: 'live' | 'test'; |
| 67 | form: { |
| 68 | ID: number; |
| 69 | }; |
| 70 | product: Product; |
| 71 | }; |
| 72 | pages: { |
| 73 | dashboard: string; |
| 74 | checkout: string; |
| 75 | }; |
| 76 | currency: string; |
| 77 | is_claimed: string; |
| 78 | claim_url: string; |
| 79 | admin_url: string; |
| 80 | user_permissions: { |
| 81 | manage_sc_shop_settings: boolean; |
| 82 | }; |
| 83 | google_map_api_key: string; |
| 84 | current_user_roles: string[]; |
| 85 | tracking?: { |
| 86 | facebook?: boolean; |
| 87 | google?: boolean; |
| 88 | }; |
| 89 | }; |
| 90 | ceRegisterIconLibrary: any; |
| 91 | ResizeObserver: any; |
| 92 | scIconLibraries: IconLibrary[]; |
| 93 | } |
| 94 | } |
| 95 | export type RecursivePartial<T> = { |
| 96 | [P in keyof T]?: RecursivePartial<T[P]>; |
| 97 | }; |
| 98 | interface Model { |
| 99 | created_at: number; |
| 100 | updated_at: number; |
| 101 | } |
| 102 | export interface IconLibrary extends IconLibraryOptions { |
| 103 | name: string; |
| 104 | } |
| 105 | export interface ChoiceItem extends Object { |
| 106 | value: string; |
| 107 | label: string; |
| 108 | description?: string; |
| 109 | disabled?: boolean; |
| 110 | checked?: boolean; |
| 111 | unavailable?: boolean; |
| 112 | choices?: ChoiceItem[]; |
| 113 | suffix?: string; |
| 114 | suffixDescription?: string; |
| 115 | icon?: string; |
| 116 | } |
| 117 | export type ChoiceType = 'all' | 'single' | 'multiple'; |
| 118 | export interface Swap { |
| 119 | id: string; |
| 120 | object: 'swap'; |
| 121 | archived: boolean; |
| 122 | archived_at?: string; |
| 123 | description: string; |
| 124 | metadata: { |
| 125 | [key: string]: string; |
| 126 | }; |
| 127 | price: string | Price; |
| 128 | swap_price: string | Price; |
| 129 | discarded_at?: number; |
| 130 | created_at: number; |
| 131 | updated_at: number; |
| 132 | } |
| 133 | export interface Price { |
| 134 | id: string; |
| 135 | name: string; |
| 136 | description?: string; |
| 137 | amount: number; |
| 138 | display_amount: string; |
| 139 | setup_fee_display_amount: string; |
| 140 | setup_fee_text: string; |
| 141 | full_amount: number; |
| 142 | currency: string; |
| 143 | recurring: boolean; |
| 144 | recurring_interval?: 'week' | 'month' | 'year' | 'never'; |
| 145 | recurring_interval_count?: number; |
| 146 | trial_duration_days?: number; |
| 147 | trial_text?: string; |
| 148 | ad_hoc: boolean; |
| 149 | ad_hoc_max_amount: number; |
| 150 | ad_hoc_min_amount: number; |
| 151 | scratch_amount: number; |
| 152 | scratch_display_amount: string; |
| 153 | setup_fee_enabled: boolean; |
| 154 | setup_fee_amount: number; |
| 155 | short_interval_text: string; |
| 156 | short_interval_count_text: string; |
| 157 | interval_text: string; |
| 158 | interval_count_text: string; |
| 159 | setup_fee_name: string; |
| 160 | setup_fee_trial_enabled: boolean; |
| 161 | recurring_period_count: number; |
| 162 | archived: boolean; |
| 163 | product_id?: string; |
| 164 | archived_at?: string; |
| 165 | created_at: number; |
| 166 | updated_at: number; |
| 167 | product?: Product | string; |
| 168 | position: number; |
| 169 | portal_subscription_update_enabled: boolean; |
| 170 | metadata: { |
| 171 | [key: string]: string; |
| 172 | }; |
| 173 | current_swap?: Swap; |
| 174 | } |
| 175 | export interface VariantOption { |
| 176 | id: string; |
| 177 | object: string; |
| 178 | name: string; |
| 179 | position: number; |
| 180 | product: Product | string; |
| 181 | display_type: 'dropdown' | 'pills'; |
| 182 | updated_at: number; |
| 183 | created_at: number; |
| 184 | label: string; |
| 185 | labels: string; |
| 186 | values: Array<string>; |
| 187 | } |
| 188 | export interface Bump { |
| 189 | id: string; |
| 190 | object: 'bump'; |
| 191 | amount_off: number; |
| 192 | amount_off_display_amount: string; |
| 193 | subtotal_display_amount: string; |
| 194 | subtotal_amount: number; |
| 195 | total_display_amount: string; |
| 196 | total_amount: number; |
| 197 | archived: boolean; |
| 198 | archived_at: number; |
| 199 | auto_apply: boolean; |
| 200 | filter_match_type: 'all' | 'any' | 'none'; |
| 201 | filters: any; |
| 202 | metadata: any; |
| 203 | rendered_description: string; |
| 204 | name: string; |
| 205 | percent_off: number; |
| 206 | price: string | Price; |
| 207 | priority: 1 | 2 | 3 | 4 | 5; |
| 208 | created_at: number; |
| 209 | updated_at: number; |
| 210 | } |
| 211 | export interface UpsellFunnel { |
| 212 | id: string; |
| 213 | object: 'upsell_funnel'; |
| 214 | archived: boolean; |
| 215 | enabled: boolean; |
| 216 | filter_match_type: 'all' | 'any' | 'none'; |
| 217 | filter_price_ids: string[]; |
| 218 | filter_product_ids: string[]; |
| 219 | metadata: any; |
| 220 | name: string; |
| 221 | priority: number; |
| 222 | upsells: { |
| 223 | object: 'list'; |
| 224 | pagination: Pagination; |
| 225 | data: Array<Upsell>; |
| 226 | }; |
| 227 | archived_at: number; |
| 228 | discarded_at: number; |
| 229 | created_at: number; |
| 230 | updated_at: number; |
| 231 | } |
| 232 | export interface Upsell { |
| 233 | id: string; |
| 234 | object: 'upsell'; |
| 235 | amount_off: number; |
| 236 | metadata: any; |
| 237 | fee_description: string; |
| 238 | duplicate_purchase_behavior: 'allow' | 'block' | 'block_within_checkout'; |
| 239 | percent_off: number; |
| 240 | price: string | Price; |
| 241 | step: 'initial' | 'accepted' | 'declined'; |
| 242 | upsell_funnel: string | UpsellFunnel; |
| 243 | permalink: string; |
| 244 | discarded_at: number; |
| 245 | created_at: number; |
| 246 | updated_at: number; |
| 247 | } |
| 248 | export type Prices = { |
| 249 | [id: string]: Price; |
| 250 | }; |
| 251 | export interface Media { |
| 252 | id: string; |
| 253 | object: 'media'; |
| 254 | byte_size: number; |
| 255 | content_type: string; |
| 256 | extension: string; |
| 257 | filename: string; |
| 258 | public_access: boolean; |
| 259 | release_json: any; |
| 260 | alt: string; |
| 261 | title: string; |
| 262 | url?: string; |
| 263 | url_expires_at?: number; |
| 264 | updated_at: number; |
| 265 | created_at: number; |
| 266 | } |
| 267 | export interface Download { |
| 268 | id: string; |
| 269 | object: 'download'; |
| 270 | archived: boolean; |
| 271 | archived_at?: number; |
| 272 | media: string | Media; |
| 273 | name?: string; |
| 274 | product: string | Product; |
| 275 | update_at: number; |
| 276 | created_at: number; |
| 277 | url?: string; |
| 278 | } |
| 279 | export type FormState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalizing' | 'paying' | 'confirming' | 'confirmed' | 'paid' | 'failure' | 'expired' | 'redirecting'; |
| 280 | export type FormStateSetter = 'RESOLVE' | 'REJECT' | 'FINALIZE' | 'PAYING' | 'PAID' | 'EXPIRE' | 'FETCH'; |
| 281 | export interface License { |
| 282 | id: string; |
| 283 | object: 'license'; |
| 284 | activation_limit: number; |
| 285 | activation_count: number; |
| 286 | key: string; |
| 287 | activations?: { |
| 288 | object: 'list'; |
| 289 | pagination: Pagination; |
| 290 | data: Array<Activation>; |
| 291 | }; |
| 292 | status: 'inactive' | 'active' | 'revoked'; |
| 293 | purchase: string | Purchase; |
| 294 | created_at: number; |
| 295 | created_at_date: string; |
| 296 | updated_at: number; |
| 297 | updated_at_date: string; |
| 298 | } |
| 299 | export interface CancellationReason { |
| 300 | id: string; |
| 301 | object: 'cancellation_reason'; |
| 302 | archived: boolean; |
| 303 | comment_enabled: false; |
| 304 | comment_prompt: string | null; |
| 305 | coupon_enabled: boolean; |
| 306 | label: string; |
| 307 | position: number; |
| 308 | archived_at: number; |
| 309 | discarded_at: number; |
| 310 | created_at: number; |
| 311 | updated_at: number; |
| 312 | } |
| 313 | export interface Period { |
| 314 | id: string; |
| 315 | object: 'period'; |
| 316 | ad_hoc_amount?: number; |
| 317 | checkout: string | Checkout; |
| 318 | customer_id: string | Customer; |
| 319 | end_at?: number; |
| 320 | end_at_date?: string; |
| 321 | next_payment_retry_at: number; |
| 322 | payment_retry_count: number; |
| 323 | price: string | Price; |
| 324 | purchase_id: string | Purchase; |
| 325 | quantity: number; |
| 326 | renewal: boolean; |
| 327 | skip_proration: boolean; |
| 328 | start_at: number; |
| 329 | start_at_date?: string; |
| 330 | status: 'draft'; |
| 331 | subscription: string | Subscription; |
| 332 | created_at: number; |
| 333 | created_at_date: string; |
| 334 | updated_at: number; |
| 335 | updated_at_date: string; |
| 336 | } |
| 337 | export interface Activation { |
| 338 | id: string; |
| 339 | object: 'activation'; |
| 340 | name: string; |
| 341 | counted: boolean; |
| 342 | fingerprint: string; |
| 343 | license: string | License; |
| 344 | created_at: number; |
| 345 | created_at_date: string; |
| 346 | updated_at: number; |
| 347 | updated_at_date: string; |
| 348 | } |
| 349 | export interface Variant { |
| 350 | id: string; |
| 351 | amount: number; |
| 352 | available_stock: number; |
| 353 | currency: string; |
| 354 | current_version: boolean; |
| 355 | held_stock: number; |
| 356 | stock: number; |
| 357 | object: 'variant'; |
| 358 | image?: string | Media; |
| 359 | image_url?: string; |
| 360 | option_1?: string | null; |
| 361 | option_2?: string | null; |
| 362 | option_3?: string | null; |
| 363 | position: number; |
| 364 | product: string | Product; |
| 365 | sku?: string | null; |
| 366 | display_amount?: string; |
| 367 | has_unlimited_stock?: boolean | null; |
| 368 | downloads_enabled?: boolean | null; |
| 369 | current_release_download?: string | Download | null; |
| 370 | downloads?: { |
| 371 | object: 'list'; |
| 372 | pagination: Pagination; |
| 373 | data: Array<Download>; |
| 374 | }; |
| 375 | created_at: number; |
| 376 | updated_at: number; |
| 377 | } |
| 378 | export interface ProductMetrics { |
| 379 | currency: string; |
| 380 | max_price_amount: number; |
| 381 | min_price_amount: number; |
| 382 | prices_count: number; |
| 383 | } |
| 384 | export interface Product extends Object { |
| 385 | id: string; |
| 386 | name: string; |
| 387 | description: string; |
| 388 | archived: boolean; |
| 389 | archived_at: string; |
| 390 | metadata: any; |
| 391 | image_url: string; |
| 392 | recurring: boolean; |
| 393 | tax_category: string; |
| 394 | tax_enabled: boolean; |
| 395 | purchase_limit: number; |
| 396 | metrics: ProductMetrics; |
| 397 | line_item_image: ImageAttributes; |
| 398 | permalink: string; |
| 399 | weight: number; |
| 400 | weight_unit: 'kg' | 'lb' | 'g' | 'oz'; |
| 401 | featured_product_media?: string | ProductMedia; |
| 402 | prices: { |
| 403 | object: 'list'; |
| 404 | pagination: Pagination; |
| 405 | data: Array<Price>; |
| 406 | }; |
| 407 | variants: { |
| 408 | object: 'list'; |
| 409 | pagination: Pagination; |
| 410 | data: Array<Variant>; |
| 411 | }; |
| 412 | variant_options: { |
| 413 | object: 'list'; |
| 414 | pagination: Pagination; |
| 415 | data: Array<VariantOption>; |
| 416 | }; |
| 417 | /** |
| 418 | * Whether this product is a bundle. Set on create, immutable thereafter. |
| 419 | * A bundle product owns BundleItems pointing at component products. |
| 420 | */ |
| 421 | bundle?: boolean; |
| 422 | bundle_items?: { |
| 423 | object: 'list'; |
| 424 | pagination: Pagination; |
| 425 | data: Array<BundleItem>; |
| 426 | }; |
| 427 | product_medias: { |
| 428 | object: 'list'; |
| 429 | pagination: Pagination; |
| 430 | data: Array<ProductMedia>; |
| 431 | }; |
| 432 | downloads: { |
| 433 | object: 'list'; |
| 434 | pagination: Pagination; |
| 435 | data: Array<Download>; |
| 436 | }; |
| 437 | product_collections: { |
| 438 | object: 'list'; |
| 439 | pagination: Pagination; |
| 440 | data: Array<Collection>; |
| 441 | }; |
| 442 | stock_enabled: boolean; |
| 443 | allow_out_of_stock_purchases: boolean; |
| 444 | has_unlimited_stock: boolean; |
| 445 | stock: number; |
| 446 | available_stock: number; |
| 447 | held_stock: number; |
| 448 | review_url?: string; |
| 449 | created_at: number; |
| 450 | updated_at: number; |
| 451 | } |
| 452 | export type Products = { |
| 453 | [id: string]: Product; |
| 454 | }; |
| 455 | export interface Collection extends Object { |
| 456 | id: string; |
| 457 | name: string; |
| 458 | description: string; |
| 459 | image_url: string; |
| 460 | created_at: number; |
| 461 | updated_at: number; |
| 462 | } |
| 463 | export interface Coupon extends Model { |
| 464 | id: string; |
| 465 | object: 'coupon'; |
| 466 | amount_off: number; |
| 467 | valid?: boolean; |
| 468 | expired: boolean; |
| 469 | currency: string; |
| 470 | duration: string; |
| 471 | duration_in_months: number; |
| 472 | max_redemptions: number; |
| 473 | metadata: Object; |
| 474 | name: string; |
| 475 | percent_off: number; |
| 476 | redeem_by: number; |
| 477 | times_redeemed: number; |
| 478 | } |
| 479 | export interface LineItemData extends Object { |
| 480 | id?: string; |
| 481 | price_id?: string; |
| 482 | variant_id?: string; |
| 483 | bump?: string; |
| 484 | quantity: number; |
| 485 | ad_hoc_amount?: number; |
| 486 | variant?: string; |
| 487 | bundle_component_variants?: Record<string, string>; |
| 488 | } |
| 489 | export type LineItemsData = { |
| 490 | [id: string]: Array<LineItemData>; |
| 491 | }; |
| 492 | export interface ImageAttributes { |
| 493 | src: string; |
| 494 | alt?: string; |
| 495 | class?: string; |
| 496 | decoding?: string; |
| 497 | height?: number; |
| 498 | loading?: string; |
| 499 | sizes?: string; |
| 500 | srcset?: string; |
| 501 | width?: number; |
| 502 | type?: string; |
| 503 | } |
| 504 | export interface LineItem extends Object { |
| 505 | id?: string; |
| 506 | ad_hoc_amount?: number; |
| 507 | ad_hoc_display_amount?: string; |
| 508 | name: string; |
| 509 | object: string; |
| 510 | quantity: number; |
| 511 | currency: string; |
| 512 | checkout: string | Checkout; |
| 513 | bump: string | Bump; |
| 514 | image: ImageAttributes; |
| 515 | fees?: { |
| 516 | object: 'list'; |
| 517 | pagination: Pagination; |
| 518 | data: Array<Fee>; |
| 519 | }; |
| 520 | bump_amount: number; |
| 521 | bump_display_amount: string; |
| 522 | discount_amount: number; |
| 523 | subtotal_amount: number; |
| 524 | subtotal_display_amount?: string; |
| 525 | total_amount: number; |
| 526 | total_default_currency_display_amount: string; |
| 527 | total_display_amount: string; |
| 528 | trial_amount: number; |
| 529 | tax_amount: number; |
| 530 | tax_display_amount: string; |
| 531 | fees_amount: number; |
| 532 | scratch_amount: number; |
| 533 | scratch_display_amount?: string; |
| 534 | subtotal_with_upsell_discount_display_amount?: string; |
| 535 | subtotal_with_upsell_discount_amount?: number; |
| 536 | trial: boolean; |
| 537 | total_savings_amount: number; |
| 538 | created_at: number; |
| 539 | updated_at: number; |
| 540 | price?: Price; |
| 541 | price_id: string; |
| 542 | sku: string; |
| 543 | purchasable_status: 'price_gone' | 'price_old_version' | 'variant_mising' | 'variant_gone' | 'variant_old_version' | 'out_of_stock' | 'exceeds_purchase_limit' | 'purchasable'; |
| 544 | purchasable_status_display: string; |
| 545 | variant_options: Array<string>; |
| 546 | variant_display_options: string; |
| 547 | variant?: Variant; |
| 548 | locked: boolean; |
| 549 | swap?: Swap; |
| 550 | is_swappable?: boolean; |
| 551 | note?: string; |
| 552 | display_note?: string; |
| 553 | component_line_item?: boolean; |
| 554 | component_line_items?: { |
| 555 | data: LineItem[]; |
| 556 | }; |
| 557 | /** Sort order within the bundle, mirroring the bundle item's position. */ |
| 558 | position?: number; |
| 559 | /** Id of the bundle parent line item (set on bundle component line items). */ |
| 560 | bundle_line_item?: string | null; |
| 561 | bundle_component_variants?: Record<string, string>; |
| 562 | bundle_allocated_unit_amount?: number; |
| 563 | is_bundle_parent?: boolean; |
| 564 | is_bundle_component?: boolean; |
| 565 | tax_rate?: number; |
| 566 | } |
| 567 | export interface DeletedItem { |
| 568 | cache_status: string; |
| 569 | deleted: boolean; |
| 570 | id: string; |
| 571 | object: string; |
| 572 | } |
| 573 | export interface Fee { |
| 574 | id: string; |
| 575 | object: 'fee'; |
| 576 | amount: number; |
| 577 | display_amount: string; |
| 578 | description: string; |
| 579 | fee_type: 'manual' | 'bump' | 'setup' | 'upsell'; |
| 580 | line_item: string | LineItem; |
| 581 | created_at: number; |
| 582 | updated_at: number; |
| 583 | } |
| 584 | /** |
| 585 | * BundleItem — a join between a bundle Product and one of its component Products. |
| 586 | * |
| 587 | * Variant selection is NOT pinned here; the shopper picks at checkout via |
| 588 | * `bundle_component_variants` on the bundle line item. Components are always |
| 589 | * Products, never Prices or Variants. |
| 590 | */ |
| 591 | export interface BundleItem { |
| 592 | id: string; |
| 593 | object: 'bundle_item'; |
| 594 | /** The parent bundle product (the one with bundle: true). */ |
| 595 | bundle_product: string | Product; |
| 596 | /** The component product included in the bundle. Must not itself be a bundle. */ |
| 597 | component_product: string | Product; |
| 598 | /** |
| 599 | * Shortcut association: the component product's variants with live stock, |
| 600 | * one level shallower than the (dropped) component_product.variants expand. |
| 601 | */ |
| 602 | component_variants?: { |
| 603 | object: 'list'; |
| 604 | pagination?: Pagination; |
| 605 | data: Variant[]; |
| 606 | }; |
| 607 | /** Shortcut association: the component product's variant option dimensions. */ |
| 608 | component_variant_options?: { |
| 609 | object: 'list'; |
| 610 | pagination?: Pagination; |
| 611 | data: VariantOption[]; |
| 612 | }; |
| 613 | quantity: number; |
| 614 | /** Optional weighting input (cents) for tax allocation. Nil → even split by quantity. */ |
| 615 | basis_amount?: number | null; |
| 616 | position: number; |
| 617 | /** Whether this is the current version of the bundle item. */ |
| 618 | current_version?: boolean; |
| 619 | metadata?: { |
| 620 | [key: string]: string; |
| 621 | }; |
| 622 | created_at: number; |
| 623 | updated_at: number; |
| 624 | } |
| 625 | export interface BundleComponentRow { |
| 626 | id: string; |
| 627 | name: string; |
| 628 | variants: string; |
| 629 | qty: number; |
| 630 | } |
| 631 | export interface InvoiceItem extends LineItem { |
| 632 | } |
| 633 | export interface PriceChoice { |
| 634 | id: string; |
| 635 | product_id: string; |
| 636 | quantity: number; |
| 637 | enabled: boolean; |
| 638 | selected?: boolean; |
| 639 | variant?: string | null; |
| 640 | } |
| 641 | export type CheckoutState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalized' | 'paid' | 'failure'; |
| 642 | export type TaxStatus = 'disabled' | 'address_invalid' | 'reverse_charged' | 'tax_registration_not_found' | 'tax_zone_not_found' | 'estimated' | 'calculated'; |
| 643 | export interface Invoice extends Object { |
| 644 | id: string; |
| 645 | object: 'invoice'; |
| 646 | automatic_collection: boolean; |
| 647 | due_date?: number; |
| 648 | due_date_date?: string; |
| 649 | issue_date?: number; |
| 650 | issue_date_date?: string; |
| 651 | footer?: string; |
| 652 | memo?: string; |
| 653 | live_mode: boolean; |
| 654 | status: InvoiceStatus; |
| 655 | checkout: Checkout | string; |
| 656 | metadata: object; |
| 657 | order_number: string; |
| 658 | created_at: number; |
| 659 | created_at_date: string; |
| 660 | updated_at: number; |
| 661 | updated_at_date: string; |
| 662 | } |
| 663 | export interface BillingAddress extends Address { |
| 664 | } |
| 665 | export interface ShippingAddress extends Address { |
| 666 | } |
| 667 | export interface ProductGroup { |
| 668 | id: string; |
| 669 | object: 'product_group'; |
| 670 | archived: boolean; |
| 671 | archived_at: number; |
| 672 | metadata: object; |
| 673 | name: string; |
| 674 | created_at: number; |
| 675 | updated_at: number; |
| 676 | } |
| 677 | export interface ProductMedia { |
| 678 | id: string; |
| 679 | object: 'product_media'; |
| 680 | position: number; |
| 681 | url: null; |
| 682 | media: string | Media; |
| 683 | product: string | Product; |
| 684 | created_at: number; |
| 685 | updated_at: number; |
| 686 | } |
| 687 | export interface Charge extends Object { |
| 688 | amount: number; |
| 689 | created_at: number; |
| 690 | created_at_date: string; |
| 691 | currency: string; |
| 692 | display_amount: string; |
| 693 | customer: string | Customer; |
| 694 | external_charge_id: string; |
| 695 | fully_refunded: boolean; |
| 696 | id: string; |
| 697 | invoice: string | Invoice; |
| 698 | live_mode: boolean; |
| 699 | object: 'charge'; |
| 700 | checkout: string | Checkout; |
| 701 | payment_method: string | PaymentMethod; |
| 702 | refunded_amount: number; |
| 703 | disputed_amount: number; |
| 704 | status: 'pending' | 'succeeded' | 'failed'; |
| 705 | updated_at: number; |
| 706 | updated_at_date: string; |
| 707 | } |
| 708 | export interface TaxIdentifier { |
| 709 | id: string; |
| 710 | number: string; |
| 711 | number_type: string; |
| 712 | object: 'tax_identifier'; |
| 713 | eu_vat_verified: boolean; |
| 714 | created_at: number; |
| 715 | updated_at: number; |
| 716 | } |
| 717 | export interface TaxProtocol { |
| 718 | id: string; |
| 719 | object: 'tax_protocol'; |
| 720 | ca_tax_enabled: boolean; |
| 721 | eu_micro_exemption_enabled: boolean; |
| 722 | eu_tax_enabled: boolean; |
| 723 | eu_vat_required: boolean; |
| 724 | eu_vat_unverified_behavior: 'error' | 'apply_reverse_charge' | 'skip_reverse_charge'; |
| 725 | eu_vat_local_reverse_charge: boolean; |
| 726 | tax_enabled: boolean; |
| 727 | address: string | Address; |
| 728 | ca_tax_identifier: string | TaxIdentifier; |
| 729 | eu_tax_identifier: string | TaxIdentifier; |
| 730 | created_at: number; |
| 731 | updated_at: number; |
| 732 | } |
| 733 | export interface Order extends Object { |
| 734 | id?: string; |
| 735 | object: 'order'; |
| 736 | number?: string; |
| 737 | order_type?: 'checkout' | 'subscription'; |
| 738 | statement_url?: string; |
| 739 | status?: OrderStatus; |
| 740 | shipment_status?: OrderShipmentStatus; |
| 741 | checkout?: Checkout | string; |
| 742 | invoice?: Invoice | string; |
| 743 | created_at: number; |
| 744 | created_at_date: string; |
| 745 | updated_at: number; |
| 746 | updated_at_date: string; |
| 747 | } |
| 748 | export interface ShippingChoice { |
| 749 | amount: number; |
| 750 | display_amount: string; |
| 751 | checkout: string | Checkout; |
| 752 | currency: string; |
| 753 | id: string; |
| 754 | object: 'shipping_choice'; |
| 755 | shipping_method: string | ShippingMethod; |
| 756 | created_at: number; |
| 757 | updated_at: number; |
| 758 | } |
| 759 | export interface ShippingMethod { |
| 760 | name: string; |
| 761 | description: string; |
| 762 | id: string; |
| 763 | object: 'shipping_method'; |
| 764 | position: number; |
| 765 | created_at: number; |
| 766 | updated_at: number; |
| 767 | } |
| 768 | export interface Checkout extends Object { |
| 769 | id?: string; |
| 770 | status?: 'canceled' | 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'processing'; |
| 771 | tax_amount: number; |
| 772 | tax_display_amount: string; |
| 773 | tax_inclusive_amount: number; |
| 774 | tax_exclusive_amount: number; |
| 775 | tax_status: 'disabled' | 'address_invalid' | 'estimated' | 'calculated'; |
| 776 | tax_label: string; |
| 777 | tax_percent: number; |
| 778 | tax_enabled: boolean; |
| 779 | email_exists: boolean; |
| 780 | show_converted_total: boolean; |
| 781 | staged_payment_intents: { |
| 782 | object: 'list'; |
| 783 | pagination: Pagination; |
| 784 | data: Array<PaymentIntent>; |
| 785 | }; |
| 786 | abandoned_checkout_enabled: boolean; |
| 787 | billing_matches_shipping: boolean; |
| 788 | bump_amount: number; |
| 789 | bump_display_amount: string; |
| 790 | payment_method_required?: boolean; |
| 791 | manual_payment: boolean; |
| 792 | manual_payment_method?: string | ManualPaymentMethod; |
| 793 | reusable_payment_method_required?: boolean; |
| 794 | number?: string; |
| 795 | amount_due?: number; |
| 796 | amount_due_display_amount?: string; |
| 797 | /** PHP model accessor: line item count excluding bundle containers. */ |
| 798 | delivered_items_count?: number; |
| 799 | amount_due_default_currency_display_amount?: string; |
| 800 | remaining_amount_due?: number; |
| 801 | remaining_amount_due_display_amount?: string; |
| 802 | trial_amount?: number; |
| 803 | trial_display_amount?: string; |
| 804 | charge?: string | Charge; |
| 805 | name?: string; |
| 806 | first_name?: string; |
| 807 | last_name?: string; |
| 808 | email?: string; |
| 809 | phone?: string; |
| 810 | live_mode?: boolean; |
| 811 | currency?: string; |
| 812 | current_currency?: string; |
| 813 | discounts_display_amount?: string; |
| 814 | discounts_display?: string; |
| 815 | tax_exclusive_display_amount?: string; |
| 816 | tax_inclusive_display_amount?: string; |
| 817 | total_amount?: number; |
| 818 | total_display_amount?: string; |
| 819 | subtotal_amount?: number; |
| 820 | subtotal_display_amount?: string; |
| 821 | full_amount?: number; |
| 822 | full_display_amount?: string; |
| 823 | paid_amount?: number; |
| 824 | paid_display_amount?: string; |
| 825 | proration_amount?: number; |
| 826 | proration_display_amount?: string; |
| 827 | total_savings_amount?: number; |
| 828 | total_savings_display_amount?: string; |
| 829 | total_scratch_display_amount?: string; |
| 830 | applied_balance_amount?: number; |
| 831 | applied_balance_display_amount?: string; |
| 832 | scratch_display_amount?: string; |
| 833 | discounts?: number; |
| 834 | shipping_address_required?: boolean; |
| 835 | shipping_address_accuracy_requirement?: 'full' | 'tax' | 'none'; |
| 836 | line_items: lineItems; |
| 837 | recommended_bumps?: { |
| 838 | object: 'list'; |
| 839 | pagination: Pagination; |
| 840 | data: Array<Bump>; |
| 841 | }; |
| 842 | current_upsell: Upsell; |
| 843 | recommended_upsells?: { |
| 844 | object: 'list'; |
| 845 | pagination: Pagination; |
| 846 | data: Array<Upsell>; |
| 847 | }; |
| 848 | metadata?: any; |
| 849 | payment_intent?: PaymentIntent; |
| 850 | payment_method?: PaymentMethod; |
| 851 | order?: string | Order; |
| 852 | customer: string | Customer; |
| 853 | subscriptions: { |
| 854 | object: 'list'; |
| 855 | pagination: Pagination; |
| 856 | data: Array<Subscription>; |
| 857 | }; |
| 858 | checkout_fees: { |
| 859 | object: 'list'; |
| 860 | pagination: Pagination; |
| 861 | data: Array<Fee>; |
| 862 | }; |
| 863 | shipping_fees: { |
| 864 | object: 'list'; |
| 865 | pagination: Pagination; |
| 866 | data: Array<Fee>; |
| 867 | }; |
| 868 | purchases: { |
| 869 | object: 'list'; |
| 870 | pagination: Pagination; |
| 871 | data: Array<Purchase>; |
| 872 | }; |
| 873 | discount_amount?: number; |
| 874 | discount?: DiscountResponse; |
| 875 | billing_address?: string | Address; |
| 876 | geo_address?: string | Address; |
| 877 | latitude?: number; |
| 878 | longitude?: number; |
| 879 | shipping_amount?: number; |
| 880 | shipping_display_amount?: string; |
| 881 | shipping_address?: string | Address; |
| 882 | shipping_enabled?: boolean; |
| 883 | shipping_choices?: { |
| 884 | object: 'list'; |
| 885 | pagination: Pagination; |
| 886 | data: Array<ShippingChoice>; |
| 887 | }; |
| 888 | selected_shipping_choice?: string | ShippingChoice; |
| 889 | selected_shipping_choice_required: boolean; |
| 890 | processor_data?: ProcessorData; |
| 891 | tax_identifier?: { |
| 892 | number: string; |
| 893 | number_type: string; |
| 894 | }; |
| 895 | url: string; |
| 896 | created_at?: number; |
| 897 | updated_at: number; |
| 898 | variant: string; |
| 899 | upsells_expire_at?: number; |
| 900 | invoice?: string | Invoice; |
| 901 | pdf_url?: string; |
| 902 | refunded_amount?: number; |
| 903 | refunded_display_amount?: string; |
| 904 | net_paid_amount?: number; |
| 905 | net_paid_display_amount?: string; |
| 906 | credited_balance_amount?: number; |
| 907 | credited_balance_display_amount?: string; |
| 908 | tax_reverse_charged_amount?: number; |
| 909 | tax_reverse_charged_display_amount?: string; |
| 910 | } |
| 911 | export interface ShippingMethod { |
| 912 | id: string; |
| 913 | object: 'shipping_method'; |
| 914 | description: string | null; |
| 915 | name: string; |
| 916 | position: number; |
| 917 | created_at: number; |
| 918 | updated_at: number; |
| 919 | } |
| 920 | export interface ShippingChoice { |
| 921 | id: string; |
| 922 | object: 'shipping_choice'; |
| 923 | amount: number; |
| 924 | currency: string; |
| 925 | checkout: string | Checkout; |
| 926 | shipping_method: string | ShippingMethod; |
| 927 | created_at: number; |
| 928 | updated_at: number; |
| 929 | } |
| 930 | export interface ProcessorData { |
| 931 | stripe: { |
| 932 | account_id: string; |
| 933 | publishable_key: string; |
| 934 | client_secret?: string; |
| 935 | type: 'payment' | 'setup'; |
| 936 | }; |
| 937 | paypal: { |
| 938 | account_id: string; |
| 939 | client_id: string; |
| 940 | merchant_initiated: boolean; |
| 941 | }; |
| 942 | mollie?: { |
| 943 | account_id: 'string'; |
| 944 | checkout_url: 'string'; |
| 945 | }; |
| 946 | paystack: { |
| 947 | account_id: string; |
| 948 | public_key: string; |
| 949 | access_code: string; |
| 950 | }; |
| 951 | razorpay?: { |
| 952 | account_id: string; |
| 953 | key_id: string; |
| 954 | order_id: string; |
| 955 | public_key: string; |
| 956 | access_code: string; |
| 957 | customer_id: string; |
| 958 | }; |
| 959 | } |
| 960 | export interface RazorpayOptions { |
| 961 | key: string; |
| 962 | order_id: string; |
| 963 | prefill?: { |
| 964 | name?: string; |
| 965 | email?: string; |
| 966 | contact?: string; |
| 967 | }; |
| 968 | customer_id?: string; |
| 969 | recurring?: boolean; |
| 970 | handler: (response: any) => void; |
| 971 | modal?: { |
| 972 | ondismiss: () => void; |
| 973 | }; |
| 974 | } |
| 975 | export interface RazorpayInstance { |
| 976 | open: () => void; |
| 977 | on: (event: string, callback: (response: any) => void) => void; |
| 978 | } |
| 979 | export type RazorpayConstructor = new (options: RazorpayOptions) => RazorpayInstance; |
| 980 | export interface ManualPaymentMethod { |
| 981 | id: string; |
| 982 | object: 'manual_payment_method'; |
| 983 | archived: boolean; |
| 984 | archived_at: number; |
| 985 | description: string; |
| 986 | instructions: string; |
| 987 | name: string; |
| 988 | created_at: number; |
| 989 | updated_at: number; |
| 990 | } |
| 991 | export interface PaymentMethodType { |
| 992 | id: string; |
| 993 | description: string; |
| 994 | image: string; |
| 995 | } |
| 996 | export interface Processor { |
| 997 | id: string; |
| 998 | live_mode: boolean; |
| 999 | processor_data: { |
| 1000 | account_id: string; |
| 1001 | recurring_enabled: boolean; |
| 1002 | client_id: string; |
| 1003 | merchant_initiated?: boolean; |
| 1004 | }; |
| 1005 | recurring_enabled: boolean; |
| 1006 | supported_currencies: Array<string>; |
| 1007 | processor_type: 'paypal' | 'stripe' | 'mollie' | 'mock'; |
| 1008 | } |
| 1009 | export interface Purchase { |
| 1010 | id: string; |
| 1011 | object: 'purchase'; |
| 1012 | live_mode: boolean; |
| 1013 | quantity: number; |
| 1014 | revoked: boolean; |
| 1015 | revoked_at: number; |
| 1016 | customer: string | Customer; |
| 1017 | invoice_item: string | InvoiceItem; |
| 1018 | invoice: string | Invoice; |
| 1019 | line_item: string | LineItem; |
| 1020 | order: string | Order; |
| 1021 | product: string | Product; |
| 1022 | variant?: string | Variant; |
| 1023 | refund: string | Refund; |
| 1024 | subscription: string | Subscription; |
| 1025 | license: string | License; |
| 1026 | created_at: number; |
| 1027 | updated_at: number; |
| 1028 | } |
| 1029 | export interface Refund { |
| 1030 | id: string; |
| 1031 | object: 'refund'; |
| 1032 | amount: number; |
| 1033 | currency: string; |
| 1034 | external_refund_id: string; |
| 1035 | live_mode: boolean; |
| 1036 | metadata: object; |
| 1037 | reason: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'expired_uncaptured_charge'; |
| 1038 | status: 'pending' | 'succeeded' | 'failed' | 'canceled'; |
| 1039 | charge: string | Charge; |
| 1040 | customer: string | Customer; |
| 1041 | revoked_purchases: null | Array<Purchase>; |
| 1042 | created_at: number; |
| 1043 | updated_at: number; |
| 1044 | } |
| 1045 | export interface Subscription extends Object { |
| 1046 | id: string; |
| 1047 | object: 'subscription'; |
| 1048 | currency?: string; |
| 1049 | status: SubscriptionStatus; |
| 1050 | live_mode: boolean; |
| 1051 | external_subscription_id: string; |
| 1052 | current_cancellation_act: string | CancellationAct; |
| 1053 | trial_end_at: number; |
| 1054 | trial_end_at_date: string; |
| 1055 | trial_end_at_date_time: string; |
| 1056 | processor_type: 'stripe' | 'paypal'; |
| 1057 | order: Order; |
| 1058 | customer: Customer; |
| 1059 | discount: DiscountResponse; |
| 1060 | finite: boolean; |
| 1061 | pending_update: { |
| 1062 | ad_hoc_amount?: number; |
| 1063 | price?: string; |
| 1064 | quantity?: number; |
| 1065 | variant?: string; |
| 1066 | }; |
| 1067 | purchase: Purchase | string; |
| 1068 | cancel_at_period_end: number | false; |
| 1069 | current_period: string | Period; |
| 1070 | current_period_end_at: number | false; |
| 1071 | current_period_end_at_date: string; |
| 1072 | current_period_end_at_date_time: string; |
| 1073 | current_period_start_at: number | false; |
| 1074 | current_period_start_at_date: string; |
| 1075 | remaining_period_count: number | null; |
| 1076 | remaining_period_text: string; |
| 1077 | ended_at: number; |
| 1078 | ended_at_date: string; |
| 1079 | end_behavior: 'cancel' | 'complete'; |
| 1080 | payment_method: PaymentMethod | string; |
| 1081 | manual_payment_method: ManualPaymentMethod | string; |
| 1082 | manual_payment: boolean; |
| 1083 | price: Price; |
| 1084 | ad_hoc_amount: number; |
| 1085 | variant?: Variant | string; |
| 1086 | variant_options?: Array<string>; |
| 1087 | created_at: number; |
| 1088 | created_at_date: string; |
| 1089 | updated_at: number; |
| 1090 | updated_at_date: string; |
| 1091 | restore_at?: number; |
| 1092 | can_modify?: boolean; |
| 1093 | } |
| 1094 | export interface CancellationAct { |
| 1095 | id: string; |
| 1096 | object: 'cancellation_act'; |
| 1097 | cancellation_reason: string | CancellationReason; |
| 1098 | comment: string; |
| 1099 | coupon_applied: boolean; |
| 1100 | preserved: boolean; |
| 1101 | subscription: string | Subscription; |
| 1102 | performed_at: number; |
| 1103 | created_at: number; |
| 1104 | updated_at: number; |
| 1105 | } |
| 1106 | export interface SubscriptionProtocol { |
| 1107 | id: string; |
| 1108 | object: 'subscription_protocol'; |
| 1109 | cancel_behavior: 'pending' | 'immediate'; |
| 1110 | downgrade_behavior: 'pending' | 'immediate'; |
| 1111 | payment_retry_window_weeks: number; |
| 1112 | upgrade_behavior: 'pending' | 'immediate'; |
| 1113 | preservation_enabled: boolean; |
| 1114 | preservation_locales: { |
| 1115 | reasons_title: string; |
| 1116 | reasons_description: string; |
| 1117 | skip_link: string; |
| 1118 | preserve_title: string; |
| 1119 | preserve_description: string; |
| 1120 | preserve_button: string; |
| 1121 | cancel_link: string; |
| 1122 | }; |
| 1123 | preservation_coupon: Coupon | string; |
| 1124 | created_at: number; |
| 1125 | updated_at: number; |
| 1126 | } |
| 1127 | export type SubscriptionStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'completed'; |
| 1128 | export type CheckoutStatus = 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'requires_approval'; |
| 1129 | export type OrderStatus = 'paid' | 'payment_failed' | 'processing' | 'void' | 'canceled' | 'draft'; |
| 1130 | export type InvoiceStatus = 'paid' | 'open' | 'draft'; |
| 1131 | export type OrderFulFillmentStatus = 'fulfilled' | 'unfulfilled' | 'partially_fulfilled' | 'scheduled' | 'on_hold'; |
| 1132 | export type OrderShipmentStatus = 'unshipped' | 'shipped' | 'partially_shipped' | 'delivered' | 'unshippable'; |
| 1133 | export type FulfillmentStatus = 'unshipped' | 'shipped' | 'delivered' | 'unshippable'; |
| 1134 | export type ReturnRequestStatus = 'open' | 'completed'; |
| 1135 | export interface PaymentMethod extends Object { |
| 1136 | id: string; |
| 1137 | object: 'payment_method'; |
| 1138 | live_mode: boolean; |
| 1139 | external_payment_method_id: string; |
| 1140 | processor_type: 'stripe' | 'paypal'; |
| 1141 | paypal_account: any; |
| 1142 | type: string; |
| 1143 | bank_account: BankAccount | string; |
| 1144 | payment_instrument: PaymentInstrument | string; |
| 1145 | payment_method_name: string; |
| 1146 | payment_intent: PaymentIntent | string; |
| 1147 | billing_agreement?: BillingAgreement | string; |
| 1148 | card: any; |
| 1149 | customer: Customer | string; |
| 1150 | created_at: number; |
| 1151 | updated_at: number; |
| 1152 | } |
| 1153 | export interface BankAccount { |
| 1154 | id: string; |
| 1155 | account_type: 'checking' | 'savings'; |
| 1156 | account_holder_type: 'individual' | 'company'; |
| 1157 | bank_name: string; |
| 1158 | last4: string; |
| 1159 | created_at: number; |
| 1160 | updated_at: number; |
| 1161 | } |
| 1162 | export interface PaymentInstrument { |
| 1163 | id: string; |
| 1164 | instrument_type: string; |
| 1165 | metadata: any; |
| 1166 | object: 'payment_instrument'; |
| 1167 | created_at: number; |
| 1168 | updated_at: number; |
| 1169 | } |
| 1170 | export interface BillingAgreement { |
| 1171 | email: string; |
| 1172 | external_customer_id: string; |
| 1173 | first_name: string; |
| 1174 | id: string; |
| 1175 | last_name: string; |
| 1176 | phone: string; |
| 1177 | object: 'billing_agreement'; |
| 1178 | created_at: number; |
| 1179 | updated_at: number; |
| 1180 | } |
| 1181 | export interface Pagination { |
| 1182 | count: number; |
| 1183 | limit: number; |
| 1184 | page: number; |
| 1185 | url: string; |
| 1186 | } |
| 1187 | export interface lineItems extends Object { |
| 1188 | object: 'list'; |
| 1189 | pagination: Pagination; |
| 1190 | data: Array<LineItem>; |
| 1191 | } |
| 1192 | export interface Promotion extends Object { |
| 1193 | code: string; |
| 1194 | created_at: number; |
| 1195 | expired: boolean; |
| 1196 | id: string; |
| 1197 | max_redemptions: number; |
| 1198 | metadata: Object; |
| 1199 | object: 'promotion'; |
| 1200 | redeem_by: string; |
| 1201 | times_redeemed: number; |
| 1202 | } |
| 1203 | export interface DiscountResponse { |
| 1204 | coupon?: Coupon; |
| 1205 | id: string; |
| 1206 | object: 'discount'; |
| 1207 | promotion: Promotion; |
| 1208 | redeemable_status: string; |
| 1209 | } |
| 1210 | export interface ResponseError { |
| 1211 | code?: string; |
| 1212 | message: string; |
| 1213 | data?: { |
| 1214 | http_status: string; |
| 1215 | status?: number; |
| 1216 | type: string; |
| 1217 | }; |
| 1218 | additional_errors?: Array<{ |
| 1219 | code: string; |
| 1220 | message: string; |
| 1221 | data: { |
| 1222 | attribute: string; |
| 1223 | options: Array<string>; |
| 1224 | type: string; |
| 1225 | }; |
| 1226 | }>; |
| 1227 | } |
| 1228 | export type ProcessorName = 'stripe' | 'paypal' | 'paypal-card'; |
| 1229 | export interface VerificationCode { |
| 1230 | id: string; |
| 1231 | object: 'verification_code'; |
| 1232 | code: number; |
| 1233 | verified: boolean; |
| 1234 | verified_at: number | null; |
| 1235 | redirect_url: string | null; |
| 1236 | created_at: number; |
| 1237 | updated_at: number; |
| 1238 | } |
| 1239 | export interface PaymentIntent extends Object { |
| 1240 | id: string; |
| 1241 | object: 'payment_intent'; |
| 1242 | amount: number; |
| 1243 | currency: string; |
| 1244 | processor_type: 'stripe' | 'paypal'; |
| 1245 | status: 'pending' | 'succeeded' | 'canceled'; |
| 1246 | external_intent_id: string; |
| 1247 | live_mode: boolean; |
| 1248 | processor_data: ProcessorData; |
| 1249 | customer: Customer | string; |
| 1250 | created_at: number; |
| 1251 | updated_at: number; |
| 1252 | payment_method: PaymentMethod | string; |
| 1253 | reusable: boolean; |
| 1254 | } |
| 1255 | export interface PaymentIntents { |
| 1256 | stripe?: PaymentIntent; |
| 1257 | paypal?: PaymentIntent; |
| 1258 | } |
| 1259 | export interface SetupIntent extends Object { |
| 1260 | id: string; |
| 1261 | object: 'setup_intent'; |
| 1262 | processor_type: 'stripe' | 'paypal'; |
| 1263 | status: 'pending' | 'succeeded' | 'canceled'; |
| 1264 | external_intent_id: string; |
| 1265 | live_mode: boolean; |
| 1266 | processor_data: ProcessorData; |
| 1267 | customer: Customer | string; |
| 1268 | created_at: number; |
| 1269 | updated_at: number; |
| 1270 | } |
| 1271 | export interface WordPressUser { |
| 1272 | id: number; |
| 1273 | display_name: string; |
| 1274 | first_name: string; |
| 1275 | last_name: string; |
| 1276 | email: string; |
| 1277 | } |
| 1278 | export interface Customer extends Object { |
| 1279 | id: string; |
| 1280 | email: string; |
| 1281 | name?: string; |
| 1282 | first_name?: string; |
| 1283 | last_name?: string; |
| 1284 | phone?: string; |
| 1285 | billing_address?: string | Address; |
| 1286 | billing_address_display?: string | Address; |
| 1287 | shipping_address?: string | Address; |
| 1288 | shipping_address_display?: string | Address; |
| 1289 | billing_matches_shipping: boolean; |
| 1290 | live_mode: boolean; |
| 1291 | unsubscribed: boolean; |
| 1292 | default_payment_method: string | PaymentMethod; |
| 1293 | tax_identifier: { |
| 1294 | number: string; |
| 1295 | number_type: string; |
| 1296 | }; |
| 1297 | created_at: number; |
| 1298 | updated_at: number; |
| 1299 | } |
| 1300 | export interface Address extends Object { |
| 1301 | name?: string | null; |
| 1302 | line_1?: string | null; |
| 1303 | line_2?: string | null; |
| 1304 | city?: string | null; |
| 1305 | state?: string | null; |
| 1306 | postal_code?: string | null; |
| 1307 | country?: string | null; |
| 1308 | } |
| 1309 | export interface GeoCapture { |
| 1310 | title?: string; |
| 1311 | content?: string; |
| 1312 | allowLabel?: string; |
| 1313 | declineLabel?: string; |
| 1314 | } |
| 1315 | export interface GeoCoordinates { |
| 1316 | latitude: number; |
| 1317 | longitude: number; |
| 1318 | } |
| 1319 | export interface GoogleMapAddressComponents extends Object { |
| 1320 | languageCode: string; |
| 1321 | longText: string; |
| 1322 | shortText: string; |
| 1323 | types: string[]; |
| 1324 | } |
| 1325 | export interface GoogleMapPlace extends Object { |
| 1326 | id?: string; |
| 1327 | displayName: { |
| 1328 | languageCode: string; |
| 1329 | text: string; |
| 1330 | }; |
| 1331 | addressComponents: Array<GoogleMapAddressComponents>; |
| 1332 | } |
| 1333 | export interface AddressSuggestion extends Object { |
| 1334 | displayName: string; |
| 1335 | fullDisplayName: string; |
| 1336 | placeId: string; |
| 1337 | addressComponents?: GoogleMapAddressComponents[]; |
| 1338 | } |
| 1339 | export interface Fulfillment { |
| 1340 | id: string; |
| 1341 | object: 'fulfillment'; |
| 1342 | number: string; |
| 1343 | shipment_status: FulfillmentStatus; |
| 1344 | trackings: { |
| 1345 | object: 'list'; |
| 1346 | pagination: Pagination; |
| 1347 | data: Array<Tracking>; |
| 1348 | }; |
| 1349 | fulfillment_items: { |
| 1350 | object: 'list'; |
| 1351 | pagination: Pagination; |
| 1352 | data: Array<FulfillmentItem>; |
| 1353 | }; |
| 1354 | } |
| 1355 | export interface FulfillmentItem { |
| 1356 | id: string; |
| 1357 | line_item: LineItem; |
| 1358 | quantity: number; |
| 1359 | fulfillment: string | Fulfillment; |
| 1360 | } |
| 1361 | export interface Tracking { |
| 1362 | courier_name?: string; |
| 1363 | number: string; |
| 1364 | url: string; |
| 1365 | } |
| 1366 | export interface PriceData extends Object { |
| 1367 | price_id: string; |
| 1368 | quantity: number; |
| 1369 | removeable: boolean; |
| 1370 | } |
| 1371 | export type TaxZone = { |
| 1372 | label: string; |
| 1373 | label_small: string; |
| 1374 | }; |
| 1375 | export type TaxZones = { |
| 1376 | [key in 'ca_gst' | 'au_abn' | 'gb_vat' | 'eu_vat' | 'other']: TaxZone; |
| 1377 | }; |
| 1378 | export type RuleName = 'total' | 'coupons' | 'products' | 'prices' | 'shipping_country' | 'billing_country' | 'processors'; |
| 1379 | export type ArrayOperators = 'all' | 'any' | 'none' | 'exist' | 'not_exist'; |
| 1380 | export type NumberOperators = '==' | '!=' | '<' | '>' | '<=' | '>='; |
| 1381 | export interface RuleGroup { |
| 1382 | group_id: string; |
| 1383 | rules: Rule[]; |
| 1384 | } |
| 1385 | export interface Rule { |
| 1386 | condition: RuleName; |
| 1387 | operator: NumberOperators | ArrayOperators; |
| 1388 | value: string | string[] | { |
| 1389 | value: string; |
| 1390 | }[]; |
| 1391 | } |
| 1392 | export interface ProductCollection { |
| 1393 | id: string; |
| 1394 | object: string; |
| 1395 | name: string; |
| 1396 | description?: string; |
| 1397 | position?: number; |
| 1398 | slug: string; |
| 1399 | image?: string; |
| 1400 | products_count: number; |
| 1401 | products?: Product[]; |
| 1402 | } |
| 1403 | export interface GoogleAnalyticsItem { |
| 1404 | item_id: string; |
| 1405 | item_name: string; |
| 1406 | item_variant?: string; |
| 1407 | item_category?: string; |
| 1408 | item_category2?: string; |
| 1409 | item_category3?: string; |
| 1410 | item_category4?: string; |
| 1411 | item_category5?: string; |
| 1412 | price: number; |
| 1413 | quantity: number; |
| 1414 | coupon?: string; |
| 1415 | currency: string; |
| 1416 | discount?: number; |
| 1417 | } |
| 1418 | export interface ProductState { |
| 1419 | formId: number; |
| 1420 | mode: 'live' | 'test'; |
| 1421 | product: Product; |
| 1422 | prices: Price[]; |
| 1423 | variants: Variant[]; |
| 1424 | variant_options: VariantOption[]; |
| 1425 | quantity: number; |
| 1426 | selectedPrice: Price; |
| 1427 | total: number; |
| 1428 | range_display_amount: string; |
| 1429 | busy: boolean; |
| 1430 | disabled: boolean; |
| 1431 | checkoutUrl: string; |
| 1432 | adHocAmount: number; |
| 1433 | dialog: string; |
| 1434 | line_item: LineItemData; |
| 1435 | error: string; |
| 1436 | selectedVariant?: Variant; |
| 1437 | variantValues: { |
| 1438 | option_1?: string; |
| 1439 | option_2?: string; |
| 1440 | option_3?: string; |
| 1441 | }; |
| 1442 | isProductPage?: boolean; |
| 1443 | note?: string; |
| 1444 | bundleComponentVariants?: Record<string, string>; |
| 1445 | } |
| 1446 | export interface FeaturedProductMediaAttributes { |
| 1447 | alt: string; |
| 1448 | url: string; |
| 1449 | title: string; |
| 1450 | } |
| 1451 | export interface PaymentInfoAddedParams { |
| 1452 | checkout_id: string; |
| 1453 | processor_type: 'paypal' | 'stripe' | 'mollie' | 'paystack'; |
| 1454 | currency: string; |
| 1455 | total_amount: number; |
| 1456 | line_items?: lineItems; |
| 1457 | payment_method: { |
| 1458 | billing_details: { |
| 1459 | name: string; |
| 1460 | email: string; |
| 1461 | }; |
| 1462 | }; |
| 1463 | } |
| 1464 | export interface CheckoutInitiatedParams { |
| 1465 | transaction_id: string; |
| 1466 | value: number; |
| 1467 | currency: string; |
| 1468 | coupon?: string; |
| 1469 | tax?: number; |
| 1470 | items: Array<{ |
| 1471 | item_name: string; |
| 1472 | discount: number; |
| 1473 | price: number; |
| 1474 | quantity: number; |
| 1475 | }>; |
| 1476 | } |
| 1477 | export interface ProductsSearchedParams { |
| 1478 | searchString: string; |
| 1479 | searchCollections?: string[]; |
| 1480 | searchResultCount: number; |
| 1481 | searchResultIds: string[]; |
| 1482 | } |
| 1483 | export interface ProductsViewedParams { |
| 1484 | products: Product[]; |
| 1485 | pageTitle: string; |
| 1486 | collectionId?: string; |
| 1487 | } |
| 1488 | export type NoticeType = 'default' | 'info' | 'success' | 'warning' | 'error'; |
| 1489 | interface AdditionalError { |
| 1490 | code: string; |
| 1491 | message: string; |
| 1492 | data: { |
| 1493 | attribute: string; |
| 1494 | type: string; |
| 1495 | options: { |
| 1496 | if: string[]; |
| 1497 | value: string; |
| 1498 | }; |
| 1499 | }; |
| 1500 | } |
| 1501 | export interface ScNoticeStore { |
| 1502 | type: NoticeType | 'default'; |
| 1503 | code: string; |
| 1504 | message: string; |
| 1505 | data?: { |
| 1506 | status: number; |
| 1507 | type: string; |
| 1508 | http_status: string; |
| 1509 | }; |
| 1510 | additional_errors?: AdditionalError[] | null; |
| 1511 | dismissible?: boolean; |
| 1512 | } |
| 1513 | export interface CustomStripeElementChangeEvent extends StripeElementChangeEvent { |
| 1514 | value?: { |
| 1515 | type: string; |
| 1516 | }; |
| 1517 | } |
| 1518 | export interface CountryLocaleFieldValue { |
| 1519 | name: string; |
| 1520 | priority?: number; |
| 1521 | label: string; |
| 1522 | } |
| 1523 | export interface CountryLocaleField { |
| 1524 | [key: string]: { |
| 1525 | name: CountryLocaleFieldValue; |
| 1526 | address_1: CountryLocaleFieldValue; |
| 1527 | address_2: CountryLocaleFieldValue; |
| 1528 | city: CountryLocaleFieldValue; |
| 1529 | state: CountryLocaleFieldValue; |
| 1530 | postcode: CountryLocaleFieldValue; |
| 1531 | }; |
| 1532 | } |
| 1533 | export {}; |
| 1534 |