2021-02-09 12:09:26 +01:00
|
|
|
import { StripeIbanElement } from '@stripe/stripe-js';
|
|
|
|
|
2021-01-27 13:59:41 +01:00
|
|
|
export enum PaymentScheduleItemState {
|
|
|
|
New = 'new',
|
|
|
|
Pending = 'pending',
|
2021-01-27 17:24:10 +01:00
|
|
|
RequirePaymentMethod = 'requires_payment_method',
|
|
|
|
RequireAction = 'requires_action',
|
|
|
|
Paid = 'paid',
|
|
|
|
Error = 'error'
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum PaymentMethod {
|
|
|
|
Stripe = 'stripe',
|
|
|
|
Check = 'check'
|
2021-01-27 13:59:41 +01:00
|
|
|
}
|
2020-11-05 17:32:37 +01:00
|
|
|
export interface PaymentScheduleItem {
|
|
|
|
id: number,
|
2020-11-12 16:44:55 +01:00
|
|
|
amount: number,
|
2021-01-25 17:42:30 +01:00
|
|
|
due_date: Date,
|
2021-01-27 13:59:41 +01:00
|
|
|
state: PaymentScheduleItemState,
|
2021-01-25 17:42:30 +01:00
|
|
|
invoice_id: number,
|
2021-01-27 17:24:10 +01:00
|
|
|
payment_method: PaymentMethod,
|
|
|
|
client_secret?: string,
|
2020-11-12 16:44:55 +01:00
|
|
|
details: {
|
|
|
|
recurring: number,
|
2021-02-08 15:28:47 +01:00
|
|
|
adjustment?: number,
|
|
|
|
other_items?: number,
|
|
|
|
without_coupon?: number,
|
|
|
|
subscription_id: number
|
2020-11-12 16:44:55 +01:00
|
|
|
}
|
2020-11-05 17:32:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface PaymentSchedule {
|
2021-02-04 15:47:11 +01:00
|
|
|
max_length: number;
|
2020-11-05 17:32:37 +01:00
|
|
|
id: number,
|
|
|
|
scheduled_type: string,
|
|
|
|
scheduled_id: number,
|
|
|
|
total: number,
|
|
|
|
stp_subscription_id: string,
|
|
|
|
reference: string,
|
|
|
|
payment_method: string,
|
|
|
|
wallet_amount: number,
|
2021-01-25 17:42:30 +01:00
|
|
|
items: Array<PaymentScheduleItem>,
|
|
|
|
created_at: Date,
|
|
|
|
chained_footprint: boolean,
|
|
|
|
user: {
|
2021-02-09 12:09:26 +01:00
|
|
|
id: number,
|
2021-01-25 17:42:30 +01:00
|
|
|
name: string
|
|
|
|
},
|
|
|
|
operator: {
|
|
|
|
id: number,
|
|
|
|
first_name: string,
|
|
|
|
last_name: string,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PaymentScheduleIndexRequest {
|
|
|
|
query: {
|
|
|
|
reference?: string,
|
|
|
|
customer?: string,
|
|
|
|
date?: Date,
|
|
|
|
page: number,
|
|
|
|
size: number
|
|
|
|
}
|
2020-11-05 17:32:37 +01:00
|
|
|
}
|
2021-02-08 08:56:01 +01:00
|
|
|
|
|
|
|
export interface CashCheckResponse {
|
|
|
|
state: PaymentScheduleItemState,
|
|
|
|
payment_method: PaymentMethod
|
|
|
|
}
|
2021-02-09 12:09:26 +01:00
|
|
|
|
|
|
|
export interface RefreshItemResponse {
|
|
|
|
state: 'refreshed'
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PayItemResponse {
|
|
|
|
status: 'draft' | 'open' | 'paid' | 'uncollectible' | 'void',
|
|
|
|
error?: string
|
|
|
|
}
|
2021-02-09 15:44:56 +01:00
|
|
|
|
|
|
|
export interface CancelScheduleResponse {
|
|
|
|
canceled_at: Date
|
|
|
|
}
|