-
Notifications
You must be signed in to change notification settings - Fork 0
/
pay.ts
213 lines (211 loc) · 6.76 KB
/
pay.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import type { factory as GMOFactory } from '@motionpicture/gmo-service';
import {
IAction as IPayAction,
IAttributes as IPayActionAttributes,
ILocation,
IMovieTicket,
IOrderAsPayPurpose,
IPendingTransaction,
IPurpose as IPayPurpose,
IRecipient as IPayRecipient
} from '../action/trade/pay';
import * as AssetTransactionFactory from '../assetTransaction';
import { AssetTransactionType } from '../assetTransactionType';
import { IExtendId } from '../autoGenerated';
import { IMonetaryAmount } from '../monetaryAmount';
import { ITotalPaymentDue } from '../order';
import { ICreditCard3DS, IUnauthorizedCardOfMember, IUncheckedCardRaw, IUncheckedCardTokenized } from '../paymentMethod/paymentCard/creditCard';
import { IOnPaymentStatusChanged } from '../project';
import { IPropertyValue } from '../propertyValue';
import { PaymentServiceType } from '../service/paymentService';
export import IAgent = AssetTransactionFactory.IAgent;
export type IRecipient = IPayRecipient;
/**
* ペイメントカードトークン
*/
export type ITokenizedPaymentCard = string;
export type IFromLocation = ITokenizedPaymentCard;
/**
* クレジットカード決済承認に必要なクレジットカードインターフェース
*/
type ICreditCard = (IUncheckedCardRaw | IUncheckedCardTokenized | IUnauthorizedCardOfMember) & ICreditCard3DS;
export {
ICreditCard,
ICreditCard3DS,
IUnauthorizedCardOfMember,
IUncheckedCardRaw,
IUncheckedCardTokenized
};
export type IEntryTranArgs = GMOFactory.credit.IEntryTranArgs;
export type IEntryTranResult = GMOFactory.credit.IEntryTranResult;
export type IExecTranArgs = GMOFactory.credit.IExecTranArgs;
export type IExecTranResult = GMOFactory.credit.IExecTranResult;
export type IExecTran3dsArgs = GMOFactory.credit.IExecTran3dsArgs;
export type IExecTran3dsResult = GMOFactory.credit.IExecTran3dsResult;
export type ISecureTran2Result = GMOFactory.credit.ISecureTran2Result;
export interface IPaymentMethodAmount extends Pick<IMonetaryAmount, 'currency' | 'typeOf' | 'value'> {
value: number;
}
export interface IPaymentMethod {
/**
* The identifier for the account the payment will be applied to.
*/
accountId?: string;
/**
* 追加特性
*/
additionalProperty?: IPropertyValue<string>[];
/**
* The amount of money.
* MonetaryAmount対応(2023-08-12~)
*/
amount: number | IPaymentMethodAmount;
/**
* 説明
*/
description?: string;
/**
* 決済方法名称
* 未指定であればデフォルト値が使用されます
*/
name?: string;
// object.paymentMethodIdと重複していることを確認済(12months)
// object.paymentMethodIdへ完全移行(2023-08-30~)
// paymentMethodId?: string;
/**
* The total amount due.
*/
totalPaymentDue?: ITotalPaymentDue;
// データの互換性維持対応は済(2023-08-29)
// identifierへ完全移行(2023-08-30~)
// typeOf: string;
/**
* 決済方法区分
*/
identifier: string;
/**
* 出金元ペイメントカード
*/
fromLocation?: IFromLocation;
/**
* 決済カードリスト
*/
movieTickets?: IMovieTicket[];
/**
* 支払い方法
*/
method?: string;
/**
* クレジットカード情報
*/
creditCard?: ICreditCard;
}
export interface IAccountsReceivableByServiceType {
serviceType: string;
accountsReceivable?: number;
}
export type IPayActionInObject = Pick<IPayAction, 'actionStatus' | 'id' | 'typeOf'>;
/**
* 取引対象物
*/
export interface IObject {
// object: Invoice化に向けて追加(2022-05-31~)
accountId: string;
// object: Invoice化に向けて追加(2022-05-31~)
paymentMethodId: string;
typeOf: PaymentServiceType;
/**
* 発行決済サービスID
*/
id: string;
// CreditCardIFのカード通貨区分を追加(2023-08-07~)
// serviceOutput?: IOrderPaymentMethodIssuedThroughServiceOutput;
paymentMethod: IPaymentMethod;
onPaymentStatusChanged?: IOnPaymentStatusChanged;
pendingTransaction?: IPendingTransaction;
entryTranArgs?: IEntryTranArgs;
entryTranResult?: IEntryTranResult;
execTranArgs?: IExecTranArgs | IExecTran3dsArgs; // 3DS拡張(2024-01-02~)
execTranResult?: IExecTranResult | IExecTran3dsResult; // 3DS拡張(2024-01-02~)
secureTran2Result?: ISecureTran2Result; // 3DS拡張(2024-01-02~)
/**
* PaymentServiceType.MovieTicketの場合、着券アクション
*/
payAction?: IPayActionInObject; // 最適化(2024-04-09~)
accountsReceivablesByServiceType?: IAccountsReceivableByServiceType[];
}
export interface IPaymentMethodWithoutDetail extends IPaymentMethod {
/**
* 取引開始前の指定ではnumberに限定
*/
amount: number;
}
export interface IObjectWithoutDetail extends Pick<IObject, 'typeOf' | 'id' | 'paymentMethod'> {
paymentMethod: IPaymentMethodWithoutDetail;
}
export type IStartParamsWithoutDetail =
AssetTransactionFactory.IStartParams<AssetTransactionType.Pay, IAgent, IRecipient, IObjectWithoutDetail> & {
// add location(2022-11-11~)
location?: ILocation;
recipient: IRecipient;
purpose?: IPayPurpose;
};
export interface IStartParams extends AssetTransactionFactory.IStartParams<AssetTransactionType.Pay, IAgent, IRecipient, IObject> {
// add location(2022-11-11~)
location?: ILocation;
recipient: IRecipient;
}
export interface IOptimizedPayAction4order {
object: {
paymentMethod: {
/**
* 決済取引番号
*/
paymentMethodId: string;
};
};
/**
* 決済元の注文
*/
purpose: Pick<IOrderAsPayPurpose, 'typeOf'> & {
confirmationNumber: string;
orderNumber: string;
};
typeOf?: never;
}
export interface IPotentialActions {
/**
* 決済アクション
*/
pay: IPayActionAttributes[] | IOptimizedPayAction4order[];
}
export interface IPotentialActionsParams {
pay: {
purpose: IOrderAsPayPurpose;
};
}
/**
* 確定パラメータ
*/
export interface IConfirmParams {
id?: string;
// 確定時の決済方法区分指定(2023-08-29~)
object?: {
paymentMethod?: { identifier?: string };
};
transactionNumber?: string;
endDate?: Date;
potentialActions: IPotentialActionsParams;
}
export type IResult = any;
export type IError = any;
export interface IAttributes extends AssetTransactionFactory.IAttributes<IStartParams, IResult, IError, IPotentialActions> {
}
export type ITransaction = IExtendId<IAttributes>;
export interface ISearchConditions extends AssetTransactionFactory.ISearchConditions<AssetTransactionType.Pay> {
object?: {
accountId?: {
$eq?: string;
};
};
}