import { IParticipantAsProject, IParticipantAsSeller, IAction as IBaseAction, IAttributes as IBaseAttributes } from '../../action'; import { IAttributes as IReturnOrderActionAttributes } from '../../action/transfer/return/order'; import { ActionType } from '../../actionType'; import { AssetTransactionType } from '../../assetTransactionType'; import { CreativeWorkType } from '../../creativeWorkType'; import { IPaymentServiceOutput } from '../../invoice'; import { OfferType } from '../../offerType'; import { IOrder, ITotalPaymentDue, OrderType } from '../../order'; import { IMovieTicketPaymentCard } from '../../paymentMethod/paymentCard/movieTicket'; import { IPropertyValue } from '../../propertyValue'; import { IAlterTranResult, IRecipe as IPayCreditCardRecipe } from '../../recipe/payCreditCard'; import { IRecipe as IPayMovieTicketRecipe, ISeatInfoSyncIn, ISeatInfoSyncResult } from '../../recipe/payMovieTicket'; import { PaymentServiceType } from '../../service/paymentService'; import { IAction as IAuthorizePaymentAction } from '../authorize/paymentMethod/any'; import { IPayTransactionAsPurpose, IRefundTransactionAsPurpose } from '../interact/inform'; import { IAction as IRefundAction } from './refund'; export { IAlterTranResult, ISeatInfoSyncIn, ISeatInfoSyncResult, IPayCreditCardRecipe, IPayMovieTicketRecipe }; export type IAgent = IParticipantAsProject; export type IRecipient = IParticipantAsSeller; export interface IOrderAsPayPurpose { typeOf: OrderType.Order; confirmationNumber: string; /** * required(2025-02-14~) */ orderNumber?: string; } export interface IPurposeAsAssetTransaction { typeOf: AssetTransactionType.Pay | AssetTransactionType.Refund; id?: string; transactionNumber?: string; } export type IPurposeAsReturnAction = Pick; export type IPurpose = IOrderAsPayPurpose | IPurposeAsReturnAction; export type AvailablePaymentMethodType = string; /** * 決済方法インターフェース */ export interface IPaymentMethod { /** * The identifier for the account the payment will be applied to. */ accountId?: string; /** * 決済方法区分 */ typeOf: AvailablePaymentMethodType; /** * 決済方法名称 */ name: string; /** * An identifier for the method of payment used (e.g.the last 4 digits of the credit card). */ paymentMethodId: string; /** * The total amount due. */ totalPaymentDue?: ITotalPaymentDue; /** * 追加特性 */ additionalProperty: IPropertyValue[]; } export type IMovieTicket = Pick; export interface IPaymentService { typeOf: PaymentServiceType; /** * 発行決済サービスID */ id: string; /** * 決済方法 */ paymentMethod: IPaymentMethod; pendingTransaction?: never; /** * 決済カードリスト */ movieTickets?: IMovieTicket[]; /** * 決済サービスによって発行された決済カード */ serviceOutput?: IPaymentServiceOutput; } export type IObject = [IPaymentService]; export interface IInformPayment { purpose: IPayTransactionAsPurpose | IRefundTransactionAsPurpose; recipient?: never; /** * potentialAction id */ id: string; } export interface IPotentialActions { add2report: boolean; informPayment?: IInformPayment[]; } export type IOrderAsInstrument = Pick; export type IAuthorizeActionAsInstrument = Pick; export interface IPayTransactionAsInstrument { id: string; transactionNumber: string; typeOf: AssetTransactionType.Pay; } export type IRefundActionAsInstrument = Pick; /** * ツールとしての決済方法チケット */ export interface IPaymentMethodTicketAsInstrument { ticketToken: string; typeOf: 'Ticket'; } /** * ツールとしての対応決済方法オファー */ export interface IAcceptedPaymentMethodOfferAsInstrument { /** * 対応決済方法オファーID */ id: string; typeOf: OfferType.Offer; } /** * 注文時の決済アクションツール */ export type IPlaceOrderRelatedInstrument = IPayTransactionAsInstrument | IOrderAsInstrument | IAuthorizeActionAsInstrument | IPaymentMethodTicketAsInstrument | IAcceptedPaymentMethodOfferAsInstrument; /** * 注文返品時の決済アクションツール */ export type IReturnOrderRelatedInstrument = IRefundActionAsInstrument; export type IInstrument = IPlaceOrderRelatedInstrument | IReturnOrderRelatedInstrument; export interface IResult { } export interface ILocation { typeOf: CreativeWorkType.WebApplication; /** * アプリケーションID */ id: string; } export interface IAttributes extends Pick, 'agent' | 'error' | 'instrument' | 'location' | 'object' | 'potentialActions' | 'purpose' | 'recipient' | 'result' | 'project' | 'sameAs' | 'typeOf'> { agent: IAgent; /** * 注文決済の場合、決済取引として存在(2024-06-15~) * 返品手数料決済の場合、存在しない */ instrument?: IPayTransactionAsInstrument | IInstrument[]; potentialActions?: IPotentialActions; purpose: IPurpose; recipient: IRecipient; location?: ILocation; } /** * 決済アクション */ export type IAction = IBaseAction;