import { AptlyAddress } from './address.js'; import { AptlyAllowanceChargeSchema, AptlyLegalMonetaryTotal } from './algorithm.js'; import { AptlyAppSchema } from './app.js'; import { AptlyCustomerData, AptlyCustomerDataSchema } from './customer.js'; import { AptlyDocumentSchema } from './document.js'; import { AptlyBaseSchema } from './extends.js'; import { AptlyOrder, AptlyOrderPaymentStatus, AptlyOrderSchema } from './order.js'; import { AptlyOrganizationContent, AptlyOrganizationSchema } from './organization.js'; import { AptlyPickConfirmedSchema } from './pick.js'; import { AptlyProjectContent, AptlyProjectSchema } from './project.js'; import { AptlyUnitContent, AptlyUnitSchema } from './unit.js'; import { AptlyUserSchema } from './user.js'; import { AptlyOfferSchema } from './offer'; import { Populated } from '../core'; export type AptlyPayment = AptlyPaymentSchema; export interface AptlyPaymentSchema extends Omit, 'name' | 'archived'> { organization: ID | AptlyOrganizationSchema; project: ID | AptlyProjectSchema | null; unit: ID | AptlyUnitSchema | null; order: ID | AptlyOrderSchema; offer: ID | AptlyOfferSchema | null; app: ID | AptlyAppSchema; document?: ID | AptlyDocumentSchema; reportDocument?: ID | AptlyDocumentSchema; status: AptlyPaymentStatus; number: number; amount: number; vatAmount: number; totalCost: number; totalVat: number; total?: AptlyLegalMonetaryTotal | null; allowanceCharges?: AptlyAllowanceChargeSchema[]; items: AptlyPaymentItemSchema[]; picks: (ID | AptlyPickConfirmedSchema)[]; transaction: { ref: string; at: DATE; }; company: AptlyPaymentCompany; customer: AptlyCustomerDataSchema; shipping: AptlyAddress; shippingDate?: DATE; shippingDescription?: string; billing?: AptlyAddress; card?: { brand: string; last4: string; }; splits: AptlyPaymentSplitSchema[]; captures: AptlyPaymentCaptureSchema[]; captured: { amount: number; at: DATE; }; createdBy: Populated> | null; } export declare enum AptlyPaymentStatus { Authorized = "AUTHORIZED", PendingDelivery = "PENDING_DELIVERY", PendingCapture = "PENDING_CAPTURE", Captured = "CAPTURED", Annulled = "ANNULLED" } export type AptlyPaymentSplit = AptlyPaymentSplitSchema; export interface AptlyPaymentSplitSchema { _id: ID; destination: 'platform' | string; amount: number; } export type AptlyPaymentCapture = AptlyPaymentCaptureSchema; export interface AptlyPaymentCaptureSchema { _id: ID; amount: number; description: string; ref: string; user?: ID | AptlyUserSchema; at: DATE; } export interface AptlyPaymentCompany { vat: string; name: string; email: string; address: AptlyAddress; phone?: string; } export interface AptlyPaymentItemSchema { _id: ID; name: string; sku: string; quantity: number; vat: number; baseCost: number; unitCost: number; unitVat: number; totalCost: number; totalVat: number; } export interface AptlyPaymentInitPaymentBody { organization: AptlyOrganizationContent; project?: AptlyProjectContent; unit?: AptlyUnitContent; order: AptlyOrder; customer: AptlyCustomerData; shipping: AptlyAddress; billing: AptlyAddress; redirectUri: string; } export interface AptlyPaymentTransactionBody { app: string; id: string; at: string; customer: AptlyCustomerData; card: AptlyPayment['card']; shipping: AptlyAddress; billing?: AptlyAddress; splits: Omit[]; } export interface AptlyPaymentCaptureBody { terms: boolean; description?: string; } export interface AptlyPaymentCaptureResponse { id: string; capturedAmount: number; status: AptlyOrderPaymentStatus; totalCost: number; at: string; }