@chevre/factory 5.3.0-alpha.2 → 5.3.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,10 +7,16 @@ import { TransactionType } from '../../transactionType';
7
7
  import * as AcceptActionFactory from '../accept';
8
8
  export { IExecTran3dsArgs, IExecTran3dsResult, IAgent, IRecipe };
9
9
  export type IPaymentMethod = Pick<IPaymentMethodWithoutDetail, 'amount' | 'creditCard' | 'identifier' | 'method'>;
10
- export type IPayObject = Pick<IObjectWithoutDetail, 'id' | 'typeOf'> & {
10
+ /**
11
+ * 採用する決済方法
12
+ */
13
+ export type IPayObject = Pick<IObjectWithoutDetail, 'id' | 'typeOf' | 'serviceOutput'> & {
11
14
  paymentMethod: IPaymentMethod;
12
15
  };
13
16
  export interface IObject {
17
+ /**
18
+ * 決済方法(決済サービス)
19
+ */
14
20
  object: IPayObject;
15
21
  transactionNumber: string;
16
22
  typeOf: AssetTransactionType.Pay;
@@ -2,9 +2,9 @@ import * as ActionFactory from '../../../action';
2
2
  import * as CheckMovieTicketActionFactory from '../../../action/check/paymentMethod/movieTicket';
3
3
  import { AvailablePaymentMethodType, IMovieTicket } from '../../../action/trade/pay';
4
4
  import { ActionType } from '../../../actionType';
5
- import { ICreditCard, IFromLocation, ITokenizedPaymentCard } from '../../../assetTransaction/pay';
5
+ import { ICreditCard, IFromLocation, IInvoiceReferenceOrder, ITokenizedPaymentCard } from '../../../assetTransaction/pay';
6
6
  import { AssetTransactionType } from '../../../assetTransactionType';
7
- import { IEventServiceAsOrderedItem, IOrder, IOrderPaymentMethodIssuedThrough, IReservationFor4EventServiceOrderedItem, ITotalPaymentDue } from '../../../order';
7
+ import { IOrderPaymentMethodIssuedThrough, ITotalPaymentDue } from '../../../order';
8
8
  import { PaymentStatusType } from '../../../paymentStatusType';
9
9
  import { IPropertyValue } from '../../../propertyValue';
10
10
  import { IPermitAsServiceOutput } from '../../../service/paymentService';
@@ -82,6 +82,7 @@ export interface IObjectIncludingPaymentMethodDetails {
82
82
  * メンバーシップチケットに限らず、承認前に発行された決済方法チケットを指定すると、paymentMethodIdはチケットに依存する
83
83
  */
84
84
  ticketToken?: string;
85
+ referencesOrder: IInvoiceReferenceOrder;
85
86
  }
86
87
  export type IAuthorizeAnyPaymentObject = Pick<IObjectIncludingPaymentMethodDetails, 'amount' | 'issuedThrough' | 'paymentMethod' | 'name' | 'additionalProperty' | 'ticketToken'> & {
87
88
  creditCard?: never;
@@ -89,16 +90,22 @@ export type IAuthorizeAnyPaymentObject = Pick<IObjectIncludingPaymentMethodDetai
89
90
  movieTickets?: never;
90
91
  paymentMethodId?: never;
91
92
  fromLocation?: never;
92
- description?: string;
93
+ description?: never;
94
+ referencesOrder?: never;
93
95
  };
94
96
  export type IAuthorizeCreditCardObject = Pick<IObjectIncludingPaymentMethodDetails, 'amount' | 'issuedThrough' | 'paymentMethod' | 'creditCard' | 'method' | 'name' | 'additionalProperty' | 'ticketToken'> & {
95
97
  /**
96
98
  * 決済URL発行の場合、発行済のpaymentMethodIdを指定
97
99
  */
98
100
  paymentMethodId?: string;
101
+ /**
102
+ * 関連注文
103
+ * 指定すると、注文取引確定時にアイテムの整合性が検証される
104
+ */
105
+ referencesOrder?: IInvoiceReferenceOrder;
99
106
  movieTickets?: never;
100
107
  fromLocation?: never;
101
- description?: string;
108
+ description?: never;
102
109
  };
103
110
  export type IAuthorizeMovieTicketObject = Pick<IObjectIncludingPaymentMethodDetails, 'issuedThrough' | 'paymentMethod' | 'movieTickets' | 'name' | 'additionalProperty' | 'ticketToken'> & {
104
111
  /**
@@ -109,7 +116,8 @@ export type IAuthorizeMovieTicketObject = Pick<IObjectIncludingPaymentMethodDeta
109
116
  method?: never;
110
117
  paymentMethodId?: never;
111
118
  fromLocation?: never;
112
- description?: string;
119
+ description?: never;
120
+ referencesOrder?: never;
113
121
  };
114
122
  export type IAuthorizePaymentCardObject = Pick<IObjectIncludingPaymentMethodDetails, 'amount' | 'issuedThrough' | 'paymentMethod' | 'fromLocation' | 'name' | 'additionalProperty'> & {
115
123
  description?: string;
@@ -118,7 +126,11 @@ export type IAuthorizePaymentCardObject = Pick<IObjectIncludingPaymentMethodDeta
118
126
  movieTickets?: never;
119
127
  ticketToken?: never;
120
128
  paymentMethodId?: never;
129
+ referencesOrder?: never;
121
130
  };
131
+ /**
132
+ * 決済承認リクエストの承認対象オブジェクト
133
+ */
122
134
  export type IObjectWithoutDetail = IAuthorizeAnyPaymentObject | IAuthorizeCreditCardObject | IAuthorizeMovieTicketObject | IAuthorizePaymentCardObject;
123
135
  export type IObject = Pick<IObjectIncludingPaymentMethodDetails, 'typeOf' | 'paymentMethodId' | 'accountId'>;
124
136
  export interface IResultPaymentMethod {
@@ -133,34 +145,6 @@ export interface IResultPaymentMethod {
133
145
  currency?: string;
134
146
  };
135
147
  }
136
- /**
137
- * 決済承認結果としての請求書に関連する注文アイテムとしての興行
138
- */
139
- export type IEventServiceAsInvoiceOrderedItem = Pick<IEventServiceAsOrderedItem, 'typeOf'> & {
140
- serviceOutput: {
141
- /**
142
- * 請求書に関連するイベント
143
- * 興行オファー承認のイベントリストと完全に一致する必要がある
144
- */
145
- reservationFor: Pick<IReservationFor4EventServiceOrderedItem, 'id' | 'typeOf'>;
146
- };
147
- };
148
- /**
149
- * 決済承認結果としての請求書に関連する注文アイテム
150
- */
151
- export interface IInvoiceOrderedItem {
152
- typeOf: 'OrderItem';
153
- orderedItem: IEventServiceAsInvoiceOrderedItem;
154
- }
155
- /**
156
- * 決済承認結果としての請求書に関連する注文
157
- */
158
- export interface IInvoiceReferenceOrder extends Pick<IOrder, 'typeOf'> {
159
- /**
160
- * 決済承認プロセスにおいて注文アイテムを指定された場合のみ定義される
161
- */
162
- orderedItem?: IInvoiceOrderedItem[];
163
- }
164
148
  export interface IResultAsInvoice {
165
149
  /**
166
150
  * The identifier for the account the payment will be applied to.
@@ -2,8 +2,9 @@ import { IAction as IPayAction, IInstrument, ILocation, IMovieTicket, IOrderAsPa
2
2
  import * as AssetTransactionFactory from '../assetTransaction';
3
3
  import { AssetTransactionType } from '../assetTransactionType';
4
4
  import { IExtendId } from '../autoGenerated';
5
+ import { IInvoice } from '../invoice';
5
6
  import { IMonetaryAmount } from '../monetaryAmount';
6
- import { ITotalPaymentDue } from '../order';
7
+ import { IEventServiceAsOrderedItem, IOrder, IReservationFor4EventServiceOrderedItem, ITotalPaymentDue } from '../order';
7
8
  import { ICreditCard3DS, IUnauthorizedCardOfMember, IUncheckedCardRaw, IUncheckedCardTokenized } from '../paymentMethod/paymentCard/creditCard';
8
9
  import { IPropertyValue } from '../propertyValue';
9
10
  import { IPotentialAction as IPotentialInformAction, PaymentServiceType } from '../service/paymentService';
@@ -75,10 +76,44 @@ export interface IAccountsReceivableByServiceType {
75
76
  accountsReceivable?: number;
76
77
  }
77
78
  export type IPayActionInObject = Pick<IPayAction, 'actionStatus' | 'id' | 'typeOf'>;
79
+ /**
80
+ * 決済承認結果としての請求書に関連する注文アイテムとしての興行
81
+ */
82
+ export type IEventServiceAsInvoiceOrderedItem = Pick<IEventServiceAsOrderedItem, 'typeOf'> & {
83
+ serviceOutput: {
84
+ /**
85
+ * 請求書に関連するイベント
86
+ * 興行オファー承認のイベントリストと完全に一致する必要がある
87
+ */
88
+ reservationFor: Pick<IReservationFor4EventServiceOrderedItem, 'id' | 'typeOf'>;
89
+ };
90
+ };
91
+ /**
92
+ * 決済承認結果としての請求書に関連する注文アイテム
93
+ */
94
+ export interface IInvoiceOrderedItem {
95
+ typeOf: 'OrderItem';
96
+ orderedItem: IEventServiceAsInvoiceOrderedItem;
97
+ }
98
+ /**
99
+ * 決済承認結果としての請求書に関連する注文
100
+ */
101
+ export interface IInvoiceReferenceOrder extends Pick<IOrder, 'typeOf'> {
102
+ /**
103
+ * 決済承認プロセスにおいて注文アイテムを指定された場合のみ定義される
104
+ */
105
+ orderedItem?: IInvoiceOrderedItem[];
106
+ }
107
+ /**
108
+ * 関連注文情報を含む請求情報
109
+ */
110
+ export type IInvoiceAsPaymentServiceOutput = Pick<IInvoice, 'typeOf'> & {
111
+ referencesOrder: IInvoiceReferenceOrder;
112
+ };
78
113
  /**
79
114
  * 取引対象物
80
115
  */
81
- export interface IObject {
116
+ export interface IPaymentServiceAsObject {
82
117
  accountId: string;
83
118
  paymentMethodId: string;
84
119
  typeOf: PaymentServiceType;
@@ -96,14 +131,16 @@ export interface IObject {
96
131
  checkedAction?: {
97
132
  id: string;
98
133
  };
134
+ serviceOutput?: IInvoiceAsPaymentServiceOutput;
99
135
  }
136
+ export type IObject = IPaymentServiceAsObject;
100
137
  export interface IPaymentMethodWithoutDetail extends IPaymentMethod {
101
138
  /**
102
139
  * 取引開始前の指定ではnumberに限定
103
140
  */
104
141
  amount: number;
105
142
  }
106
- export interface IObjectWithoutDetail extends Pick<IObject, 'typeOf' | 'id' | 'paymentMethod'> {
143
+ export interface IObjectWithoutDetail extends Pick<IObject, 'serviceOutput' | 'typeOf' | 'id' | 'paymentMethod'> {
107
144
  paymentMethod: IPaymentMethodWithoutDetail;
108
145
  }
109
146
  export type IPotentialAction = IPotentialInformAction;
@@ -24,7 +24,7 @@ export type IPermitAsTypeOfGood = Pick<IPermitAsGood, 'identifier' | 'typeOf'> &
24
24
  /**
25
25
  * 決済方法チケットの請求情報
26
26
  */
27
- export interface IInvoiceAsPaymentMethodServiceOutput extends Pick<IResultAsInvoice, 'paymentMethodId' | 'referencesOrder'> {
27
+ export interface IInvoiceAsPaymentMethodServiceOutput extends Pick<IResultAsInvoice, 'paymentMethodId'> {
28
28
  typeOf: IInvoice['typeOf'];
29
29
  }
30
30
  /**
@@ -11,7 +11,7 @@ export interface IData {
11
11
  agent: {
12
12
  id: string;
13
13
  };
14
- object: Pick<IAuthorizeCreditCardObject, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
14
+ object: Pick<IAuthorizeCreditCardObject, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'referencesOrder'>;
15
15
  purpose: IPurpose;
16
16
  paymentServiceType: PaymentServiceType;
17
17
  location: ILocation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chevre/factory",
3
- "version": "5.3.0-alpha.2",
3
+ "version": "5.3.0-alpha.4",
4
4
  "description": "Chevre Factory Library for Javascript",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",