@chevre/domain 22.2.0-alpha.26 → 22.2.0-alpha.28
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/repo/action.d.ts +10 -7
- package/lib/chevre/repo/action.js +2 -1
- package/lib/chevre/service/code.js +1 -1
- package/lib/chevre/service/moneyTransfer.js +1 -1
- package/lib/chevre/service/notification.js +1 -1
- package/lib/chevre/service/offer/product.js +4 -2
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +2 -2
- package/lib/chevre/service/payment/any.js +2 -2
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +5 -5
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +4 -4
- package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
- package/lib/chevre/service/payment/faceToFace.js +10 -10
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +5 -5
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +4 -4
- package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
- package/lib/chevre/service/payment/paymentCard.js +14 -14
- package/package.json +2 -2
|
@@ -25,9 +25,12 @@
|
|
|
25
25
|
import { factory as surfrockFactory } from '@surfrock/sdk';
|
|
26
26
|
import { Connection, Document, FilterQuery, QueryOptions, UpdateQuery } from 'mongoose';
|
|
27
27
|
import * as factory from '../factory';
|
|
28
|
-
export type
|
|
28
|
+
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction<factory.service.webAPI.Identifier> | factory.action.authorize.offer.moneyTransfer.IAction | factory.action.authorize.offer.product.IAction | factory.action.authorize.paymentMethod.any.IAction) & {
|
|
29
29
|
cancelAction?: any;
|
|
30
|
-
} :
|
|
30
|
+
} : never;
|
|
31
|
+
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> & {
|
|
32
|
+
cancelAction?: any;
|
|
33
|
+
} : T extends factory.actionType.CheckAction ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.token.IAction) : T extends factory.actionType.MoneyTransfer ? factory.action.transfer.moneyTransfer.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction<factory.action.update.replace.IAttributes<any, any>> & {
|
|
31
34
|
targetCollection?: any;
|
|
32
35
|
} : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
33
36
|
export type IPayAction = factory.action.trade.pay.IAction;
|
|
@@ -93,7 +96,7 @@ export declare class ActionRepo {
|
|
|
93
96
|
*/
|
|
94
97
|
start<T extends factory.actionType>(attributes: factory.action.IAttributes<T, any, any>, options?: {
|
|
95
98
|
recipe?: IRecipeAsActionAttributes;
|
|
96
|
-
}): Promise<IAction<T>>;
|
|
99
|
+
}): Promise<Pick<IAction<T>, 'id' | 'typeOf' | 'startDate'>>;
|
|
97
100
|
/**
|
|
98
101
|
* アクション完了
|
|
99
102
|
* @deprecated use completeWithVoid
|
|
@@ -193,7 +196,7 @@ export declare class ActionRepo {
|
|
|
193
196
|
$nin?: string[];
|
|
194
197
|
};
|
|
195
198
|
sort?: factory.action.ISortOrder;
|
|
196
|
-
}): Promise<
|
|
199
|
+
}): Promise<IAction4transaction<T>[]>;
|
|
197
200
|
/**
|
|
198
201
|
* 注文番号から、注文に対するアクションを検索する
|
|
199
202
|
*/
|
|
@@ -201,7 +204,7 @@ export declare class ActionRepo {
|
|
|
201
204
|
orderNumber: string;
|
|
202
205
|
sort?: factory.action.ISortOrder;
|
|
203
206
|
}): Promise<IAction<factory.actionType>[]>;
|
|
204
|
-
searchBySameAs(params: {
|
|
207
|
+
searchBySameAs<T extends factory.actionType>(params: {
|
|
205
208
|
sameAs: {
|
|
206
209
|
id: {
|
|
207
210
|
$eq: string;
|
|
@@ -216,9 +219,9 @@ export declare class ActionRepo {
|
|
|
216
219
|
* 1taskから複数actionが発生する可能性があるので、typeOf指定が必須
|
|
217
220
|
*/
|
|
218
221
|
typeOf: {
|
|
219
|
-
$eq:
|
|
222
|
+
$eq: T;
|
|
220
223
|
};
|
|
221
|
-
}): Promise<Pick<IAction<
|
|
224
|
+
}): Promise<Pick<IAction<T>, 'id' | 'actionStatus' | 'error' | 'purpose'>[]>;
|
|
222
225
|
deleteByProject(params: {
|
|
223
226
|
project: {
|
|
224
227
|
id: string;
|
|
@@ -506,7 +506,8 @@ class ActionRepo {
|
|
|
506
506
|
*/
|
|
507
507
|
start(attributes, options) {
|
|
508
508
|
return __awaiter(this, void 0, void 0, function* () {
|
|
509
|
-
const
|
|
509
|
+
const startDate = new Date();
|
|
510
|
+
const startedAction = yield this.actionModel.create(Object.assign(Object.assign({}, attributes), { actionStatus: factory.actionStatusType.ActiveActionStatus, startDate }))
|
|
510
511
|
.then((doc) => doc.toObject());
|
|
511
512
|
// add recipe(2024-06-09~)
|
|
512
513
|
const savingRecipe = options === null || options === void 0 ? void 0 : options.recipe;
|
|
@@ -160,7 +160,7 @@ function verifyToken(params) {
|
|
|
160
160
|
typeOf: factory.action.check.token.ObjectType.Ticket
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
-
action =
|
|
163
|
+
action = yield repos.action.start(actionAttributes);
|
|
164
164
|
}
|
|
165
165
|
try {
|
|
166
166
|
// payload = await new Promise<IPayloadWithNoVersion | IPayload>((resolve, reject) => {
|
|
@@ -408,7 +408,7 @@ function moneyTransfer(params) {
|
|
|
408
408
|
transactionType = pendingTransaction.typeOf;
|
|
409
409
|
}
|
|
410
410
|
const transactionNumber = yield fixAccountTransactionNumber(params)({ transactionNumber: repos.transactionNumber });
|
|
411
|
-
const issuedThroughId = getIssuedThroughIdByAction({ action, pendingTransactionType: transactionType });
|
|
411
|
+
const issuedThroughId = getIssuedThroughIdByAction({ action: params, pendingTransactionType: transactionType });
|
|
412
412
|
const permitServiceCredentials = yield createPermitServiceCredentials({ issuedThrough: { id: issuedThroughId } })(repos);
|
|
413
413
|
const accountTransactionService = new (yield pecorinoapi.loadPecorino()).service.AccountTransaction({
|
|
414
414
|
endpoint: permitServiceCredentials.permitServiceEndpoint,
|
|
@@ -53,7 +53,7 @@ function sendEmailMessage(params) {
|
|
|
53
53
|
// メッセージリポジトリに対応(2024-04-29~)
|
|
54
54
|
emailMessage = yield repos.message.findByIdentifier({
|
|
55
55
|
identifier: params.object.identifier,
|
|
56
|
-
project: { id:
|
|
56
|
+
project: { id: project.id }
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
const emailMessageFrom = {
|
|
@@ -146,8 +146,10 @@ function authorize(params) {
|
|
|
146
146
|
});
|
|
147
147
|
requestBody = startParams;
|
|
148
148
|
responseBody = yield RegisterServiceTransaction.start(startParams)(repos);
|
|
149
|
-
const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({
|
|
150
|
-
|
|
149
|
+
const acceptedOffers4result = (0, factory_1.responseBody2resultAcceptedOffer)({
|
|
150
|
+
project: actionAttributes.project, responseBody, acceptedOffer
|
|
151
|
+
});
|
|
152
|
+
result = (0, factory_1.createResult)({ project: actionAttributes.project, requestBody, responseBody, acceptedOffer });
|
|
151
153
|
yield (0, any_1.acceptOffer)({
|
|
152
154
|
project: transaction.project,
|
|
153
155
|
purpose: { id: transaction.id },
|
|
@@ -43,7 +43,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
43
43
|
if (Array.isArray(authorizeActionsAsResult) && authorizeActionsAsResult.length > 0) {
|
|
44
44
|
const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
|
|
45
45
|
if (completedAuthorizeActionIds.length > 0) {
|
|
46
|
-
authorizePaymentActions = yield repos.action.search({
|
|
46
|
+
authorizePaymentActions = (yield repos.action.search({
|
|
47
47
|
typeOf: factory.actionType.AuthorizeAction,
|
|
48
48
|
purpose: {
|
|
49
49
|
typeOf: { $in: [factory.transactionType.PlaceOrder] },
|
|
@@ -51,7 +51,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
51
51
|
},
|
|
52
52
|
object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } },
|
|
53
53
|
id: { $in: completedAuthorizeActionIds }
|
|
54
|
-
}, ['result'], []);
|
|
54
|
+
}, ['result'], []));
|
|
55
55
|
authorizeOfferActionsWithInstrument = (yield repos.action.search({
|
|
56
56
|
typeOf: factory.actionType.AuthorizeAction,
|
|
57
57
|
purpose: {
|
|
@@ -415,9 +415,9 @@ function authorize(params) {
|
|
|
415
415
|
const rawError = Array.isArray(error) ? error[1] : undefined;
|
|
416
416
|
if (rawError !== undefined && rawError.name !== 'AbortError') {
|
|
417
417
|
yield processVoidPayTransaction({
|
|
418
|
-
project:
|
|
418
|
+
project: actionAttributes.project,
|
|
419
419
|
id: action.id,
|
|
420
|
-
purpose:
|
|
420
|
+
purpose: actionAttributes.purpose
|
|
421
421
|
})(repos);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
@@ -85,7 +85,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
85
85
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
86
86
|
};
|
|
87
87
|
// add action(2024-06-12~)
|
|
88
|
-
action =
|
|
88
|
+
action = yield repos.action.start(actionAttributes, { recipe });
|
|
89
89
|
try {
|
|
90
90
|
entryTranResult = yield repos.creditCardService.entryTran(entryTranArgs);
|
|
91
91
|
execTranArgs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ accessId: entryTranResult.accessId, accessPass: entryTranResult.accessPass, orderId, method: params.object.method, siteId: (_e = params.availableChannel.credentials) === null || _e === void 0 ? void 0 : _e.siteId, sitePass: (_f = params.availableChannel.credentials) === null || _f === void 0 ? void 0 : _f.sitePass, seqMode: GMO.utils.util.SeqMode.Physics }, (typeof cardNo === 'string') ? { cardNo } : undefined), (typeof cardPass === 'string') ? { cardPass } : undefined), (typeof expire === 'string') ? { expire } : undefined), (typeof token === 'string') ? { token } : undefined), (typeof memberId === 'string') ? { memberId } : undefined), (typeof cardSeq === 'number') ? { cardSeq } : undefined);
|
|
@@ -34,7 +34,7 @@ function processAuthorizeCreditCard3ds(params) {
|
|
|
34
34
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
35
35
|
};
|
|
36
36
|
// add action(2024-06-12~)
|
|
37
|
-
action =
|
|
37
|
+
action = yield repos.action.start(actionAttributes, { recipe });
|
|
38
38
|
try {
|
|
39
39
|
secureTran2Result = yield repos.creditCardService.secureTran2(secureTran2Args);
|
|
40
40
|
}
|
|
@@ -6,7 +6,6 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
7
|
import * as factory from '../../../factory';
|
|
8
8
|
import { Settings } from '../../../settings';
|
|
9
|
-
type IPayAction = factory.action.trade.pay.IAction;
|
|
10
9
|
/**
|
|
11
10
|
* クレジットカード決済
|
|
12
11
|
*/
|
|
@@ -17,5 +16,5 @@ declare function payCreditCard(params: factory.action.trade.pay.IAttributes): (r
|
|
|
17
16
|
paymentService: PaymentServiceRepo;
|
|
18
17
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
19
18
|
task: TaskRepo;
|
|
20
|
-
}, settings: Settings) => Promise<
|
|
19
|
+
}, settings: Settings) => Promise<void>;
|
|
21
20
|
export { payCreditCard };
|
|
@@ -83,13 +83,13 @@ function payCreditCard(params) {
|
|
|
83
83
|
yield (0, onPaid_1.onPaid)({
|
|
84
84
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
85
85
|
id: action.id,
|
|
86
|
-
object:
|
|
87
|
-
potentialActions:
|
|
88
|
-
project:
|
|
89
|
-
purpose:
|
|
86
|
+
object: params.object,
|
|
87
|
+
potentialActions: params.potentialActions,
|
|
88
|
+
project: params.project,
|
|
89
|
+
purpose: params.purpose,
|
|
90
90
|
typeOf: action.typeOf
|
|
91
91
|
})(repos);
|
|
92
|
-
return action;
|
|
92
|
+
// return action;
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
exports.payCreditCard = payCreditCard;
|
|
@@ -103,10 +103,10 @@ function refundCreditCard(params, options) {
|
|
|
103
103
|
yield (0, onRefund_1.onRefund)({
|
|
104
104
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
105
105
|
id: action.id,
|
|
106
|
-
object:
|
|
107
|
-
potentialActions:
|
|
108
|
-
project:
|
|
109
|
-
purpose:
|
|
106
|
+
object: startingActionParams.object,
|
|
107
|
+
potentialActions: startingActionParams.potentialActions,
|
|
108
|
+
project: startingActionParams.project,
|
|
109
|
+
purpose: startingActionParams.purpose,
|
|
110
110
|
typeOf: action.typeOf
|
|
111
111
|
})(repos);
|
|
112
112
|
// return action;
|
|
@@ -14,11 +14,11 @@ declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (r
|
|
|
14
14
|
accountingReport: AccountingReportRepo;
|
|
15
15
|
product: ProductRepo;
|
|
16
16
|
task: TaskRepo;
|
|
17
|
-
}) => Promise<
|
|
17
|
+
}) => Promise<void>;
|
|
18
18
|
declare function refundFaceToFace(params: factory.task.refund.IData): (repos: {
|
|
19
19
|
action: ActionRepo;
|
|
20
20
|
accountingReport: AccountingReportRepo;
|
|
21
21
|
product: ProductRepo;
|
|
22
22
|
task: TaskRepo;
|
|
23
|
-
}) => Promise<
|
|
23
|
+
}) => Promise<void>;
|
|
24
24
|
export { payFaceToFace, refundFaceToFace, voidTransaction };
|
|
@@ -42,13 +42,13 @@ function payFaceToFace(params) {
|
|
|
42
42
|
yield (0, onPaid_1.onPaid)({
|
|
43
43
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
44
44
|
id: action.id,
|
|
45
|
-
object:
|
|
46
|
-
potentialActions:
|
|
47
|
-
project:
|
|
48
|
-
purpose:
|
|
45
|
+
object: params.object,
|
|
46
|
+
potentialActions: params.potentialActions,
|
|
47
|
+
project: params.project,
|
|
48
|
+
purpose: params.purpose,
|
|
49
49
|
typeOf: action.typeOf
|
|
50
50
|
})(repos);
|
|
51
|
-
return action;
|
|
51
|
+
// return action;
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
exports.payFaceToFace = payFaceToFace;
|
|
@@ -72,13 +72,13 @@ function refundFaceToFace(params) {
|
|
|
72
72
|
yield (0, onRefund_1.onRefund)({
|
|
73
73
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
74
74
|
id: action.id,
|
|
75
|
-
object:
|
|
76
|
-
potentialActions:
|
|
77
|
-
project:
|
|
78
|
-
purpose:
|
|
75
|
+
object: params.object,
|
|
76
|
+
potentialActions: params.potentialActions,
|
|
77
|
+
project: params.project,
|
|
78
|
+
purpose: params.purpose,
|
|
79
79
|
typeOf: action.typeOf
|
|
80
80
|
})(repos);
|
|
81
|
-
return action;
|
|
81
|
+
// return action;
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
exports.refundFaceToFace = refundFaceToFace;
|
|
@@ -10,7 +10,6 @@ import { Settings } from '../../../settings';
|
|
|
10
10
|
interface IAuthorizeResult {
|
|
11
11
|
accountId: string;
|
|
12
12
|
accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
|
|
13
|
-
payAction: factory.action.trade.pay.IAction;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* 決済カード承認
|
|
@@ -22,7 +22,7 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
22
22
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
let accountId;
|
|
25
|
-
let payAction;
|
|
25
|
+
// let payAction: factory.action.trade.pay.IAction;
|
|
26
26
|
let accountsReceivablesByServiceType = [];
|
|
27
27
|
try {
|
|
28
28
|
// MovieTicket決済の場合、認証
|
|
@@ -64,7 +64,8 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
64
64
|
? { sameAs: { id: options.executor.id, typeOf: 'Task' } } // link sameAs(2024-06-04~)
|
|
65
65
|
: undefined);
|
|
66
66
|
// 着券させざるをえないが、informPaymentはしない(注文がまだ存在しないため)
|
|
67
|
-
payAction =
|
|
67
|
+
// payAction = await payMovieTicket(payActionAttributes)(repos, settings);
|
|
68
|
+
yield (0, payMovieTicket_1.payMovieTicket)(payActionAttributes)(repos, settings);
|
|
68
69
|
}
|
|
69
70
|
catch (error) {
|
|
70
71
|
// アクション保管用のエラーと両方throw(2024-05-22~)
|
|
@@ -76,7 +77,11 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
76
77
|
}
|
|
77
78
|
// throw handleMvtkReserveError(error);
|
|
78
79
|
}
|
|
79
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
accountId,
|
|
82
|
+
// payAction, // discontinue(2024-08-28~)
|
|
83
|
+
accountsReceivablesByServiceType
|
|
84
|
+
};
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
exports.authorize = authorize;
|
|
@@ -17,9 +17,8 @@ interface IPayOperationRepos {
|
|
|
17
17
|
task: TaskRepo;
|
|
18
18
|
}
|
|
19
19
|
type IPayOperation<T> = (repos: IPayOperationRepos, settings: Settings) => Promise<T>;
|
|
20
|
-
type IPayAction = factory.action.trade.pay.IAction;
|
|
21
20
|
/**
|
|
22
21
|
* 決済カード決済
|
|
23
22
|
*/
|
|
24
|
-
declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<
|
|
23
|
+
declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<void>;
|
|
25
24
|
export { payMovieTicket };
|
|
@@ -95,13 +95,13 @@ function payMovieTicket(params) {
|
|
|
95
95
|
yield (0, onPaid_1.onPaid)({
|
|
96
96
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
97
97
|
id: action.id,
|
|
98
|
-
object:
|
|
99
|
-
potentialActions:
|
|
100
|
-
project:
|
|
101
|
-
purpose:
|
|
98
|
+
object: startingAction.object,
|
|
99
|
+
potentialActions: startingAction.potentialActions,
|
|
100
|
+
project: startingAction.project,
|
|
101
|
+
purpose: startingAction.purpose,
|
|
102
102
|
typeOf: action.typeOf
|
|
103
103
|
})(repos);
|
|
104
|
-
return action;
|
|
104
|
+
// return action;
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
exports.payMovieTicket = payMovieTicket;
|
|
@@ -115,10 +115,10 @@ function refundMovieTicket(params) {
|
|
|
115
115
|
yield (0, onRefund_1.onRefund)({
|
|
116
116
|
actionStatus,
|
|
117
117
|
id: action.id,
|
|
118
|
-
object:
|
|
119
|
-
potentialActions:
|
|
120
|
-
project:
|
|
121
|
-
purpose:
|
|
118
|
+
object: refundActionAttributes.object,
|
|
119
|
+
potentialActions: refundActionAttributes.potentialActions,
|
|
120
|
+
project: refundActionAttributes.project,
|
|
121
|
+
purpose: refundActionAttributes.purpose,
|
|
122
122
|
typeOf: action.typeOf
|
|
123
123
|
})(repos);
|
|
124
124
|
});
|
|
@@ -21,7 +21,7 @@ declare function payPaymentCard(params: factory.action.trade.pay.IAttributes): (
|
|
|
21
21
|
accountingReport: AccountingReportRepo;
|
|
22
22
|
product: ProductRepo;
|
|
23
23
|
task: TaskRepo;
|
|
24
|
-
}) => Promise<
|
|
24
|
+
}) => Promise<void>;
|
|
25
25
|
declare function refundPaymentCard(params: factory.task.refund.IData): (repos: {
|
|
26
26
|
action: ActionRepo;
|
|
27
27
|
accountingReport: AccountingReportRepo;
|
|
@@ -29,5 +29,5 @@ declare function refundPaymentCard(params: factory.task.refund.IData): (repos: {
|
|
|
29
29
|
task: TaskRepo;
|
|
30
30
|
assetTransaction: AssetTransactionRepo;
|
|
31
31
|
transactionNumber: TransactionNumberRepo;
|
|
32
|
-
}) => Promise<
|
|
32
|
+
}) => Promise<void>;
|
|
33
33
|
export { authorize, payPaymentCard, refundPaymentCard, voidTransaction };
|
|
@@ -237,7 +237,7 @@ function payPaymentCard(params) {
|
|
|
237
237
|
try {
|
|
238
238
|
const transactionNumber = payObject[0].paymentMethod.paymentMethodId;
|
|
239
239
|
const availableChannel = yield repos.product.findAvailableChannel({
|
|
240
|
-
project: { id:
|
|
240
|
+
project: { id: params.project.id },
|
|
241
241
|
typeOf: factory.service.paymentService.PaymentServiceType.PaymentCard,
|
|
242
242
|
id: paymentServiceId
|
|
243
243
|
});
|
|
@@ -268,13 +268,13 @@ function payPaymentCard(params) {
|
|
|
268
268
|
yield (0, onPaid_1.onPaid)({
|
|
269
269
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
270
270
|
id: action.id,
|
|
271
|
-
object:
|
|
272
|
-
potentialActions:
|
|
273
|
-
project:
|
|
274
|
-
purpose:
|
|
271
|
+
object: params.object,
|
|
272
|
+
potentialActions: params.potentialActions,
|
|
273
|
+
project: params.project,
|
|
274
|
+
purpose: params.purpose,
|
|
275
275
|
typeOf: action.typeOf
|
|
276
276
|
})(repos);
|
|
277
|
-
return action;
|
|
277
|
+
// return action;
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
exports.payPaymentCard = payPaymentCard;
|
|
@@ -298,7 +298,7 @@ function refundPaymentCard(params) {
|
|
|
298
298
|
let accountTransactionNumber4refund;
|
|
299
299
|
try {
|
|
300
300
|
const availableChannel = yield repos.product.findAvailableChannel({
|
|
301
|
-
project: { id:
|
|
301
|
+
project: { id: params.project.id },
|
|
302
302
|
typeOf: factory.service.paymentService.PaymentServiceType.PaymentCard,
|
|
303
303
|
id: paymentServiceId
|
|
304
304
|
});
|
|
@@ -314,7 +314,7 @@ function refundPaymentCard(params) {
|
|
|
314
314
|
});
|
|
315
315
|
// 返金のユニークネスを保証するため識別子を指定する
|
|
316
316
|
const accountTransactionIdentifier = (0, accountTransactionIdentifier_1.createRefundIdentifier)({
|
|
317
|
-
project: { id:
|
|
317
|
+
project: { id: params.project.id },
|
|
318
318
|
paymentMethodId
|
|
319
319
|
});
|
|
320
320
|
// すでに返金済かどうか確認
|
|
@@ -323,7 +323,7 @@ function refundPaymentCard(params) {
|
|
|
323
323
|
// 口座取引で確認する(2022-10-27~)
|
|
324
324
|
const searchAccountTransactionsResult = yield accountTransactionService.search({
|
|
325
325
|
limit: 100,
|
|
326
|
-
project: { id: { $eq:
|
|
326
|
+
project: { id: { $eq: params.project.id } },
|
|
327
327
|
identifier: { $eq: accountTransactionIdentifier }
|
|
328
328
|
});
|
|
329
329
|
const existingAccountTransactions = searchAccountTransactionsResult.data;
|
|
@@ -390,13 +390,13 @@ function refundPaymentCard(params) {
|
|
|
390
390
|
yield (0, onRefund_1.onRefund)({
|
|
391
391
|
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
392
392
|
id: action.id,
|
|
393
|
-
object:
|
|
394
|
-
potentialActions:
|
|
395
|
-
project:
|
|
396
|
-
purpose:
|
|
393
|
+
object: params.object,
|
|
394
|
+
potentialActions: params.potentialActions,
|
|
395
|
+
project: params.project,
|
|
396
|
+
purpose: params.purpose,
|
|
397
397
|
typeOf: action.typeOf
|
|
398
398
|
})(repos);
|
|
399
|
-
return action;
|
|
399
|
+
// return action;
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
exports.refundPaymentCard = refundPaymentCard;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@chevre/factory": "4.382.0-alpha.
|
|
12
|
+
"@chevre/factory": "4.382.0-alpha.3",
|
|
13
13
|
"@cinerino/sdk": "10.8.0-alpha.1",
|
|
14
14
|
"@motionpicture/coa-service": "9.5.0-alpha.0",
|
|
15
15
|
"@motionpicture/gmo-service": "5.3.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "22.2.0-alpha.
|
|
113
|
+
"version": "22.2.0-alpha.28"
|
|
114
114
|
}
|