@chevre/domain 22.9.0-alpha.17 → 22.9.0-alpha.19
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.
- package/lib/chevre/service/assetTransaction/pay.d.ts +3 -1
- package/lib/chevre/service/assetTransaction/pay.js +9 -19
- package/lib/chevre/service/payment/any/factory.d.ts +11 -1
- package/lib/chevre/service/payment/any/factory.js +39 -14
- package/lib/chevre/service/payment/any/fixConfirmationNumberAsNeeded.d.ts +3 -1
- package/lib/chevre/service/payment/any/fixConfirmationNumberAsNeeded.js +13 -11
- package/lib/chevre/service/payment/any.d.ts +1 -1
- package/lib/chevre/service/payment/any.js +4 -5
- package/lib/chevre/service/payment/movieTicket/authorize.js +14 -9
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.js +9 -13
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +3 -1
- package/lib/chevre/service/task/payment/payByTask.js +6 -1
- package/package.json +3 -3
|
@@ -81,7 +81,9 @@ export type IPublishPaymentUrlResult = CreditCardPayment.IPaymentAgencyTransacti
|
|
|
81
81
|
/**
|
|
82
82
|
* 決済ロケーション発行
|
|
83
83
|
*/
|
|
84
|
-
export declare function publishPaymentUrl(params: factory.assetTransaction.pay.IStartParamsWithoutDetail,
|
|
84
|
+
export declare function publishPaymentUrl(params: Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'agent' | 'location' | 'project' | 'recipient' | 'transactionNumber' | 'typeOf'> & {
|
|
85
|
+
object: factory.action.accept.pay.IPayObject;
|
|
86
|
+
}, options: {
|
|
85
87
|
purposeAsTransaction: {
|
|
86
88
|
id: string;
|
|
87
89
|
};
|
|
@@ -65,7 +65,7 @@ function publishPaymentUrlResult2recipe(params) {
|
|
|
65
65
|
function publishPaymentUrl(params, options) {
|
|
66
66
|
// tslint:disable-next-line:max-func-body-length
|
|
67
67
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
var _a, _b, _c, _d, _e;
|
|
68
|
+
var _a, _b, _c, _d, _e, _f;
|
|
69
69
|
const paymentServiceType = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf;
|
|
70
70
|
// 金額をfix
|
|
71
71
|
const amount = (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.amount;
|
|
@@ -81,12 +81,14 @@ function publishPaymentUrl(params, options) {
|
|
|
81
81
|
const paymentServiceId = getPaymentServiceId(params);
|
|
82
82
|
// 決済受入アクション生成(2024-03-28~)
|
|
83
83
|
const taskId = (_c = options === null || options === void 0 ? void 0 : options.executor) === null || _c === void 0 ? void 0 : _c.id;
|
|
84
|
-
const actionAttributes = Object.assign({ project: params.project, typeOf: factory.actionType.AcceptAction, agent: params.agent, object: {
|
|
84
|
+
const actionAttributes = Object.assign(Object.assign({ project: params.project, typeOf: factory.actionType.AcceptAction, agent: params.agent, object: {
|
|
85
85
|
object: params.object,
|
|
86
86
|
transactionNumber,
|
|
87
87
|
typeOf: params.typeOf
|
|
88
88
|
}, purpose: { typeOf: factory.transactionType.PlaceOrder, id: options.purposeAsTransaction.id } }, (typeof taskId === 'string')
|
|
89
89
|
? { sameAs: { id: taskId, typeOf: 'Task' } } // タスク関連付け(2024-05-22~)
|
|
90
|
+
: undefined), (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
91
|
+
? { location: params.location }
|
|
90
92
|
: undefined);
|
|
91
93
|
const action = yield repos.action.start(actionAttributes);
|
|
92
94
|
let result;
|
|
@@ -97,11 +99,11 @@ function publishPaymentUrl(params, options) {
|
|
|
97
99
|
const authorizeResult = yield CreditCardPayment.authorize(Object.assign(Object.assign({}, params), { id: '' // 決済URL発行プロセスにおいては決済取引IDは使用しないので空文字でok
|
|
98
100
|
}), paymentServiceId, {
|
|
99
101
|
processPublishPaymentUrl: true,
|
|
100
|
-
executor: (typeof ((
|
|
102
|
+
executor: (typeof ((_e = options.executor) === null || _e === void 0 ? void 0 : _e.id) === 'string') ? { id: options.executor.id } : {} // タスク関連付け(2024-05-22~)
|
|
101
103
|
})(repos, settings);
|
|
102
104
|
let paymentUrl;
|
|
103
105
|
// 3DS拡張(2024-01-02~)
|
|
104
|
-
const retUrl = (
|
|
106
|
+
const retUrl = (_f = params.object.paymentMethod.creditCard) === null || _f === void 0 ? void 0 : _f.retUrl;
|
|
105
107
|
if (typeof retUrl === 'string' && retUrl.length > 0) {
|
|
106
108
|
paymentUrl = authorizeResult.execTranResult.redirectUrl;
|
|
107
109
|
}
|
|
@@ -316,19 +318,6 @@ function validateSeller(params) {
|
|
|
316
318
|
if (typeof sellerId !== 'string') {
|
|
317
319
|
throw new factory.errors.ArgumentNull('recipient.id');
|
|
318
320
|
}
|
|
319
|
-
// const sellers = <Pick<factory.seller.ISeller, 'paymentAccepted'>[]>await repos.seller.search(
|
|
320
|
-
// {
|
|
321
|
-
// limit: 1,
|
|
322
|
-
// page: 1,
|
|
323
|
-
// id: { $eq: sellerId }
|
|
324
|
-
// },
|
|
325
|
-
// ['paymentAccepted'],
|
|
326
|
-
// []
|
|
327
|
-
// );
|
|
328
|
-
// const seller = sellers.shift();
|
|
329
|
-
// if (seller === undefined) {
|
|
330
|
-
// throw new factory.errors.NotFound(factory.organizationType.Corporation);
|
|
331
|
-
// }
|
|
332
321
|
const paymentMethodType = (_b = params.object.paymentMethod) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
333
322
|
if (typeof paymentMethodType !== 'string') {
|
|
334
323
|
throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
|
|
@@ -576,7 +565,8 @@ function exportTasksById(params) {
|
|
|
576
565
|
case factory.transactionStatusType.Confirmed:
|
|
577
566
|
const payActions = potentialActions === null || potentialActions === void 0 ? void 0 : potentialActions.pay;
|
|
578
567
|
if (Array.isArray(payActions) && payActions.length > 0) {
|
|
579
|
-
const payTasks = payActions.map((
|
|
568
|
+
const payTasks = payActions.map(({ object, purpose }) => {
|
|
569
|
+
const data = { object, purpose };
|
|
580
570
|
return {
|
|
581
571
|
project: transaction.project,
|
|
582
572
|
name: factory.taskName.Pay,
|
|
@@ -585,7 +575,7 @@ function exportTasksById(params) {
|
|
|
585
575
|
remainingNumberOfTries: 10,
|
|
586
576
|
numberOfTried: 0,
|
|
587
577
|
executionResults: [],
|
|
588
|
-
data
|
|
578
|
+
data
|
|
589
579
|
};
|
|
590
580
|
});
|
|
591
581
|
taskAttributes.push(...payTasks);
|
|
@@ -10,6 +10,16 @@ export interface IOnPaymentStatusChangedRefundAction {
|
|
|
10
10
|
object: factory.invoice.IInvoice[];
|
|
11
11
|
}
|
|
12
12
|
export type IOnPaymentStatusChangedParams = IOnPaymentStatusChangedPayAction | IOnPaymentStatusChangedRefundAction;
|
|
13
|
+
export declare function creatPublishPaymentUrlParams(params: {
|
|
14
|
+
accountId?: string;
|
|
15
|
+
object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
16
|
+
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
17
|
+
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller' | 'project'>;
|
|
18
|
+
transactionNumber: string;
|
|
19
|
+
location?: factory.action.trade.pay.ILocation;
|
|
20
|
+
}): Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'agent' | 'location' | 'project' | 'recipient' | 'transactionNumber' | 'typeOf'> & {
|
|
21
|
+
object: factory.action.accept.pay.IPayObject;
|
|
22
|
+
};
|
|
13
23
|
export declare function creatPayTransactionStartParams(params: {
|
|
14
24
|
accountId?: string;
|
|
15
25
|
object: factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails;
|
|
@@ -21,7 +31,7 @@ export declare function creatPayTransactionStartParams(params: {
|
|
|
21
31
|
/**
|
|
22
32
|
* 決済カード決済承認の場合、事前発行済の確認番号を決済取引へ連携
|
|
23
33
|
*/
|
|
24
|
-
confirmationNumber
|
|
34
|
+
confirmationNumber: string;
|
|
25
35
|
};
|
|
26
36
|
}): factory.assetTransaction.pay.IStartParamsWithoutDetail;
|
|
27
37
|
export declare function createMovieTicket(params: factory.action.trade.pay.IMovieTicket): factory.action.trade.pay.IMovieTicket;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.creatPublishPaymentUrlParams = creatPublishPaymentUrlParams;
|
|
3
4
|
exports.creatPayTransactionStartParams = creatPayTransactionStartParams;
|
|
4
5
|
exports.createMovieTicket = createMovieTicket;
|
|
5
6
|
exports.createAuthorizeResult = createAuthorizeResult;
|
|
@@ -7,6 +8,38 @@ exports.optimizeAction4inform = optimizeAction4inform;
|
|
|
7
8
|
const moment = require("moment");
|
|
8
9
|
const util = require("util");
|
|
9
10
|
const factory = require("../../../factory");
|
|
11
|
+
function creatPublishPaymentUrlParams(params) {
|
|
12
|
+
var _a, _b, _c, _d;
|
|
13
|
+
const issuedThroughId = (_a = params.object.issuedThrough) === null || _a === void 0 ? void 0 : _a.id;
|
|
14
|
+
// const accountId: string | undefined = (typeof params.accountId === 'string')
|
|
15
|
+
// ? params.accountId
|
|
16
|
+
// : (typeof params.object.accountId === 'string') ? params.object.accountId : undefined;
|
|
17
|
+
// const movieTickets: factory.action.trade.pay.IMovieTicket[] | undefined
|
|
18
|
+
// = (Array.isArray(params.object.movieTickets)) ? params.object.movieTickets.map(createMovieTicket) : undefined;
|
|
19
|
+
const paymentMethod = Object.assign(Object.assign({ identifier: params.object.paymentMethod, amount: params.object.amount }, (typeof params.object.method === 'string') ? { method: params.object.method } : undefined), (params.object.creditCard !== undefined) ? { creditCard: params.object.creditCard } : undefined
|
|
20
|
+
// ...(Array.isArray(movieTickets)) ? { movieTickets } : undefined
|
|
21
|
+
);
|
|
22
|
+
const object = {
|
|
23
|
+
typeOf: params.paymentServiceType,
|
|
24
|
+
id: issuedThroughId,
|
|
25
|
+
paymentMethod
|
|
26
|
+
};
|
|
27
|
+
return Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
|
|
28
|
+
typeOf: params.transaction.seller.typeOf,
|
|
29
|
+
id: params.transaction.seller.id,
|
|
30
|
+
name: (typeof params.transaction.seller.name === 'string')
|
|
31
|
+
? params.transaction.seller.name
|
|
32
|
+
: String((_b = params.transaction.seller.name) === null || _b === void 0 ? void 0 : _b.ja)
|
|
33
|
+
}, recipient: {
|
|
34
|
+
id: params.transaction.seller.id,
|
|
35
|
+
name: (typeof params.transaction.seller.name === 'string')
|
|
36
|
+
? params.transaction.seller.name
|
|
37
|
+
: String((_c = params.transaction.seller.name) === null || _c === void 0 ? void 0 : _c.ja),
|
|
38
|
+
typeOf: params.transaction.seller.typeOf
|
|
39
|
+
}, object }, (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
40
|
+
? { location: params.location }
|
|
41
|
+
: undefined);
|
|
42
|
+
}
|
|
10
43
|
function creatPayTransactionStartParams(params) {
|
|
11
44
|
var _a, _b, _c, _d;
|
|
12
45
|
let expires = moment(params.transaction.expires)
|
|
@@ -26,9 +59,8 @@ function creatPayTransactionStartParams(params) {
|
|
|
26
59
|
const accountId = (typeof params.accountId === 'string')
|
|
27
60
|
? params.accountId
|
|
28
61
|
: (typeof params.object.accountId === 'string') ? params.object.accountId : undefined;
|
|
29
|
-
// movieTickets最適化(2023-02-24~)
|
|
30
62
|
const movieTickets = (Array.isArray(params.object.movieTickets)) ? params.object.movieTickets.map(createMovieTicket) : undefined;
|
|
31
|
-
return Object.assign(
|
|
63
|
+
return Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
|
|
32
64
|
typeOf: params.transaction.seller.typeOf,
|
|
33
65
|
id: params.transaction.seller.id,
|
|
34
66
|
name: (typeof params.transaction.seller.name === 'string')
|
|
@@ -51,19 +83,12 @@ function creatPayTransactionStartParams(params) {
|
|
|
51
83
|
typeOf: params.transaction.seller.typeOf
|
|
52
84
|
}, object: {
|
|
53
85
|
typeOf: params.paymentServiceType,
|
|
54
|
-
// 決済サービスIDを連携(2022-04-12~)
|
|
55
86
|
id: issuedThroughId,
|
|
56
|
-
paymentMethod: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ identifier: params.object.paymentMethod,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
?
|
|
61
|
-
purpose: {
|
|
62
|
-
typeOf: factory.order.OrderType.Order,
|
|
63
|
-
confirmationNumber: confirmationNumber
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
: undefined), (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
87
|
+
paymentMethod: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ identifier: params.object.paymentMethod, amount: params.object.amount, additionalProperty: (Array.isArray(params.object.additionalProperty)) ? params.object.additionalProperty : [] }, (typeof params.object.method === 'string') ? { method: params.object.method } : undefined), (typeof params.object.name === 'string') ? { name: params.object.name } : undefined), (typeof accountId === 'string') ? { accountId } : undefined), (typeof params.object.description === 'string') ? { description: params.object.description } : undefined), (typeof params.object.fromLocation === 'string') ? { fromLocation: params.object.fromLocation } : undefined), (params.object.creditCard !== undefined) ? { creditCard: params.object.creditCard } : undefined), (Array.isArray(movieTickets)) ? { movieTickets } : undefined)
|
|
88
|
+
}, expires: expires, purpose: {
|
|
89
|
+
typeOf: factory.order.OrderType.Order,
|
|
90
|
+
confirmationNumber
|
|
91
|
+
} }, (typeof ((_d = params.location) === null || _d === void 0 ? void 0 : _d.typeOf) === 'string')
|
|
67
92
|
? { location: params.location }
|
|
68
93
|
: undefined);
|
|
69
94
|
}
|
|
@@ -7,5 +7,7 @@ declare function fixConfirmationNumberAsNeeded(params: {
|
|
|
7
7
|
}): (repos: {
|
|
8
8
|
transaction: TransactionRepo;
|
|
9
9
|
confirmationNumber: ConfirmationNumberRepo;
|
|
10
|
-
}) => Promise<
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
confirmationNumber: string;
|
|
12
|
+
}>;
|
|
11
13
|
export { fixConfirmationNumberAsNeeded };
|
|
@@ -14,18 +14,20 @@ const factory = require("../../../factory");
|
|
|
14
14
|
const publishConfirmationNumberIfNotExist_1 = require("../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
|
|
15
15
|
function fixConfirmationNumberAsNeeded(params) {
|
|
16
16
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
// publish always(2025-02-12~)
|
|
17
18
|
// MovieTicketの場合、確認番号を発行(着券に連携するため)(2024-05-27~)
|
|
19
|
+
// let confirmationNumber: string | undefined;
|
|
18
20
|
let confirmationNumber;
|
|
19
|
-
if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.MovieTicket) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return confirmationNumber;
|
|
21
|
+
// if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.MovieTicket) {
|
|
22
|
+
confirmationNumber = yield (0, publishConfirmationNumberIfNotExist_1.publishConfirmationNumberIfNotExist)({
|
|
23
|
+
id: params.purpose.id,
|
|
24
|
+
status: { $in: [factory.transactionStatusType.InProgress] },
|
|
25
|
+
object: { orderDate: new Date() }
|
|
26
|
+
})({
|
|
27
|
+
confirmationNumber: repos.confirmationNumber,
|
|
28
|
+
transaction: repos.transaction
|
|
29
|
+
});
|
|
30
|
+
// }
|
|
31
|
+
return { confirmationNumber };
|
|
30
32
|
});
|
|
31
33
|
}
|
|
@@ -118,7 +118,7 @@ declare function publishPaymentUrl(params: {
|
|
|
118
118
|
agent: {
|
|
119
119
|
id: string;
|
|
120
120
|
};
|
|
121
|
-
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'
|
|
121
|
+
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
122
122
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
123
123
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
124
124
|
location: factory.action.trade.pay.ILocation;
|
|
@@ -255,13 +255,12 @@ function publishPaymentUrl(params) {
|
|
|
255
255
|
let result;
|
|
256
256
|
// URL発行
|
|
257
257
|
const authorizeObject = Object.assign(Object.assign({}, params.object), { accountId: '', paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment });
|
|
258
|
-
const startParams = (0, factory_1.
|
|
258
|
+
const startParams = (0, factory_1.creatPublishPaymentUrlParams)({
|
|
259
259
|
object: authorizeObject,
|
|
260
260
|
paymentServiceType,
|
|
261
261
|
transaction: transaction,
|
|
262
262
|
transactionNumber: transactionNumber,
|
|
263
|
-
location: params.location
|
|
264
|
-
order: {}
|
|
263
|
+
location: params.location
|
|
265
264
|
});
|
|
266
265
|
const taskId = (_a = params.sameAs) === null || _a === void 0 ? void 0 : _a.id;
|
|
267
266
|
result = yield PayTransactionService.publishPaymentUrl(startParams, {
|
|
@@ -326,8 +325,8 @@ function authorize(params) {
|
|
|
326
325
|
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
327
326
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
328
327
|
}
|
|
329
|
-
const confirmationNumber = yield (0, fixConfirmationNumberAsNeeded_1.fixConfirmationNumberAsNeeded)({ purpose, paymentServiceType })(repos);
|
|
330
328
|
const transaction = yield repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
|
|
329
|
+
const { confirmationNumber } = yield (0, fixConfirmationNumberAsNeeded_1.fixConfirmationNumberAsNeeded)({ purpose, paymentServiceType })(repos);
|
|
331
330
|
// 取引番号生成
|
|
332
331
|
let transactionNumber;
|
|
333
332
|
let pendingPaymentAgencyTransaction;
|
|
@@ -417,7 +416,7 @@ function authorize(params) {
|
|
|
417
416
|
transaction: transaction,
|
|
418
417
|
transactionNumber: transactionNumber,
|
|
419
418
|
location: params.location,
|
|
420
|
-
order:
|
|
419
|
+
order: { confirmationNumber } // confirmationNumber required(2025-02-12~)
|
|
421
420
|
});
|
|
422
421
|
payTransaction = yield PayTransactionService.start(startParams, Object.assign({
|
|
423
422
|
// useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet,
|
|
@@ -18,13 +18,11 @@ const validation_1 = require("./validation");
|
|
|
18
18
|
* 決済カード承認
|
|
19
19
|
* オーソリサービスが存在するわけではないので、実質着券する
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
options) {
|
|
21
|
+
// tslint:disable-next-line:max-func-body-length
|
|
22
|
+
function authorize(params, transaction, paymentServiceId, options) {
|
|
24
23
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _a, _b;
|
|
24
|
+
var _a, _b, _c;
|
|
26
25
|
let accountId;
|
|
27
|
-
// let payAction: factory.action.trade.pay.IAction;
|
|
28
26
|
let accountsReceivablesByServiceType = [];
|
|
29
27
|
try {
|
|
30
28
|
// MovieTicket決済の場合、認証
|
|
@@ -59,10 +57,17 @@ options) {
|
|
|
59
57
|
name: transaction.recipient.name,
|
|
60
58
|
typeOf: transaction.recipient.typeOf
|
|
61
59
|
};
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
const confirmationNumber = (_b = params.purpose) === null || _b === void 0 ? void 0 : _b.confirmationNumber;
|
|
61
|
+
if (typeof confirmationNumber !== 'string' || confirmationNumber === '') {
|
|
62
|
+
throw new factory.errors.ArgumentNull('purpose.confirmationNumber');
|
|
63
|
+
}
|
|
64
|
+
const purpose = {
|
|
65
|
+
confirmationNumber,
|
|
66
|
+
typeOf: factory.order.OrderType.Order
|
|
67
|
+
};
|
|
68
|
+
const payActionAttributes = Object.assign({ project: transaction.project, typeOf: factory.actionType.PayAction, object: [payObject], agent: transaction.project, recipient,
|
|
69
|
+
instrument,
|
|
70
|
+
purpose }, (typeof ((_c = options.executor) === null || _c === void 0 ? void 0 : _c.id) === 'string')
|
|
66
71
|
? { sameAs: { id: options.executor.id, typeOf: 'Task' } } // link sameAs(2024-06-04~)
|
|
67
72
|
: undefined);
|
|
68
73
|
// callOnPayActionCompleted: false(2025-02-10~)
|
|
@@ -17,7 +17,7 @@ declare function createSeatInfoSyncIn(params: {
|
|
|
17
17
|
paymentMethodId: string;
|
|
18
18
|
movieTickets: factory.action.trade.pay.IMovieTicket[];
|
|
19
19
|
event: IEvent4seatInfoSync;
|
|
20
|
-
purpose: factory.
|
|
20
|
+
purpose: factory.assetTransaction.pay.IOrderAsPurpose;
|
|
21
21
|
credentials: {
|
|
22
22
|
kgygishCd: string;
|
|
23
23
|
stCd: string;
|
|
@@ -10,7 +10,7 @@ const surfrock = require("@surfrock/sdk");
|
|
|
10
10
|
const moment = require("moment-timezone");
|
|
11
11
|
const factory = require("../../../factory");
|
|
12
12
|
function createSeatInfoSyncIn(params) {
|
|
13
|
-
var _a, _b, _c
|
|
13
|
+
var _a, _b, _c;
|
|
14
14
|
const event = params.event;
|
|
15
15
|
const knyknrNoInfo = [];
|
|
16
16
|
params.movieTickets.forEach((movieTicket) => {
|
|
@@ -46,23 +46,19 @@ function createSeatInfoSyncIn(params) {
|
|
|
46
46
|
}
|
|
47
47
|
const kgygishCd = params.credentials.kgygishCd;
|
|
48
48
|
const stCd = params.credentials.stCd;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// }
|
|
54
|
-
// if (typeof stCd !== 'string') {
|
|
55
|
-
// throw new factory.errors.NotFound('paymentAccepted.movieTicketInfo.stCd');
|
|
56
|
-
// }
|
|
49
|
+
const confirmationNumber = (_c = params.purpose) === null || _c === void 0 ? void 0 : _c.confirmationNumber;
|
|
50
|
+
if (typeof confirmationNumber !== 'string' || confirmationNumber === '') {
|
|
51
|
+
throw new factory.errors.ArgumentNull('purpose.confirmationNumber');
|
|
52
|
+
}
|
|
57
53
|
return {
|
|
58
54
|
kgygishCd: kgygishCd,
|
|
59
55
|
yykDvcTyp: surfrock.factory.service.seat.seatInfoSync.ReserveDeviceType.EntertainerSitePC, // 予約デバイス区分
|
|
60
56
|
trkshFlg: surfrock.factory.service.seat.seatInfoSync.DeleteFlag.False, // 取消フラグ
|
|
61
57
|
kgygishSstmZskyykNo: params.paymentMethodId, // 興行会社システム座席予約番号
|
|
62
|
-
//
|
|
63
|
-
kgygishUsrZskyykNo: (typeof (
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
kgygishUsrZskyykNo: confirmationNumber, // fix(2025-02-12~)
|
|
59
|
+
// kgygishUsrZskyykNo: (typeof (<factory.action.trade.pay.IOrderAsPayPurpose>params.purpose)?.confirmationNumber === 'string')
|
|
60
|
+
// ? String((<factory.action.trade.pay.IOrderAsPayPurpose>params.purpose).confirmationNumber) // 注文の確認番号の場合
|
|
61
|
+
// : String((<factory.action.trade.pay.IPurposeAsAssetTransaction>params.purpose)?.transactionNumber), // 決済取引番号の場合
|
|
66
62
|
jeiDt: moment(event.startDate)
|
|
67
63
|
.tz('Asia/Tokyo')
|
|
68
64
|
.format('YYYY/MM/DD HH:mm:ss'), // 上映日時
|
|
@@ -22,7 +22,9 @@ type IPayOperation<T> = (repos: IPayOperationRepos, settings: Settings) => Promi
|
|
|
22
22
|
/**
|
|
23
23
|
* 決済カード決済
|
|
24
24
|
*/
|
|
25
|
-
declare function payMovieTicket(params: factory.action.trade.pay.IAttributes,
|
|
25
|
+
declare function payMovieTicket(params: Omit<factory.action.trade.pay.IAttributes, 'purpose'> & {
|
|
26
|
+
purpose: factory.action.trade.pay.IOrderAsPayPurpose;
|
|
27
|
+
}, options: {
|
|
26
28
|
callOnPayActionCompleted: boolean;
|
|
27
29
|
}): IPayOperation<void>;
|
|
28
30
|
export { payMovieTicket };
|
|
@@ -144,7 +144,12 @@ payActionAttributes) {
|
|
|
144
144
|
yield CreditCardPaymentService.payCreditCard(payActionAttributes)(repos, settings);
|
|
145
145
|
break;
|
|
146
146
|
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
147
|
-
|
|
147
|
+
// check purpose(2025-02-12~)
|
|
148
|
+
const purpose = payActionAttributes.purpose;
|
|
149
|
+
if ((purpose === null || purpose === void 0 ? void 0 : purpose.typeOf) !== factory.order.OrderType.Order) {
|
|
150
|
+
throw new factory.errors.NotImplemented(`${purpose === null || purpose === void 0 ? void 0 : purpose.typeOf} not implemented`);
|
|
151
|
+
}
|
|
152
|
+
yield MovieTicketPaymentService.payMovieTicket(Object.assign(Object.assign({}, payActionAttributes), { purpose }), { callOnPayActionCompleted: true })(repos, settings);
|
|
148
153
|
break;
|
|
149
154
|
default:
|
|
150
155
|
throw new factory.errors.NotImplemented(`Payment service '${paymentServiceType}' not implemented`);
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "4.393.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "10.21.0-alpha.
|
|
14
|
+
"@chevre/factory": "4.393.0-alpha.14",
|
|
15
|
+
"@cinerino/sdk": "10.21.0-alpha.12",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.3.0",
|
|
18
18
|
"@sendgrid/mail": "6.4.0",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"postversion": "git push origin --tags",
|
|
113
113
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
114
114
|
},
|
|
115
|
-
"version": "22.9.0-alpha.
|
|
115
|
+
"version": "22.9.0-alpha.19"
|
|
116
116
|
}
|