66 lines
1.5 KiB
TypeScript

/**
* Payments Domain - Contract
*
* Defines the normalized payment types used throughout the application.
*/
// Payment Method Type
export const PAYMENT_METHOD_TYPE = {
CREDIT_CARD: "CreditCard",
BANK_ACCOUNT: "BankAccount",
REMOTE_CREDIT_CARD: "RemoteCreditCard",
REMOTE_BANK_ACCOUNT: "RemoteBankAccount",
MANUAL: "Manual",
} as const;
export type PaymentMethodType = (typeof PAYMENT_METHOD_TYPE)[keyof typeof PAYMENT_METHOD_TYPE];
// Payment Method
export interface PaymentMethod {
id: number;
type: PaymentMethodType;
description: string;
gatewayName?: string;
contactType?: string;
contactId?: number;
cardLastFour?: string;
expiryDate?: string;
startDate?: string;
issueNumber?: string;
cardType?: string;
remoteToken?: string;
lastUpdated?: string;
bankName?: string;
isDefault?: boolean;
}
export interface PaymentMethodList {
paymentMethods: PaymentMethod[];
totalCount: number;
}
// Payment Gateway Type
export const PAYMENT_GATEWAY_TYPE = {
MERCHANT: "merchant",
THIRDPARTY: "thirdparty",
TOKENIZATION: "tokenization",
MANUAL: "manual",
} as const;
export type PaymentGatewayType = (typeof PAYMENT_GATEWAY_TYPE)[keyof typeof PAYMENT_GATEWAY_TYPE];
// Payment Gateway
export interface PaymentGateway {
name: string;
displayName: string;
type: PaymentGatewayType;
isActive: boolean;
configuration?: Record<string, unknown>;
}
export interface PaymentGatewayList {
gateways: PaymentGateway[];
totalCount: number;
}