import { DeepPartial, EntityManager } from "typeorm"; import { FindConfig } from "../types/common"; import { PaymentCollectionRepository } from "../repositories/payment-collection"; import { Payment, PaymentCollection, PaymentSession, Refund } from "../models"; import { TransactionBaseService } from "../interfaces"; import { CustomerService, EventBusService, PaymentProviderService } from "./index"; import { CreatePaymentCollectionInput, PaymentCollectionSessionInput } from "../types/payment-collection"; declare type InjectedDependencies = { manager: EntityManager; paymentCollectionRepository: typeof PaymentCollectionRepository; paymentProviderService: PaymentProviderService; eventBusService: EventBusService; customerService: CustomerService; }; export default class PaymentCollectionService extends TransactionBaseService { static readonly Events: { CREATED: string; UPDATED: string; DELETED: string; PAYMENT_AUTHORIZED: string; PAYMENT_CAPTURED: string; PAYMENT_CAPTURE_FAILED: string; REFUND_CREATED: string; REFUND_FAILED: string; }; protected readonly manager_: EntityManager; protected transactionManager_: EntityManager | undefined; protected readonly eventBusService_: EventBusService; protected readonly paymentProviderService_: PaymentProviderService; protected readonly customerService_: CustomerService; protected readonly paymentCollectionRepository_: typeof PaymentCollectionRepository; constructor({ manager, paymentCollectionRepository, paymentProviderService, customerService, eventBusService, }: InjectedDependencies); retrieve(paymentCollectionId: string, config?: FindConfig): Promise; create(data: CreatePaymentCollectionInput): Promise; update(paymentCollectionId: string, data: DeepPartial): Promise; delete(paymentCollectionId: string): Promise; private isValidTotalAmount; setPaymentSessions(paymentCollectionId: string, sessions: PaymentCollectionSessionInput[] | PaymentCollectionSessionInput): Promise; refreshPaymentSession(paymentCollectionId: string, sessionId: string, sessionInput: PaymentCollectionSessionInput): Promise; authorize(paymentCollectionId: string, context?: Record): Promise; private capturePayment; capture(paymentId: string): Promise; captureAll(paymentCollectionId: string): Promise; private refundPayment; refund(paymentId: string, amount: number, reason: string, note?: string): Promise; refundAll(paymentCollectionId: string, reason: string, note?: string): Promise; } export {};