@chevre/domain 23.1.0-alpha.18 → 23.1.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/factory.js +8 -3
- package/lib/chevre/service/payment/any/factory.d.ts +1 -1
- package/lib/chevre/service/payment/any/factory.js +10 -2
- package/lib/chevre/service/payment/any.d.ts +1 -1
- package/lib/chevre/service/payment/any.js +15 -7
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ exports.createStartParams = createStartParams;
|
|
|
7
7
|
const factory = require("../../../factory");
|
|
8
8
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
9
9
|
function createStartParams(params, options) {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
11
11
|
const { instrument } = params;
|
|
12
12
|
const paymentServiceId = (params.paymentService !== undefined)
|
|
13
13
|
? String(params.paymentService.id)
|
|
@@ -109,7 +109,12 @@ function createStartParams(params, options) {
|
|
|
109
109
|
: undefined);
|
|
110
110
|
const object = Object.assign({ accountId: (typeof accountId === 'string') ? accountId : '', paymentMethodId: params.transactionNumber, typeOf: params.paymentServiceType, id: paymentServiceId,
|
|
111
111
|
// onPaymentStatusChanged: { informPayment: params.informActions }, // discontinue(2025-02-09~)
|
|
112
|
-
paymentMethod
|
|
112
|
+
paymentMethod, serviceOutput: (((_0 = params.object.serviceOutput) === null || _0 === void 0 ? void 0 : _0.typeOf) === 'Invoice') // support serviceOutput(2025-11-24~)
|
|
113
|
+
? params.object.serviceOutput
|
|
114
|
+
: {
|
|
115
|
+
typeOf: 'Invoice',
|
|
116
|
+
referencesOrder: { typeOf: factory.order.OrderType.Order }
|
|
117
|
+
} }, (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.MovieTicket)
|
|
113
118
|
? { checkedAction: { id: options.checkedAction.id } } // add checkedAction(2024-12-13~)
|
|
114
119
|
: undefined);
|
|
115
120
|
const potentialAction = [];
|
|
@@ -118,7 +123,7 @@ function createStartParams(params, options) {
|
|
|
118
123
|
potentialAction.push({ id: informAction.id, typeOf: factory.actionType.InformAction });
|
|
119
124
|
}
|
|
120
125
|
});
|
|
121
|
-
return Object.assign(Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires, instrument: (Array.isArray(instrument)) ? instrument : [] }, (typeof ((
|
|
126
|
+
return Object.assign(Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires, instrument: (Array.isArray(instrument)) ? instrument : [] }, (typeof ((_1 = params.location) === null || _1 === void 0 ? void 0 : _1.typeOf) === 'string')
|
|
122
127
|
? { location: params.location }
|
|
123
128
|
: undefined), (potentialAction.length > 0) ? { potentialAction } : undefined // add potentialAction(2025-02-05~)
|
|
124
129
|
);
|
|
@@ -6,7 +6,7 @@ export type IInvoiceByTicketToken = factory.authorization.IInvoiceAsPaymentMetho
|
|
|
6
6
|
export type INotification = factory.notification.payAction.IPayAction4inform | factory.notification.refundAction.IRefundAction4inform;
|
|
7
7
|
export declare function creatPublishPaymentUrlParams(params: {
|
|
8
8
|
accountId?: string;
|
|
9
|
-
object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
9
|
+
object: Pick<factory.action.authorize.paymentMethod.any.IObjectIncludingPaymentMethodDetails, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'referencesOrder'>;
|
|
10
10
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
11
11
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller' | 'project'>;
|
|
12
12
|
transactionNumber: string;
|
|
@@ -22,7 +22,11 @@ function creatPublishPaymentUrlParams(params) {
|
|
|
22
22
|
const object = {
|
|
23
23
|
typeOf: params.paymentServiceType,
|
|
24
24
|
id: issuedThroughId,
|
|
25
|
-
paymentMethod
|
|
25
|
+
paymentMethod,
|
|
26
|
+
serviceOutput: {
|
|
27
|
+
typeOf: 'Invoice',
|
|
28
|
+
referencesOrder: params.object.referencesOrder
|
|
29
|
+
}
|
|
26
30
|
};
|
|
27
31
|
const ticketAsInstrument = (typeof params.ticketToken === 'string') ? { ticketToken: params.ticketToken, typeOf: 'Ticket' } : undefined;
|
|
28
32
|
return Object.assign(Object.assign(Object.assign({ project: { id: params.transaction.project.id, typeOf: factory.organizationType.Project }, typeOf: factory.assetTransactionType.Pay, transactionNumber: params.transactionNumber, agent: {
|
|
@@ -90,7 +94,11 @@ function creatPayTransactionStartParams(params) {
|
|
|
90
94
|
}, object: {
|
|
91
95
|
typeOf: params.paymentServiceType,
|
|
92
96
|
id: issuedThroughId,
|
|
93
|
-
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)
|
|
97
|
+
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),
|
|
98
|
+
serviceOutput: {
|
|
99
|
+
typeOf: 'Invoice',
|
|
100
|
+
referencesOrder: params.object.referencesOrder
|
|
101
|
+
}
|
|
94
102
|
}, expires: expires, purpose: {
|
|
95
103
|
typeOf: factory.order.OrderType.Order,
|
|
96
104
|
confirmationNumber,
|
|
@@ -125,7 +125,7 @@ declare function publishPaymentUrl(params: {
|
|
|
125
125
|
agent: {
|
|
126
126
|
id: string;
|
|
127
127
|
};
|
|
128
|
-
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
128
|
+
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'referencesOrder'>;
|
|
129
129
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
130
130
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
131
131
|
location: factory.action.trade.pay.ILocation;
|
|
@@ -323,7 +323,7 @@ function processVoidPayTransaction(params) {
|
|
|
323
323
|
function publishPaymentUrl(params) {
|
|
324
324
|
// tslint:disable-next-line:max-func-body-length
|
|
325
325
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
326
|
-
var _a;
|
|
326
|
+
var _a, _b;
|
|
327
327
|
const { paymentServiceType, purpose, project } = params;
|
|
328
328
|
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
329
329
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
@@ -361,9 +361,13 @@ function publishPaymentUrl(params) {
|
|
|
361
361
|
// }
|
|
362
362
|
let result;
|
|
363
363
|
// URL発行
|
|
364
|
-
const authorizeObject = Object.assign(Object.assign({}, params.object), { accountId: '', paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
364
|
+
const authorizeObject = Object.assign(Object.assign({}, params.object), { accountId: '', paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
365
|
+
// support referencesOrder(2025-11-24~)
|
|
366
|
+
referencesOrder: (((_a = params.object.referencesOrder) === null || _a === void 0 ? void 0 : _a.typeOf) === factory.order.OrderType.Order)
|
|
367
|
+
? params.object.referencesOrder
|
|
368
|
+
: { typeOf: factory.order.OrderType.Order } });
|
|
365
369
|
const startParams = (0, factory_1.creatPublishPaymentUrlParams)(Object.assign(Object.assign({ object: authorizeObject, paymentServiceType, transaction: transaction, transactionNumber: transactionNumber, location: params.location }, (typeof params.identifier === 'string') ? { identifier: params.identifier } : undefined), (typeof ticketToken === 'string') ? { ticketToken } : undefined));
|
|
366
|
-
const taskId = (
|
|
370
|
+
const taskId = (_b = params.sameAs) === null || _b === void 0 ? void 0 : _b.id;
|
|
367
371
|
result = yield PayTransactionService.publishPaymentUrl(startParams, {
|
|
368
372
|
purposeAsTransaction: { id: transaction.id },
|
|
369
373
|
executor: (typeof taskId === 'string') ? { id: taskId } : {} // タスク関連付け(2024-05-22~)
|
|
@@ -416,7 +420,7 @@ function minimizeObjectIncludingPaymentMethodDetails(authorizeObjectIncludingPay
|
|
|
416
420
|
function authorize(params) {
|
|
417
421
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
418
422
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
419
|
-
var _a, _b;
|
|
423
|
+
var _a, _b, _c;
|
|
420
424
|
const { paymentServiceType, purpose, project } = params;
|
|
421
425
|
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
422
426
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
@@ -497,10 +501,14 @@ function authorize(params) {
|
|
|
497
501
|
const { accountId } = yield fixAccountIdIfPossible({
|
|
498
502
|
object: params.object, project: { id: transaction.project.id }
|
|
499
503
|
})();
|
|
500
|
-
const authorizeObjectIncludingPaymentMethodDetails = Object.assign(Object.assign(Object.assign(Object.assign({}, params.object), { accountId, paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
504
|
+
const authorizeObjectIncludingPaymentMethodDetails = Object.assign(Object.assign(Object.assign(Object.assign({}, params.object), { accountId, paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment,
|
|
505
|
+
// support referencesOrder(2025-11-24~)
|
|
506
|
+
referencesOrder: (((_a = params.object.referencesOrder) === null || _a === void 0 ? void 0 : _a.typeOf) === factory.order.OrderType.Order)
|
|
507
|
+
? params.object.referencesOrder
|
|
508
|
+
: { typeOf: factory.order.OrderType.Order } }), (creditCard !== undefined) ? { creditCard } : undefined), (Array.isArray(movieTickets)) ? { movieTickets } : undefined);
|
|
501
509
|
const { authorizeObject } = minimizeObjectIncludingPaymentMethodDetails(authorizeObjectIncludingPaymentMethodDetails);
|
|
502
510
|
// 承認アクションを開始する
|
|
503
|
-
const taskId = (
|
|
511
|
+
const taskId = (_b = params.sameAs) === null || _b === void 0 ? void 0 : _b.id;
|
|
504
512
|
const uniqueActionIdentifier = util.format(`%s:%s:%s`, factory.actionType.AuthorizeAction, factory.action.authorize.paymentMethod.any.ResultType.Payment, authorizeObject.paymentMethodId);
|
|
505
513
|
const actionAttributes = Object.assign({ project: transaction.project, typeOf: factory.actionType.AuthorizeAction, object: authorizeObject, agent: {
|
|
506
514
|
typeOf: transaction.agent.typeOf,
|
|
@@ -514,7 +522,7 @@ function authorize(params) {
|
|
|
514
522
|
id: transaction.seller.id,
|
|
515
523
|
name: (typeof transaction.seller.name === 'string')
|
|
516
524
|
? transaction.seller.name
|
|
517
|
-
: String((
|
|
525
|
+
: String((_c = transaction.seller.name) === null || _c === void 0 ? void 0 : _c.ja)
|
|
518
526
|
}, purpose: { typeOf: transaction.typeOf, id: transaction.id }, identifier: uniqueActionIdentifier }, (typeof taskId === 'string') ? { sameAs: { id: taskId, typeOf: 'Task' } } : undefined // タスク関連付け(2024-04-22~)
|
|
519
527
|
);
|
|
520
528
|
const action = yield repos.action.start(actionAttributes);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
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": "5.3.0-alpha.
|
|
14
|
+
"@chevre/factory": "5.3.0-alpha.3",
|
|
15
15
|
"@cinerino/sdk": "12.9.0-alpha.1",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "23.1.0-alpha.
|
|
118
|
+
"version": "23.1.0-alpha.19"
|
|
119
119
|
}
|