import { factory } from '../../../factory'; import type { IntegrationSettingRepo as Settings } from '../../../repo/setting/integration'; import type { AccountingReportRepo } from '../../../repo/accountingReport'; import type { PayActionRepo } from '../../../repo/action/pay'; import type { RefundActionRepo } from '../../../repo/action/refund'; import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket'; import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay'; import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice'; import type { AuthorizePaymentMethodActionRepo } from '../../../repo/action/authorizePaymentMethod'; import type { AssetTransactionRepo } from '../../../repo/assetTransaction'; import type { AuthorizationRepo } from '../../../repo/authorization'; import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber'; import type { CredentialsRepo } from '../../../repo/credentials'; import type { EventRepo } from '../../../repo/event'; import type { EventSeriesRepo } from '../../../repo/eventSeries'; import type { IssuerRepo } from '../../../repo/issuer'; import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction'; import type { OrderNumberRepo } from '../../../repo/orderNumber'; import type { PaymentServiceRepo } from '../../../repo/paymentService'; import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider'; import type { PotentialActionRepo } from '../../../repo/potentialAction'; import type { ProductRepo } from '../../../repo/product'; import type { ProjectRepo } from '../../../repo/project'; import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted'; import type { TaskRepo } from '../../../repo/task'; import type { TicketRepo } from '../../../repo/ticket'; import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder'; import type { TransactionNumberRepo } from '../../../repo/transactionNumber'; interface IAuthorizeRepos { accountingReport: AccountingReportRepo; actions: { pay: PayActionRepo; refund: RefundActionRepo; checkMovieTicket: CheckMovieTicketActionRepo; }; acceptPayAction: AcceptPayActionRepo; authorizeInvoiceAction: AuthorizeInvoiceActionRepo; authorizePaymentMethodAction: AuthorizePaymentMethodActionRepo; assetTransaction: AssetTransactionRepo; authorization: AuthorizationRepo; confirmationNumber: ConfirmationNumberRepo; credentials: CredentialsRepo; event: EventRepo; eventSeries: EventSeriesRepo; issuer: IssuerRepo; orderInTransaction: OrderInTransactionRepo; orderNumber: OrderNumberRepo; paymentAccepted: SellerPaymentAcceptedRepo; paymentService: PaymentServiceRepo; paymentServiceProvider: PaymentServiceProviderRepo; potentialAction: PotentialActionRepo; product: ProductRepo; project: ProjectRepo; task: TaskRepo; ticket: TicketRepo; placeOrder: PlaceOrderRepo; transactionNumber: TransactionNumberRepo; } type IAuthorizeOperation = (repos: IAuthorizeRepos, settings: Settings) => Promise; type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & { ticketToken?: string; }; /** * 決済承認 * CreditCard,MovieTicket -> 決済承認タスクから呼ばれる * FaceToFace,PaymentCard -> apiから呼ばれる */ declare function authorize(params: { project: { id: string; }; agent: { id: string; }; object: IObjectWithoutDetail; purpose: factory.action.authorize.paymentMethod.any.IPurpose; paymentServiceType: factory.service.paymentService.PaymentServiceType; location?: factory.action.trade.pay.ILocation; options: { /** * アクション失敗時に即時に決済取引を中止するかどうか */ useCancelPayTransactionOnFailed: boolean; checkedAction: { id: string; }; }; sameAs?: { /** * 実行元タスクID */ id: string; }; /** * ツールとしての対応決済方法オファー */ instrument: factory.action.trade.pay.IAcceptedPaymentMethodOfferAsInstrument[]; }): IAuthorizeOperation<{ /** * 承認アクションID */ id: string; }>; export { authorize, IAuthorizeRepos };