components
3 years ago
functions
3 years ago
global
4 years ago
services
3 years ago
store
3 years ago
testing
4 years ago
components.d.ts
3 years ago
global.d.ts
4 years ago
index.d.ts
3 years ago
stencil-public-runtime.d.ts
3 years ago
types.d.ts
3 years ago
types.d.ts
858 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 | }; |
| 57 | ceRegisterIconLibrary: any; |
| 58 | ResizeObserver: any; |
| 59 | } |
| 60 | } |
| 61 | export type RecursivePartial<T> = { |
| 62 | [P in keyof T]?: RecursivePartial<T[P]>; |
| 63 | }; |
| 64 | interface Model { |
| 65 | created_at: number; |
| 66 | updated_at: number; |
| 67 | } |
| 68 | export interface ChoiceItem extends Object { |
| 69 | value: string; |
| 70 | label: string; |
| 71 | disabled?: boolean; |
| 72 | choices?: ChoiceItem[]; |
| 73 | suffix?: string; |
| 74 | icon?: string; |
| 75 | } |
| 76 | export type ChoiceType = 'all' | 'single' | 'multiple'; |
| 77 | export interface Price { |
| 78 | id: string; |
| 79 | name: string; |
| 80 | description?: string; |
| 81 | amount: number; |
| 82 | currency: string; |
| 83 | recurring: boolean; |
| 84 | recurring_interval?: 'week' | 'month' | 'year' | 'never'; |
| 85 | recurring_interval_count?: number; |
| 86 | trial_duration_days?: number; |
| 87 | ad_hoc: boolean; |
| 88 | ad_hoc_max_amount: number; |
| 89 | ad_hoc_min_amount: number; |
| 90 | scratch_amount: number; |
| 91 | setup_fee_enabled: boolean; |
| 92 | setup_fee_amount: number; |
| 93 | setup_fee_name: string; |
| 94 | setup_fee_trial_enabled: boolean; |
| 95 | recurring_period_count: number; |
| 96 | archived: boolean; |
| 97 | product_id?: string; |
| 98 | archived_at?: string; |
| 99 | created_at: number; |
| 100 | updated_at: number; |
| 101 | product?: Product | string; |
| 102 | position: number; |
| 103 | metadata: { |
| 104 | [key: string]: string; |
| 105 | }; |
| 106 | } |
| 107 | export interface Bump { |
| 108 | id: string; |
| 109 | object: 'bump'; |
| 110 | amount_off: number; |
| 111 | archived: boolean; |
| 112 | archived_at: number; |
| 113 | auto_apply: boolean; |
| 114 | filter_match_type: 'all' | 'any' | 'none'; |
| 115 | filters: any; |
| 116 | metadata: any; |
| 117 | name: string; |
| 118 | percent_off: number; |
| 119 | price: string | Price; |
| 120 | priority: 1 | 2 | 3 | 4 | 5; |
| 121 | created_at: number; |
| 122 | updated_at: number; |
| 123 | } |
| 124 | export type Prices = { |
| 125 | [id: string]: Price; |
| 126 | }; |
| 127 | export interface Media { |
| 128 | id: string; |
| 129 | object: 'media'; |
| 130 | byte_size: number; |
| 131 | content_type: string; |
| 132 | extension: string; |
| 133 | filename: string; |
| 134 | public_access: boolean; |
| 135 | release_json: any; |
| 136 | url?: string; |
| 137 | url_expires_at?: number; |
| 138 | updated_at: number; |
| 139 | created_at: number; |
| 140 | } |
| 141 | export interface Download { |
| 142 | id: string; |
| 143 | object: 'download'; |
| 144 | archived: boolean; |
| 145 | archived_at?: number; |
| 146 | media: string | Media; |
| 147 | name?: string; |
| 148 | product: string | Product; |
| 149 | update_at: number; |
| 150 | created_at: number; |
| 151 | url?: string; |
| 152 | } |
| 153 | export type FormState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalizing' | 'paying' | 'confirming' | 'confirmed' | 'paid' | 'failure' | 'expired' | 'redirecting'; |
| 154 | export type FormStateSetter = 'RESOLVE' | 'REJECT' | 'FINALIZE' | 'PAYING' | 'PAID' | 'EXPIRE' | 'FETCH'; |
| 155 | export interface License { |
| 156 | id: string; |
| 157 | object: 'license'; |
| 158 | activation_limit: number; |
| 159 | key: string; |
| 160 | activations?: { |
| 161 | object: 'list'; |
| 162 | pagination: Pagination; |
| 163 | data: Array<Activation>; |
| 164 | }; |
| 165 | status: 'inactive' | 'active' | 'revoked'; |
| 166 | purchase: string | Purchase; |
| 167 | created_at: number; |
| 168 | updated_at: number; |
| 169 | } |
| 170 | export interface CancellationReason { |
| 171 | id: string; |
| 172 | object: 'cancellation_reason'; |
| 173 | archived: boolean; |
| 174 | comment_enabled: false; |
| 175 | comment_prompt: string | null; |
| 176 | coupon_enabled: boolean; |
| 177 | label: string; |
| 178 | position: number; |
| 179 | archived_at: number; |
| 180 | discarded_at: number; |
| 181 | created_at: number; |
| 182 | updated_at: number; |
| 183 | } |
| 184 | export interface Period { |
| 185 | id: string; |
| 186 | object: 'period'; |
| 187 | ad_hoc_amount?: number; |
| 188 | checkout: string | Checkout; |
| 189 | customer_id: string | Customer; |
| 190 | end_at?: number; |
| 191 | next_payment_retry_at: number; |
| 192 | payment_retry_count: number; |
| 193 | price: string | Price; |
| 194 | purchase_id: string | Purchase; |
| 195 | quantity: number; |
| 196 | renewal: boolean; |
| 197 | skip_proration: boolean; |
| 198 | start_at: number; |
| 199 | status: 'draft'; |
| 200 | subscription: string | Subscription; |
| 201 | created_at: number; |
| 202 | updated_at: number; |
| 203 | } |
| 204 | export interface Activation { |
| 205 | id: string; |
| 206 | object: 'activation'; |
| 207 | name: string; |
| 208 | counted: boolean; |
| 209 | fingerprint: string; |
| 210 | license: string | License; |
| 211 | created_at: number; |
| 212 | updated_at: number; |
| 213 | } |
| 214 | export interface Product extends Object { |
| 215 | id: string; |
| 216 | name: string; |
| 217 | description: string; |
| 218 | archived: boolean; |
| 219 | archived_at: string; |
| 220 | metadata: any; |
| 221 | image_url: string; |
| 222 | recurring: boolean; |
| 223 | tax_category: string; |
| 224 | tax_enabled: boolean; |
| 225 | purchase_limit: number; |
| 226 | permalink: string; |
| 227 | prices: { |
| 228 | object: 'list'; |
| 229 | pagination: Pagination; |
| 230 | data: Array<Price>; |
| 231 | }; |
| 232 | product_medias: { |
| 233 | object: 'list'; |
| 234 | pagination: Pagination; |
| 235 | data: Array<ProductMedia>; |
| 236 | }; |
| 237 | downloads: { |
| 238 | object: 'list'; |
| 239 | pagination: Pagination; |
| 240 | data: Array<Download>; |
| 241 | }; |
| 242 | created_at: number; |
| 243 | updated_at: number; |
| 244 | } |
| 245 | export type Products = { |
| 246 | [id: string]: Product; |
| 247 | }; |
| 248 | export interface Coupon extends Model { |
| 249 | id: string; |
| 250 | object: 'coupon'; |
| 251 | amount_off: number; |
| 252 | valid?: boolean; |
| 253 | expired: boolean; |
| 254 | currency: string; |
| 255 | duration: string; |
| 256 | duration_in_months: number; |
| 257 | max_redemptions: number; |
| 258 | metadata: Object; |
| 259 | name: string; |
| 260 | percent_off: number; |
| 261 | redeem_by: number; |
| 262 | times_redeemed: number; |
| 263 | } |
| 264 | export interface LineItemData extends Object { |
| 265 | price_id?: string; |
| 266 | bump?: string; |
| 267 | quantity: number; |
| 268 | ad_hoc_amount?: number; |
| 269 | } |
| 270 | export type LineItemsData = { |
| 271 | [id: string]: Array<LineItemData>; |
| 272 | }; |
| 273 | export interface LineItem extends Object { |
| 274 | id?: string; |
| 275 | ad_hoc_amount?: number; |
| 276 | name: string; |
| 277 | object: string; |
| 278 | quantity: number; |
| 279 | checkout: string | Checkout; |
| 280 | bump: string | Bump; |
| 281 | fees?: { |
| 282 | object: 'list'; |
| 283 | pagination: Pagination; |
| 284 | data: Array<Fee>; |
| 285 | }; |
| 286 | bump_amount: number; |
| 287 | discount_amount: number; |
| 288 | subtotal_amount: number; |
| 289 | total_amount: number; |
| 290 | scratch_amount: number; |
| 291 | total_savings_amount: number; |
| 292 | created_at: number; |
| 293 | updated_at: number; |
| 294 | price?: Price; |
| 295 | price_id: string; |
| 296 | } |
| 297 | export interface DeletedItem { |
| 298 | cache_status: string; |
| 299 | deleted: boolean; |
| 300 | id: string; |
| 301 | object: string; |
| 302 | } |
| 303 | export interface Fee { |
| 304 | id: string; |
| 305 | object: 'fee'; |
| 306 | amount: number; |
| 307 | description: string; |
| 308 | fee_type: 'manual' | 'bump' | 'setup'; |
| 309 | line_item: string | LineItem; |
| 310 | created_at: number; |
| 311 | updated_at: number; |
| 312 | } |
| 313 | export interface InvoiceItem extends LineItem { |
| 314 | } |
| 315 | export interface PriceChoice { |
| 316 | id: string; |
| 317 | product_id: string; |
| 318 | quantity: number; |
| 319 | enabled: boolean; |
| 320 | selected?: boolean; |
| 321 | } |
| 322 | export type CheckoutState = 'idle' | 'loading' | 'draft' | 'updating' | 'finalized' | 'paid' | 'failure'; |
| 323 | export type TaxStatus = 'disabled' | 'address_invalid' | 'reverse_charged' | 'tax_registration_not_found' | 'tax_zone_not_found' | 'estimated' | 'calculated'; |
| 324 | export interface Invoice extends Object { |
| 325 | id: string; |
| 326 | object: 'invoice'; |
| 327 | currency: string; |
| 328 | amount_due: number; |
| 329 | invoice_items: { |
| 330 | object: 'list'; |
| 331 | pagination: Pagination; |
| 332 | data: Array<InvoiceItem>; |
| 333 | }; |
| 334 | discount_amount: number; |
| 335 | live_mode: boolean; |
| 336 | metadata: object; |
| 337 | number: string; |
| 338 | period_end_at: number; |
| 339 | period_start_at: number; |
| 340 | proration_amount: number; |
| 341 | processor_data: { |
| 342 | stripe: object; |
| 343 | }; |
| 344 | status: OrderStatus; |
| 345 | subtotal_amount: number; |
| 346 | tax_amount: number; |
| 347 | tax_status: TaxStatus; |
| 348 | tax_label: string; |
| 349 | total_amount: number; |
| 350 | billing_address: string | BillingAddress; |
| 351 | charge: string | Charge; |
| 352 | customer: string | Customer; |
| 353 | discount: string | object; |
| 354 | payment_intent: string | PaymentIntent; |
| 355 | payment_method: string | PaymentMethod; |
| 356 | shipping_address: string | ShippingAddress; |
| 357 | subscription: string | Subscription; |
| 358 | tax_identifier: string | object; |
| 359 | url: string; |
| 360 | created_at: number; |
| 361 | updated_at: number; |
| 362 | } |
| 363 | export interface BillingAddress extends Address { |
| 364 | } |
| 365 | export interface ShippingAddress extends Address { |
| 366 | } |
| 367 | export interface ProductGroup { |
| 368 | id: string; |
| 369 | object: 'product_group'; |
| 370 | archived: boolean; |
| 371 | archived_at: number; |
| 372 | metadata: object; |
| 373 | name: string; |
| 374 | created_at: number; |
| 375 | updated_at: number; |
| 376 | } |
| 377 | export interface ProductMedia { |
| 378 | id: string; |
| 379 | object: 'product_media'; |
| 380 | position: number; |
| 381 | url: null; |
| 382 | media: string | Media; |
| 383 | product: string | Product; |
| 384 | created_at: number; |
| 385 | updated_at: number; |
| 386 | } |
| 387 | export interface Charge extends Object { |
| 388 | amount: number; |
| 389 | created_at: number; |
| 390 | currency: string; |
| 391 | customer: string | Customer; |
| 392 | external_charge_id: string; |
| 393 | fully_refunded: boolean; |
| 394 | id: string; |
| 395 | invoice: string | Invoice; |
| 396 | live_mode: boolean; |
| 397 | object: 'charge'; |
| 398 | checkout: string | Checkout; |
| 399 | payment_method: string | PaymentMethod; |
| 400 | refunded_amount: number; |
| 401 | status: 'pending' | 'succeeded' | 'failed'; |
| 402 | updated_at: number; |
| 403 | } |
| 404 | export interface TaxIdentifier { |
| 405 | id: string; |
| 406 | number: string; |
| 407 | number_type: string; |
| 408 | object: 'tax_identifier'; |
| 409 | eu_vat_verified: boolean; |
| 410 | created_at: number; |
| 411 | updated_at: number; |
| 412 | } |
| 413 | export interface TaxProtocol { |
| 414 | id: string; |
| 415 | object: 'tax_protocol'; |
| 416 | ca_tax_enabled: boolean; |
| 417 | eu_micro_exemption_enabled: boolean; |
| 418 | eu_tax_enabled: boolean; |
| 419 | eu_vat_required: boolean; |
| 420 | eu_vat_unverified_behavior: 'error' | 'apply_reverse_charge' | 'skip_reverse_charge'; |
| 421 | eu_vat_local_reverse_charge: boolean; |
| 422 | tax_enabled: boolean; |
| 423 | address: string | Address; |
| 424 | ca_tax_identifier: string | TaxIdentifier; |
| 425 | eu_tax_identifier: string | TaxIdentifier; |
| 426 | created_at: number; |
| 427 | updated_at: number; |
| 428 | } |
| 429 | export interface Order extends Object { |
| 430 | id?: string; |
| 431 | object: 'order'; |
| 432 | number?: string; |
| 433 | order_type?: 'checkout' | 'subscription'; |
| 434 | statement_url?: string; |
| 435 | status?: OrderStatus; |
| 436 | checkout?: Checkout | string; |
| 437 | created_at: number; |
| 438 | updated_at: number; |
| 439 | } |
| 440 | export interface Checkout extends Object { |
| 441 | id?: string; |
| 442 | status?: 'canceled' | 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'processing'; |
| 443 | staged_payment_intents: { |
| 444 | object: 'list'; |
| 445 | pagination: Pagination; |
| 446 | data: Array<PaymentIntent>; |
| 447 | }; |
| 448 | abandoned_checkout_enabled: boolean; |
| 449 | bump_amount: number; |
| 450 | payment_method_required?: boolean; |
| 451 | manual_payment: boolean; |
| 452 | manual_payment_method?: string | ManualPaymentMethod; |
| 453 | reusable_payment_method_required?: boolean; |
| 454 | number?: string; |
| 455 | amount_due?: number; |
| 456 | trial_amount?: number; |
| 457 | charge?: string | Charge; |
| 458 | name?: string; |
| 459 | first_name?: string; |
| 460 | last_name?: string; |
| 461 | email?: string; |
| 462 | phone?: string; |
| 463 | live_mode?: boolean; |
| 464 | currency?: string; |
| 465 | total_amount?: number; |
| 466 | subtotal_amount?: number; |
| 467 | full_amount?: number; |
| 468 | proration_amount?: number; |
| 469 | total_savings_amount?: number; |
| 470 | applied_balance_amount?: number; |
| 471 | discounts?: number; |
| 472 | tax_enabled: boolean; |
| 473 | tax_amount: number; |
| 474 | email_exists: boolean; |
| 475 | tax_inclusive_amount: number; |
| 476 | tax_exclusive_amount: number; |
| 477 | tax_status: 'disabled' | 'address_invalid' | 'estimated' | 'calculated'; |
| 478 | tax_label: string; |
| 479 | tax_percent: number; |
| 480 | line_items: lineItems; |
| 481 | recommended_bumps?: { |
| 482 | object: 'list'; |
| 483 | pagination: Pagination; |
| 484 | data: Array<Bump>; |
| 485 | }; |
| 486 | metadata?: any; |
| 487 | payment_intent?: PaymentIntent; |
| 488 | payment_method?: PaymentMethod; |
| 489 | order?: string | Order; |
| 490 | customer: string | Customer; |
| 491 | subscriptions: { |
| 492 | object: 'list'; |
| 493 | pagination: Pagination; |
| 494 | data: Array<Subscription>; |
| 495 | }; |
| 496 | purchases: { |
| 497 | object: 'list'; |
| 498 | pagination: Pagination; |
| 499 | data: Array<Purchase>; |
| 500 | }; |
| 501 | discount_amount?: number; |
| 502 | discount?: DiscountResponse; |
| 503 | billing_address?: string | Address; |
| 504 | shipping_address?: string | Address; |
| 505 | shipping_enabled?: boolean; |
| 506 | processor_data?: ProcessorData; |
| 507 | tax_identifier?: { |
| 508 | number: string; |
| 509 | number_type: string; |
| 510 | }; |
| 511 | url: string; |
| 512 | created_at?: number; |
| 513 | } |
| 514 | export interface ProcessorData { |
| 515 | stripe: { |
| 516 | account_id: string; |
| 517 | publishable_key: string; |
| 518 | client_secret?: string; |
| 519 | type: 'payment' | 'setup'; |
| 520 | }; |
| 521 | paypal: { |
| 522 | account_id: string; |
| 523 | client_id: string; |
| 524 | merchant_initiated: boolean; |
| 525 | }; |
| 526 | mollie?: { |
| 527 | account_id: 'string'; |
| 528 | checkout_url: 'string'; |
| 529 | }; |
| 530 | } |
| 531 | export interface ManualPaymentMethod { |
| 532 | id: string; |
| 533 | object: 'manual_payment_method'; |
| 534 | archived: boolean; |
| 535 | archived_at: number; |
| 536 | description: string; |
| 537 | instructions: string; |
| 538 | name: string; |
| 539 | created_at: number; |
| 540 | updated_at: number; |
| 541 | } |
| 542 | export interface PaymentMethodType { |
| 543 | id: string; |
| 544 | description: string; |
| 545 | image: string; |
| 546 | } |
| 547 | export interface Processor { |
| 548 | id: string; |
| 549 | live_mode: boolean; |
| 550 | processor_data: { |
| 551 | account_id: string; |
| 552 | recurring_enabled: boolean; |
| 553 | client_id: string; |
| 554 | merchant_initiated?: boolean; |
| 555 | }; |
| 556 | recurring_enabled: boolean; |
| 557 | processor_type: 'paypal' | 'stripe' | 'mollie'; |
| 558 | } |
| 559 | export interface Purchase { |
| 560 | id: string; |
| 561 | object: 'purchase'; |
| 562 | live_mode: boolean; |
| 563 | quantity: number; |
| 564 | revoked: boolean; |
| 565 | revoked_at: number; |
| 566 | customer: string | Customer; |
| 567 | invoice_item: string | InvoiceItem; |
| 568 | invoice: string | Invoice; |
| 569 | line_item: string | LineItem; |
| 570 | order: string | Order; |
| 571 | product: string | Product; |
| 572 | refund: string | Refund; |
| 573 | subscription: string | Subscription; |
| 574 | license: string | License; |
| 575 | created_at: number; |
| 576 | updated_at: number; |
| 577 | } |
| 578 | export interface Refund { |
| 579 | id: string; |
| 580 | object: 'refund'; |
| 581 | amount: number; |
| 582 | currency: string; |
| 583 | external_refund_id: string; |
| 584 | live_mode: boolean; |
| 585 | metadata: object; |
| 586 | reason: 'duplicate' | 'fraudulent' | 'requested_by_customer' | 'expired_uncaptured_charge'; |
| 587 | status: 'pending' | 'succeeded' | 'failed' | 'canceled'; |
| 588 | charge: string | Charge; |
| 589 | customer: string | Customer; |
| 590 | revoked_purchases: null | Array<Purchase>; |
| 591 | created_at: number; |
| 592 | updated_at: number; |
| 593 | } |
| 594 | export interface Subscription extends Object { |
| 595 | id: string; |
| 596 | object: 'subscription'; |
| 597 | currency?: string; |
| 598 | status: SubscriptionStatus; |
| 599 | live_mode: boolean; |
| 600 | external_subscription_id: string; |
| 601 | current_cancellation_act: string | CancellationAct; |
| 602 | trial_end_at: number; |
| 603 | processor_type: 'stripe' | 'paypal'; |
| 604 | order: Order; |
| 605 | customer: Customer; |
| 606 | discount: DiscountResponse; |
| 607 | finite: boolean; |
| 608 | pending_update: { |
| 609 | ad_hoc_amount?: number; |
| 610 | price?: string; |
| 611 | quantity?: number; |
| 612 | }; |
| 613 | purchase: Purchase | string; |
| 614 | cancel_at_period_end: number | false; |
| 615 | current_period: string | Period; |
| 616 | current_period_end_at: number | false; |
| 617 | current_period_start_at: number | false; |
| 618 | remaining_period_count: number | null; |
| 619 | ended_at: number; |
| 620 | end_behavior: 'cancel' | 'complete'; |
| 621 | payment_method: PaymentMethod | string; |
| 622 | price: Price; |
| 623 | ad_hoc_amount: number; |
| 624 | created_at: number; |
| 625 | updated_at: number; |
| 626 | restore_at?: number; |
| 627 | } |
| 628 | export interface CancellationAct { |
| 629 | id: string; |
| 630 | object: 'cancellation_act'; |
| 631 | cancellation_reason: string | CancellationReason; |
| 632 | comment: string; |
| 633 | coupon_applied: boolean; |
| 634 | preserved: boolean; |
| 635 | subscription: string | Subscription; |
| 636 | performed_at: number; |
| 637 | created_at: number; |
| 638 | updated_at: number; |
| 639 | } |
| 640 | export interface SubscriptionProtocol { |
| 641 | id: string; |
| 642 | object: 'subscription_protocol'; |
| 643 | cancel_behavior: 'pending' | 'immediate'; |
| 644 | downgrade_behavior: 'pending' | 'immediate'; |
| 645 | payment_retry_window_weeks: number; |
| 646 | upgrade_behavior: 'pending' | 'immediate'; |
| 647 | preservation_enabled: boolean; |
| 648 | preservation_locales: { |
| 649 | reasons_title: string; |
| 650 | reasons_description: string; |
| 651 | skip_link: string; |
| 652 | preserve_title: string; |
| 653 | preserve_description: string; |
| 654 | preserve_button: string; |
| 655 | cancel_link: string; |
| 656 | }; |
| 657 | preservation_coupon: Coupon | string; |
| 658 | created_at: number; |
| 659 | updated_at: number; |
| 660 | } |
| 661 | export type SubscriptionStatus = 'incomplete' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'completed'; |
| 662 | export type CheckoutStatus = 'draft' | 'finalized' | 'paid' | 'payment_intent_canceled' | 'payment_failed' | 'requires_approval'; |
| 663 | export type OrderStatus = 'paid' | 'payment_failed' | 'processing' | 'void' | 'canceled'; |
| 664 | export interface PaymentMethod extends Object { |
| 665 | id: string; |
| 666 | object: 'payment_method'; |
| 667 | live_mode: boolean; |
| 668 | external_payment_method_id: string; |
| 669 | processor_type: 'stripe' | 'paypal'; |
| 670 | paypal_account: any; |
| 671 | type: string; |
| 672 | bank_account: BankAccount | string; |
| 673 | payment_instrument: PaymentInstrument | string; |
| 674 | payment_intent: PaymentIntent | string; |
| 675 | billing_agreement?: BillingAgreement | string; |
| 676 | card: any; |
| 677 | customer: Customer | string; |
| 678 | created_at: number; |
| 679 | updated_at: number; |
| 680 | } |
| 681 | export interface BankAccount { |
| 682 | id: string; |
| 683 | account_type: 'checking' | 'savings'; |
| 684 | account_holder_type: 'individual' | 'company'; |
| 685 | bank_name: string; |
| 686 | last4: string; |
| 687 | created_at: number; |
| 688 | updated_at: number; |
| 689 | } |
| 690 | export interface PaymentInstrument { |
| 691 | id: string; |
| 692 | instrument_type: string; |
| 693 | metadata: any; |
| 694 | object: 'payment_instrument'; |
| 695 | created_at: number; |
| 696 | updated_at: number; |
| 697 | } |
| 698 | export interface BillingAgreement { |
| 699 | email: string; |
| 700 | external_customer_id: string; |
| 701 | first_name: string; |
| 702 | id: string; |
| 703 | last_name: string; |
| 704 | phone: string; |
| 705 | object: 'billing_agreement'; |
| 706 | created_at: number; |
| 707 | updated_at: number; |
| 708 | } |
| 709 | export interface Pagination { |
| 710 | count: number; |
| 711 | limit: number; |
| 712 | page: number; |
| 713 | url: string; |
| 714 | } |
| 715 | export interface lineItems extends Object { |
| 716 | object: 'list'; |
| 717 | pagination: Pagination; |
| 718 | data: Array<LineItem>; |
| 719 | } |
| 720 | export interface Promotion extends Object { |
| 721 | code: string; |
| 722 | created_at: number; |
| 723 | expired: boolean; |
| 724 | id: string; |
| 725 | max_redemptions: number; |
| 726 | metadata: Object; |
| 727 | object: 'promotion'; |
| 728 | redeem_by: string; |
| 729 | times_redeemed: number; |
| 730 | } |
| 731 | export interface DiscountResponse { |
| 732 | coupon?: Coupon; |
| 733 | id: string; |
| 734 | object: 'discount'; |
| 735 | promotion: Promotion; |
| 736 | } |
| 737 | export interface ResponseError { |
| 738 | code: string; |
| 739 | message: string; |
| 740 | data: { |
| 741 | http_status: string; |
| 742 | status?: number; |
| 743 | type: string; |
| 744 | }; |
| 745 | additional_errors: Array<{ |
| 746 | code: string; |
| 747 | message: string; |
| 748 | data: { |
| 749 | attribute: string; |
| 750 | options: Array<string>; |
| 751 | type: string; |
| 752 | }; |
| 753 | }>; |
| 754 | } |
| 755 | export type ProcessorName = 'stripe' | 'paypal' | 'paypal-card'; |
| 756 | export interface VerificationCode { |
| 757 | id: string; |
| 758 | object: 'verification_code'; |
| 759 | code: number; |
| 760 | verified: boolean; |
| 761 | verified_at: number | null; |
| 762 | created_at: number; |
| 763 | updated_at: number; |
| 764 | } |
| 765 | export interface PaymentIntent extends Object { |
| 766 | id: string; |
| 767 | object: 'payment_intent'; |
| 768 | amount: number; |
| 769 | currency: string; |
| 770 | processor_type: 'stripe' | 'paypal'; |
| 771 | status: 'pending' | 'succeeded' | 'canceled'; |
| 772 | external_intent_id: string; |
| 773 | live_mode: boolean; |
| 774 | processor_data: ProcessorData; |
| 775 | customer: Customer | string; |
| 776 | created_at: number; |
| 777 | updated_at: number; |
| 778 | } |
| 779 | export interface PaymentIntents { |
| 780 | stripe?: PaymentIntent; |
| 781 | paypal?: PaymentIntent; |
| 782 | } |
| 783 | export interface SetupIntent extends Object { |
| 784 | id: string; |
| 785 | object: 'setup_intent'; |
| 786 | processor_type: 'stripe' | 'paypal'; |
| 787 | status: 'pending' | 'succeeded' | 'canceled'; |
| 788 | external_intent_id: string; |
| 789 | live_mode: boolean; |
| 790 | processor_data: ProcessorData; |
| 791 | customer: Customer | string; |
| 792 | created_at: number; |
| 793 | updated_at: number; |
| 794 | } |
| 795 | export interface WordPressUser { |
| 796 | id: number; |
| 797 | display_name: string; |
| 798 | first_name: string; |
| 799 | last_name: string; |
| 800 | email: string; |
| 801 | } |
| 802 | export interface Customer extends Object { |
| 803 | id: string; |
| 804 | email: string; |
| 805 | name?: string; |
| 806 | first_name?: string; |
| 807 | last_name?: string; |
| 808 | phone?: string; |
| 809 | billing_address?: string | Address; |
| 810 | shipping_address?: string | Address; |
| 811 | billing_matches_shipping: boolean; |
| 812 | live_mode: boolean; |
| 813 | unsubscribed: boolean; |
| 814 | default_payment_method: string | PaymentMethod; |
| 815 | tax_identifier: { |
| 816 | number: string; |
| 817 | number_type: string; |
| 818 | }; |
| 819 | created_at: number; |
| 820 | updated_at: number; |
| 821 | } |
| 822 | export interface Address extends Object { |
| 823 | name?: string; |
| 824 | line_1?: string; |
| 825 | line_2?: string; |
| 826 | city?: string; |
| 827 | state?: string; |
| 828 | postal_code?: string; |
| 829 | country?: string; |
| 830 | } |
| 831 | export interface PriceData extends Object { |
| 832 | price_id: string; |
| 833 | quantity: number; |
| 834 | removeable: boolean; |
| 835 | } |
| 836 | export type TaxZone = { |
| 837 | label: string; |
| 838 | label_small: string; |
| 839 | }; |
| 840 | export type TaxZones = { |
| 841 | [key in 'ca_gst' | 'au_abn' | 'gb_vat' | 'eu_vat' | 'other']: TaxZone; |
| 842 | }; |
| 843 | export type RuleName = 'total' | 'coupons' | 'products' | 'shipping_country' | 'billing_country' | 'processors'; |
| 844 | export type ArrayOperators = 'all' | 'any' | 'none' | 'exist' | 'not_exist'; |
| 845 | export type NumberOperators = '==' | '!=' | '<' | '>' | '<=' | '>='; |
| 846 | export interface RuleGroup { |
| 847 | group_id: string; |
| 848 | rules: Rule[]; |
| 849 | } |
| 850 | export interface Rule { |
| 851 | condition: RuleName; |
| 852 | operator: NumberOperators | ArrayOperators; |
| 853 | value: string | string[] | { |
| 854 | value: string; |
| 855 | }[]; |
| 856 | } |
| 857 | export {}; |
| 858 |