@chevre/domain 21.33.0-alpha.9 → 21.33.0
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/example/src/chevre/findTransactionById.ts +8 -5
- package/example/src/chevre/migratePayCreditCardRecipes.ts +104 -0
- package/example/src/chevre/migratePayMovieTicketRecipes.ts +100 -0
- package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +147 -0
- package/example/src/chevre/reexportTasksByExportAction.ts +37 -0
- package/example/src/chevre/searchActionsBySameAs.ts +2 -1
- package/example/src/chevre/searchCheckMovieTicketResultYkknInfo.ts +26 -6
- package/example/src/chevre/searchTransactions.ts +1 -1
- package/example/src/chevre/unsetUnnecessaryFields.ts +3 -18
- package/lib/chevre/repo/action.d.ts +51 -0
- package/lib/chevre/repo/action.js +122 -2
- package/lib/chevre/repo/assetTransaction.d.ts +9 -2
- package/lib/chevre/repo/assetTransaction.js +48 -3
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +5 -0
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +23 -25
- package/lib/chevre/repo/mongoose/schemas/transaction.js +5 -52
- package/lib/chevre/repo/transaction.d.ts +26 -11
- package/lib/chevre/repo/transaction.js +89 -17
- package/lib/chevre/service/assetTransaction/pay.d.ts +6 -2
- package/lib/chevre/service/assetTransaction/pay.js +49 -5
- package/lib/chevre/service/offer/event/voidTransaction.js +4 -6
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +2 -1
- package/lib/chevre/service/offer/product.js +1 -1
- package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +23 -0
- package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.js +155 -0
- package/lib/chevre/service/payment/any.d.ts +10 -2
- package/lib/chevre/service/payment/any.js +83 -114
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +41 -0
- package/lib/chevre/service/payment/creditCard/authorize.js +216 -0
- package/lib/chevre/service/payment/creditCard/factory.d.ts +35 -0
- package/lib/chevre/service/payment/creditCard/factory.js +57 -0
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.d.ts +20 -0
- package/lib/chevre/service/payment/creditCard/getGMOInfoFromSeller.js +47 -0
- package/lib/chevre/service/payment/creditCard/gmoError.d.ts +34 -0
- package/lib/chevre/service/payment/creditCard/gmoError.js +8 -0
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +20 -0
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +151 -0
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +26 -0
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +196 -0
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +13 -0
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +62 -0
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +13 -0
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +90 -0
- package/lib/chevre/service/payment/creditCard.d.ts +7 -106
- package/lib/chevre/service/payment/creditCard.js +12 -638
- package/lib/chevre/service/payment/faceToFace.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +38 -0
- package/lib/chevre/service/payment/movieTicket/authorize.js +71 -0
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +22 -0
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +109 -0
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +52 -1
- package/lib/chevre/service/payment/movieTicket/factory.js +114 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +24 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +157 -0
- package/lib/chevre/service/payment/movieTicket/{checkByIdentifier.d.ts → processPurchaseNumberAuth.d.ts} +5 -6
- package/lib/chevre/service/payment/movieTicket/{checkByIdentifier.js → processPurchaseNumberAuth.js} +4 -8
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +21 -0
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +248 -0
- package/lib/chevre/service/payment/movieTicket/validation.js +3 -3
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +12 -0
- package/lib/chevre/service/payment/movieTicket/voidTransaction.js +74 -0
- package/lib/chevre/service/payment/movieTicket.d.ts +7 -75
- package/lib/chevre/service/payment/movieTicket.js +11 -567
- package/lib/chevre/service/payment/paymentCard.d.ts +1 -1
- package/lib/chevre/service/payment.d.ts +9 -1
- package/lib/chevre/service/payment.js +2 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +2 -1
- package/lib/chevre/service/task/checkMovieTicket.js +1 -1
- package/lib/chevre/service/task/pay.d.ts +2 -2
- package/lib/chevre/service/task/pay.js +3 -2
- package/lib/chevre/service/task/publishPaymentUrl.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.d.ts +2 -2
- package/lib/chevre/service/task/voidPayTransaction.js +2 -4
- package/lib/chevre/service/task/voidPayment.js +0 -1
- package/lib/chevre/service/task.js +2 -0
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +2 -2
- package/lib/chevre/service/transaction/placeOrder.js +2 -3
- package/lib/chevre/service/transaction/placeOrderInProgress/confirm.js +3 -2
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +4 -3
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +2 -2
- package/lib/chevre/settings.d.ts +1 -0
- package/lib/chevre/settings.js +2 -1
- package/package.json +3 -3
- package/example/src/chevre/migrateOwnershipInfos2newUserPool.ts +0 -152
- package/example/src/chevre/migratePayTransactionReservedTicketIdentifier.ts +0 -95
|
@@ -18,6 +18,7 @@ const PayTransactionService = require("../assetTransaction/pay");
|
|
|
18
18
|
const code_1 = require("../code");
|
|
19
19
|
const publishConfirmationNumberIfNotExist_1 = require("../transaction/placeOrderInProgress/publishConfirmationNumberIfNotExist");
|
|
20
20
|
const factory_1 = require("./any/factory");
|
|
21
|
+
const handlePrePublishedPaymentMethodIdOnAuthorizing_1 = require("./any/handlePrePublishedPaymentMethodIdOnAuthorizing");
|
|
21
22
|
const onPaymentStatusChanged_1 = require("./any/onPaymentStatusChanged");
|
|
22
23
|
Object.defineProperty(exports, "onPaymentStatusChanged", { enumerable: true, get: function () { return onPaymentStatusChanged_1.onPaymentStatusChanged; } });
|
|
23
24
|
const person2username_1 = require("./any/person2username");
|
|
@@ -56,52 +57,61 @@ function voidPayTransaction(params) {
|
|
|
56
57
|
exports.voidPayTransaction = voidPayTransaction;
|
|
57
58
|
function invalidatePaymentUrl(params) {
|
|
58
59
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
var _a, _b, _c
|
|
60
|
+
var _a, _b, _c;
|
|
60
61
|
if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
61
62
|
throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
62
63
|
}
|
|
63
64
|
const transaction = yield repos.transaction.findById({
|
|
64
65
|
typeOf: params.purpose.typeOf,
|
|
65
66
|
id: params.purpose.id
|
|
66
|
-
});
|
|
67
|
+
}, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
|
|
67
68
|
// 確定取引に対応(2023-05-03~)
|
|
68
69
|
if (transaction.status === factory.transactionStatusType.Confirmed) {
|
|
69
70
|
// no op
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
const paymentMethodIdByPaymentUrl = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
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
|
-
typeOf:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
74
|
+
if (typeof paymentMethodIdByPaymentUrl === 'string' && paymentMethodIdByPaymentUrl.length > 0) {
|
|
75
|
+
const acceptPayAction = (yield repos.action.search({
|
|
76
|
+
limit: 1,
|
|
77
|
+
page: 1,
|
|
78
|
+
project: { id: { $eq: transaction.project.id } },
|
|
79
|
+
typeOf: { $eq: factory.actionType.AcceptAction },
|
|
80
|
+
actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
81
|
+
purpose: { id: { $in: [transaction.id] } },
|
|
82
|
+
object: {
|
|
83
|
+
transactionNumber: { $eq: paymentMethodIdByPaymentUrl },
|
|
84
|
+
typeOf: { $eq: factory.assetTransactionType.Pay }
|
|
85
|
+
}
|
|
86
|
+
}, ['object'], [])).shift();
|
|
87
|
+
if (acceptPayAction !== undefined) {
|
|
88
|
+
// const paymentMethodType = transaction.object.paymentMethods?.typeOf;
|
|
89
|
+
const paymentMethodType = acceptPayAction.object.object.paymentMethod.identifier;
|
|
90
|
+
if (typeof paymentMethodType === 'string' && paymentMethodType.length > 0) {
|
|
91
|
+
// chevreで決済URL無効化
|
|
92
|
+
yield PayTransactionService.invalidatePaymentUrl(Object.assign({ project: transaction.project, typeOf: factory.actionType.RefundAction, agent: {
|
|
93
|
+
typeOf: transaction.seller.typeOf,
|
|
94
|
+
name: (typeof transaction.seller.name === 'string')
|
|
95
|
+
? transaction.seller.name
|
|
96
|
+
: String((_b = transaction.seller.name) === null || _b === void 0 ? void 0 : _b.ja),
|
|
97
|
+
id: transaction.seller.id
|
|
98
|
+
}, recipient: {
|
|
99
|
+
typeOf: transaction.agent.typeOf,
|
|
100
|
+
id: transaction.agent.id,
|
|
101
|
+
name: transaction.agent.name
|
|
102
|
+
}, object: [{
|
|
103
|
+
typeOf: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
104
|
+
id: acceptPayAction.object.object.id,
|
|
105
|
+
paymentMethod: {
|
|
106
|
+
additionalProperty: [],
|
|
107
|
+
name: paymentMethodType,
|
|
108
|
+
typeOf: paymentMethodType,
|
|
109
|
+
paymentMethodId: paymentMethodIdByPaymentUrl
|
|
110
|
+
},
|
|
111
|
+
refundFee: 0
|
|
112
|
+
}], purpose: { typeOf: transaction.typeOf, id: transaction.id } }, (typeof ((_c = params.sameAs) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { sameAs: params.sameAs } : undefined))(repos);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
105
115
|
}
|
|
106
116
|
});
|
|
107
117
|
}
|
|
@@ -122,9 +132,8 @@ function processVoidPayTransaction(params) {
|
|
|
122
132
|
else {
|
|
123
133
|
transaction = (yield repos.transaction.findById({
|
|
124
134
|
typeOf: params.purpose.typeOf,
|
|
125
|
-
id: params.purpose.id
|
|
126
|
-
|
|
127
|
-
}));
|
|
135
|
+
id: params.purpose.id
|
|
136
|
+
}, ['_id', 'typeOf', 'status', 'result']));
|
|
128
137
|
}
|
|
129
138
|
// 承認アクションを取得
|
|
130
139
|
let authorizeActions;
|
|
@@ -252,16 +261,18 @@ function publishPaymentUrl(params) {
|
|
|
252
261
|
})(repos);
|
|
253
262
|
// 取引に保管
|
|
254
263
|
const paymentMethodByPaymentUrl = {
|
|
255
|
-
typeOf: params.object.paymentMethod,
|
|
256
|
-
paymentMethodId: result.paymentMethodId
|
|
257
|
-
paymentUrl: result.paymentUrl,
|
|
258
|
-
issuedThrough: {
|
|
264
|
+
// typeOf: params.object.paymentMethod, // discontinue(2024-06-05~)
|
|
265
|
+
paymentMethodId: result.paymentMethodId
|
|
266
|
+
// paymentUrl: result.paymentUrl, // migrate to recipe(2024-06-05~)
|
|
267
|
+
// issuedThrough: {
|
|
268
|
+
// id: (typeof startParams.object.id === 'string') ? startParams.object.id : ''
|
|
269
|
+
// } // migrate to acceptAction(2024-06-05~)
|
|
259
270
|
// GMO IFを保管(2024-01-01~)
|
|
260
|
-
entryTranArgs: result.entryTranArgs,
|
|
261
|
-
entryTranResult: result.entryTranResult,
|
|
262
|
-
execTranArgs: result.execTranArgs,
|
|
263
|
-
execTranResult: result.execTranResult,
|
|
264
|
-
paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~)
|
|
271
|
+
// entryTranArgs: result.entryTranArgs, // migrate to recipe(2024-06-05~)
|
|
272
|
+
// entryTranResult: result.entryTranResult, // migrate to recipe(2024-06-05~)
|
|
273
|
+
// execTranArgs: result.execTranArgs, // migrate to recipe(2024-06-05~)
|
|
274
|
+
// execTranResult: result.execTranResult, // migrate to recipe(2024-06-05~)
|
|
275
|
+
// paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~) // migrate to acceptAction(2024-06-05~)
|
|
265
276
|
};
|
|
266
277
|
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
267
278
|
id: transaction.id,
|
|
@@ -290,7 +301,7 @@ exports.publishPaymentUrl = publishPaymentUrl;
|
|
|
290
301
|
function authorize(params) {
|
|
291
302
|
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
292
303
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
293
|
-
var _a, _b
|
|
304
|
+
var _a, _b;
|
|
294
305
|
if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
295
306
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${params.purpose.typeOf} not implemented'`);
|
|
296
307
|
}
|
|
@@ -314,59 +325,39 @@ function authorize(params) {
|
|
|
314
325
|
let creditCard = params.object.creditCard;
|
|
315
326
|
// リクエストでpaymentMethodIdを指定された場合、取引に保管されたpaymentMethodIdに一致すればそちらを適用(外部サイト決済対応)
|
|
316
327
|
if (typeof params.object.paymentMethodId === 'string' && params.object.paymentMethodId.length > 0) {
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
328
|
+
const { authorizeParams, existingCompletedAuthorizeAction } = yield (0, handlePrePublishedPaymentMethodIdOnAuthorizing_1.handlePrePublishedPaymentMethodIdOnAuthorizing)({
|
|
329
|
+
object: params.object,
|
|
330
|
+
prePublishedPaymentMethodId: params.object.paymentMethodId,
|
|
331
|
+
transaction
|
|
332
|
+
})(repos);
|
|
333
|
+
if (existingCompletedAuthorizeAction !== undefined) {
|
|
334
|
+
return { id: existingCompletedAuthorizeAction.id };
|
|
335
|
+
}
|
|
336
|
+
else if (authorizeParams !== undefined) {
|
|
324
337
|
// creditCardを決済URL発行時の情報で上書き(2024-01-08~)
|
|
325
|
-
creditCard =
|
|
338
|
+
// creditCard = authorizeParams.paymentMethodByTransaction.paymentMethod?.creditCard;
|
|
339
|
+
creditCard = authorizeParams.creditCard;
|
|
326
340
|
transactionNumber = params.object.paymentMethodId;
|
|
327
|
-
|
|
328
|
-
if (entryTranArgs !== undefined && entryTranResult !== undefined
|
|
329
|
-
&& execTranArgs !== undefined && execTranResult !== undefined) {
|
|
330
|
-
pendingPaymentAgencyTransaction = { entryTranArgs, entryTranResult, execTranArgs, execTranResult };
|
|
331
|
-
}
|
|
332
|
-
// 既に承認済であれば何もしない(2023-05-15~)
|
|
333
|
-
const existingCompletedAuthorizeActions = yield repos.action.searchByPurpose({
|
|
334
|
-
typeOf: factory.actionType.AuthorizeAction,
|
|
335
|
-
purpose: { id: transaction.id, typeOf: transaction.typeOf },
|
|
336
|
-
actionStatus: { $eq: factory.actionStatusType.CompletedActionStatus },
|
|
337
|
-
object: {
|
|
338
|
-
paymentMethodId: { $eq: transactionNumber },
|
|
339
|
-
typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment }
|
|
340
|
-
},
|
|
341
|
-
sort: { startDate: factory.sortType.Ascending }
|
|
342
|
-
});
|
|
343
|
-
const existingCompletedAuthorizeAction = existingCompletedAuthorizeActions.shift();
|
|
344
|
-
if (existingCompletedAuthorizeAction !== undefined) {
|
|
345
|
-
return existingCompletedAuthorizeAction;
|
|
346
|
-
}
|
|
341
|
+
pendingPaymentAgencyTransaction = authorizeParams.pendingPaymentAgencyTransaction;
|
|
347
342
|
}
|
|
348
343
|
else {
|
|
349
|
-
|
|
350
|
-
throw new factory.errors.Argument('paymentMethodId', 'invalid paymentMethodId for the transaction');
|
|
344
|
+
throw new factory.errors.NotImplemented('pendingPaymentAgencyTransaction requied on paymentMethodId specified');
|
|
351
345
|
}
|
|
352
346
|
}
|
|
347
|
+
// 取引番号発行済でなければ発行
|
|
353
348
|
if (typeof transactionNumber !== 'string') {
|
|
354
349
|
const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
355
350
|
transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
356
351
|
}
|
|
357
352
|
const movieTickets = (Array.isArray(params.object.movieTickets)) ? params.object.movieTickets.map(factory_1.createMovieTicket) : undefined;
|
|
358
|
-
const { accountId } = yield fixAccountIdIfPossible({
|
|
359
|
-
object: params.object,
|
|
360
|
-
project: { id: transaction.project.id }
|
|
361
|
-
})(repos);
|
|
353
|
+
const { accountId } = yield fixAccountIdIfPossible({ object: params.object, project: { id: transaction.project.id } })(repos);
|
|
362
354
|
const authorizeObject = Object.assign(Object.assign(Object.assign(Object.assign({}, params.object), { accountId, paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment }), (creditCard !== undefined) ? { creditCard } : undefined), (Array.isArray(movieTickets)) ? { movieTickets } : undefined);
|
|
363
355
|
// 承認アクションを開始する
|
|
364
|
-
const taskId = (
|
|
356
|
+
const taskId = (_a = params.sameAs) === null || _a === void 0 ? void 0 : _a.id;
|
|
365
357
|
const actionAttributes = Object.assign({ project: transaction.project, typeOf: factory.actionType.AuthorizeAction, object: authorizeObject, agent: {
|
|
366
358
|
typeOf: transaction.agent.typeOf,
|
|
367
359
|
id: transaction.agent.id
|
|
368
360
|
}, instrument: {
|
|
369
|
-
// typeOf: 'WebAPI',
|
|
370
361
|
typeOf: factory.assetTransactionType.Pay,
|
|
371
362
|
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre,
|
|
372
363
|
transactionNumber
|
|
@@ -375,10 +366,9 @@ function authorize(params) {
|
|
|
375
366
|
id: transaction.seller.id,
|
|
376
367
|
name: (typeof transaction.seller.name === 'string')
|
|
377
368
|
? transaction.seller.name
|
|
378
|
-
: String((
|
|
379
|
-
}, purpose: { typeOf: transaction.typeOf, id: transaction.id } }, (typeof taskId === 'string')
|
|
380
|
-
|
|
381
|
-
: undefined);
|
|
369
|
+
: String((_b = transaction.seller.name) === null || _b === void 0 ? void 0 : _b.ja)
|
|
370
|
+
}, purpose: { typeOf: transaction.typeOf, id: transaction.id } }, (typeof taskId === 'string') ? { sameAs: { id: taskId, typeOf: 'Task' } } : undefined // タスク関連付け(2024-04-22~)
|
|
371
|
+
);
|
|
382
372
|
const action = yield repos.action.start(actionAttributes);
|
|
383
373
|
let payTransaction;
|
|
384
374
|
try {
|
|
@@ -431,30 +421,6 @@ function authorize(params) {
|
|
|
431
421
|
});
|
|
432
422
|
}
|
|
433
423
|
exports.authorize = authorize;
|
|
434
|
-
/**
|
|
435
|
-
* 注文取引に保管された決済情報を承認しようとしている決済の整合性を検証する
|
|
436
|
-
*/
|
|
437
|
-
function validatePaymentMethodByTransaction(params) {
|
|
438
|
-
var _a, _b;
|
|
439
|
-
const paymentServiceIdByObject = params.object.issuedThrough.id;
|
|
440
|
-
const amountByObject = params.object.amount;
|
|
441
|
-
const paymentMethodTypeByObject = params.object.paymentMethod;
|
|
442
|
-
const paymentServiceIdByTransaction = params.paymentMethodByTransaction.issuedThrough.id;
|
|
443
|
-
const amountByTransaction = (_a = params.paymentMethodByTransaction.paymentMethod) === null || _a === void 0 ? void 0 : _a.amount;
|
|
444
|
-
const paymentMethodTypeByTransaction = (_b = params.paymentMethodByTransaction.paymentMethod) === null || _b === void 0 ? void 0 : _b.identifier;
|
|
445
|
-
// 決済サービスID検証
|
|
446
|
-
if (paymentServiceIdByObject !== paymentServiceIdByTransaction) {
|
|
447
|
-
throw new factory.errors.Argument('object.issuedThrough.id', 'issuedThrough.id must match the target of the paymentUrl');
|
|
448
|
-
}
|
|
449
|
-
// 金額検証
|
|
450
|
-
if (amountByObject !== amountByTransaction) {
|
|
451
|
-
throw new factory.errors.Argument('object.amount', 'amount must match the target of the paymentUrl');
|
|
452
|
-
}
|
|
453
|
-
// 決済方法区分検証
|
|
454
|
-
if (paymentMethodTypeByObject !== paymentMethodTypeByTransaction) {
|
|
455
|
-
throw new factory.errors.Argument('object.paymentMethod', 'paymentMethod must match the target of the paymentUrl');
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
424
|
/**
|
|
459
425
|
* 承認しようとしているobjectからaccountIdを決定する
|
|
460
426
|
*/
|
|
@@ -522,7 +488,8 @@ function findAuthorizeAction(params) {
|
|
|
522
488
|
default:
|
|
523
489
|
// タスクがReadyでなければアクション検索
|
|
524
490
|
const authorizeAction = (yield repos.action.searchBySameAs({
|
|
525
|
-
sameAs: { id: { $eq: task.id } }
|
|
491
|
+
sameAs: { id: { $eq: task.id } },
|
|
492
|
+
typeOf: { $eq: factory.actionType.AuthorizeAction }
|
|
526
493
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
527
494
|
})).shift();
|
|
528
495
|
if (authorizeAction !== undefined) {
|
|
@@ -575,7 +542,8 @@ function findCheckAction(params) {
|
|
|
575
542
|
default:
|
|
576
543
|
// タスクがReadyでなければアクション検索
|
|
577
544
|
const authorizeAction = (yield repos.action.searchBySameAs({
|
|
578
|
-
sameAs: { id: { $eq: task.id } }
|
|
545
|
+
sameAs: { id: { $eq: task.id } },
|
|
546
|
+
typeOf: { $eq: factory.actionType.CheckAction }
|
|
579
547
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
580
548
|
})).shift();
|
|
581
549
|
if (authorizeAction !== undefined) {
|
|
@@ -650,7 +618,8 @@ function findAcceptAction(params) {
|
|
|
650
618
|
default:
|
|
651
619
|
// タスクがReadyでなければアクション検索
|
|
652
620
|
const acceptAction = (yield repos.action.searchBySameAs({
|
|
653
|
-
sameAs: { id: { $eq: task.id } }
|
|
621
|
+
sameAs: { id: { $eq: task.id } },
|
|
622
|
+
typeOf: { $eq: factory.actionType.AcceptAction }
|
|
654
623
|
// purpose: { id: { $eq: String(params.purpose.id) } }
|
|
655
624
|
})).shift();
|
|
656
625
|
if (acceptAction !== undefined) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as GMO from '@motionpicture/gmo-service';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
import type { MongoRepository as PaymentServiceRepo } from '../../../repo/paymentService';
|
|
4
|
+
import type { MongoRepository as PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
5
|
+
import type { MongoRepository as PaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
6
|
+
interface IPaymentAgencyTransaction {
|
|
7
|
+
entryTranArgs: GMO.factory.credit.IEntryTranArgs;
|
|
8
|
+
entryTranResult: GMO.factory.credit.IEntryTranResult;
|
|
9
|
+
execTranArgs: GMO.factory.credit.IExecTranArgs;
|
|
10
|
+
execTranResult: GMO.factory.credit.IExecTranResult | GMO.factory.credit.IExecTran3dsResult;
|
|
11
|
+
secureTran2Result?: GMO.factory.credit.ISecureTran2Result;
|
|
12
|
+
}
|
|
13
|
+
type IAuthorizeResult = IPaymentAgencyTransaction & {
|
|
14
|
+
accountId: string;
|
|
15
|
+
paymentMethodId: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* クレジットカード決済承認
|
|
19
|
+
*/
|
|
20
|
+
declare function authorize(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, paymentServiceId: string, options: {
|
|
21
|
+
pendingPaymentAgencyTransaction?: IPaymentAgencyTransaction;
|
|
22
|
+
/**
|
|
23
|
+
* 決済URL発行処理かどうか
|
|
24
|
+
*/
|
|
25
|
+
processPublishPaymentUrl: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 実行者
|
|
28
|
+
*/
|
|
29
|
+
executor?: {
|
|
30
|
+
/**
|
|
31
|
+
* task ID
|
|
32
|
+
* taskによって実行されている場合値が存在する(taskName: authorizePayment)
|
|
33
|
+
*/
|
|
34
|
+
id?: string;
|
|
35
|
+
};
|
|
36
|
+
}): (repos: {
|
|
37
|
+
paymentAccepted: PaymentAcceptedRepo;
|
|
38
|
+
paymentService: PaymentServiceRepo;
|
|
39
|
+
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
40
|
+
}) => Promise<IAuthorizeResult>;
|
|
41
|
+
export { authorize, IPaymentAgencyTransaction };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.authorize = void 0;
|
|
13
|
+
const GMO = require("@motionpicture/gmo-service");
|
|
14
|
+
const createDebug = require("debug");
|
|
15
|
+
const http_status_1 = require("http-status");
|
|
16
|
+
const credentials_1 = require("../../../credentials");
|
|
17
|
+
const factory = require("../../../factory");
|
|
18
|
+
const getGMOInfoFromSeller_1 = require("./getGMOInfoFromSeller");
|
|
19
|
+
const debug = createDebug('chevre-domain:service:payment');
|
|
20
|
+
/**
|
|
21
|
+
* クレジットカード決済承認
|
|
22
|
+
*/
|
|
23
|
+
function authorize(params, paymentServiceId, options) {
|
|
24
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a, _b, _c, _d, _e;
|
|
26
|
+
// CreditCard系統の決済方法タイプは動的
|
|
27
|
+
const paymentMethodType = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.identifier;
|
|
28
|
+
if (typeof paymentMethodType !== 'string') {
|
|
29
|
+
throw new factory.errors.ArgumentNull('object.paymentMethod.identifier');
|
|
30
|
+
}
|
|
31
|
+
const availableChannel = yield repos.paymentService.findAvailableChannel({
|
|
32
|
+
project: params.project,
|
|
33
|
+
typeOf: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
34
|
+
id: paymentServiceId
|
|
35
|
+
});
|
|
36
|
+
const sellerId = (_b = params.recipient) === null || _b === void 0 ? void 0 : _b.id;
|
|
37
|
+
if (typeof sellerId !== 'string') {
|
|
38
|
+
throw new factory.errors.ArgumentNull('recipient.id');
|
|
39
|
+
}
|
|
40
|
+
const { shopId, shopPass, returnUrls3ds, callbackType3ds } = yield (0, getGMOInfoFromSeller_1.getGMOInfoFromSeller)({ paymentMethodType, seller: { id: sellerId }, paymentServiceId })(repos);
|
|
41
|
+
// GMOオーダーIDはカスタム指定可能
|
|
42
|
+
const orderId = params.transactionNumber;
|
|
43
|
+
if (typeof orderId !== 'string') {
|
|
44
|
+
throw new factory.errors.ArgumentNull('transactionNumber');
|
|
45
|
+
}
|
|
46
|
+
let authorizeResult;
|
|
47
|
+
try {
|
|
48
|
+
// タスクによって実行されているかどうか
|
|
49
|
+
const executedByTask = typeof ((_c = options.executor) === null || _c === void 0 ? void 0 : _c.id) === 'string' && options.executor.id !== '';
|
|
50
|
+
// 非同期承認時に長時間対応(2024-05-18~)
|
|
51
|
+
const timeout = (executedByTask && typeof credentials_1.credentials.gmo.timeoutBackground === 'number')
|
|
52
|
+
? credentials_1.credentials.gmo.timeoutBackground
|
|
53
|
+
: credentials_1.credentials.gmo.timeout;
|
|
54
|
+
debug('processAuthorizeCreditCard processing... executor:', (_d = options.executor) === null || _d === void 0 ? void 0 : _d.id, 'timeout:', timeout);
|
|
55
|
+
const creditCardService = new GMO.service.Credit({
|
|
56
|
+
endpoint: String(availableChannel.serviceUrl),
|
|
57
|
+
useFetch: credentials_1.credentials.gmo.useFetch
|
|
58
|
+
}, { timeout });
|
|
59
|
+
const pendingPaymentAgencyTransaction = options.pendingPaymentAgencyTransaction;
|
|
60
|
+
const redirectUrl = (_e = pendingPaymentAgencyTransaction === null || pendingPaymentAgencyTransaction === void 0 ? void 0 : pendingPaymentAgencyTransaction.execTranResult) === null || _e === void 0 ? void 0 : _e.redirectUrl;
|
|
61
|
+
if (pendingPaymentAgencyTransaction !== undefined
|
|
62
|
+
&& typeof redirectUrl === 'string' && redirectUrl.length > 0) {
|
|
63
|
+
authorizeResult = yield processAuthorizeCreditCard3ds({
|
|
64
|
+
availableChannel,
|
|
65
|
+
pendingPaymentAgencyTransaction
|
|
66
|
+
})({ creditCardService });
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
authorizeResult = yield processAuthorizeCreditCard({
|
|
70
|
+
shopId: shopId,
|
|
71
|
+
shopPass: shopPass,
|
|
72
|
+
returnUrls3ds,
|
|
73
|
+
callbackType3ds,
|
|
74
|
+
orderId: orderId,
|
|
75
|
+
availableChannel: availableChannel,
|
|
76
|
+
object: params.object.paymentMethod,
|
|
77
|
+
processPublishPaymentUrl: options.processPublishPaymentUrl
|
|
78
|
+
})({ creditCardService });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
// アクション保管用のエラーと両方throw(2024-03-27~)
|
|
83
|
+
throw [handleAuthorizeError(error), error];
|
|
84
|
+
// throw handleAuthorizeError(error);
|
|
85
|
+
}
|
|
86
|
+
// クレジットカード詳細情報取得廃止(2024-03-19~)
|
|
87
|
+
// const searchTrade4accountId = options?.searchTrade4accountId === true;
|
|
88
|
+
// if (searchTrade4accountId) {
|
|
89
|
+
// }
|
|
90
|
+
return Object.assign({ accountId: '', paymentMethodId: orderId, entryTranArgs: authorizeResult.entryTranArgs, entryTranResult: authorizeResult.entryTranResult, execTranArgs: authorizeResult.execTranArgs, execTranResult: authorizeResult.execTranResult }, (authorizeResult.secureTran2Result !== undefined) ? { secureTran2Result: authorizeResult.secureTran2Result } : undefined);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
exports.authorize = authorize;
|
|
94
|
+
function processAuthorizeCreditCard(params) {
|
|
95
|
+
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
96
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
var _a, _b, _c, _d, _e, _f;
|
|
98
|
+
// GMOオーソリ取得
|
|
99
|
+
let entryTranArgs;
|
|
100
|
+
let entryTranResult;
|
|
101
|
+
let execTranArgs;
|
|
102
|
+
let execTranResult;
|
|
103
|
+
const creditCard = params.object.creditCard;
|
|
104
|
+
const { cardSeq, memberId } = creditCard;
|
|
105
|
+
if (typeof memberId === 'string' && memberId.length > 0 && typeof cardSeq === 'number') {
|
|
106
|
+
// 決済承認時のuseUsernameAsGMOMemberId判定を廃止(2024-01-04~)
|
|
107
|
+
}
|
|
108
|
+
const { cardNo, cardPass, expire } = creditCard;
|
|
109
|
+
const { token } = creditCard;
|
|
110
|
+
const retUrl = creditCard === null || creditCard === void 0 ? void 0 : creditCard.retUrl;
|
|
111
|
+
// 3DS拡張(2024-01-02~)
|
|
112
|
+
if (params.processPublishPaymentUrl === true && typeof retUrl === 'string' && retUrl.length > 0) {
|
|
113
|
+
let returnUrlObject;
|
|
114
|
+
try {
|
|
115
|
+
returnUrlObject = new URL(retUrl);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw new factory.errors.Argument('object.creditCard.retUrl', 'retUrl unparsable');
|
|
119
|
+
}
|
|
120
|
+
const returnUrlShouldBeIncluded = `${returnUrlObject.origin}${returnUrlObject.pathname}`;
|
|
121
|
+
if (!params.returnUrls3ds.includes(returnUrlShouldBeIncluded)) {
|
|
122
|
+
throw new factory.errors.Argument('object.creditCard.retUrl', 'invalid returnUrl');
|
|
123
|
+
}
|
|
124
|
+
entryTranArgs = {
|
|
125
|
+
shopId: params.shopId,
|
|
126
|
+
shopPass: params.shopPass,
|
|
127
|
+
orderId: params.orderId,
|
|
128
|
+
jobCd: GMO.utils.util.JobCd.Auth,
|
|
129
|
+
amount: (typeof params.object.amount === 'number')
|
|
130
|
+
? params.object.amount
|
|
131
|
+
: params.object.amount.value,
|
|
132
|
+
// siteId: params.availableChannel.credentials?.siteId,
|
|
133
|
+
// sitePass: params.availableChannel.credentials?.sitePass,
|
|
134
|
+
tdFlag: GMO.utils.util.TdFlag.Version2,
|
|
135
|
+
// tdTenantName: '',
|
|
136
|
+
tds2Type: GMO.utils.util.Tds2Type.Error
|
|
137
|
+
};
|
|
138
|
+
entryTranResult = yield repos.creditCardService.entryTran(entryTranArgs);
|
|
139
|
+
execTranArgs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ accessId: entryTranResult.accessId, accessPass: entryTranResult.accessPass, orderId: params.orderId, method: params.object.method, siteId: (_a = params.availableChannel.credentials) === null || _a === void 0 ? void 0 : _a.siteId, sitePass: (_b = params.availableChannel.credentials) === null || _b === void 0 ? void 0 : _b.sitePass, seqMode: GMO.utils.util.SeqMode.Physics, retUrl, callbackType: (params.callbackType3ds === 'GET') ? GMO.utils.util.CallbackType.Get : GMO.utils.util.CallbackType.Post }, (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);
|
|
140
|
+
execTranResult = yield repos.creditCardService.execTran3ds(execTranArgs);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
entryTranArgs = {
|
|
144
|
+
shopId: params.shopId,
|
|
145
|
+
shopPass: params.shopPass,
|
|
146
|
+
orderId: params.orderId,
|
|
147
|
+
jobCd: GMO.utils.util.JobCd.Auth,
|
|
148
|
+
amount: (typeof params.object.amount === 'number')
|
|
149
|
+
? params.object.amount
|
|
150
|
+
: params.object.amount.value,
|
|
151
|
+
siteId: (_c = params.availableChannel.credentials) === null || _c === void 0 ? void 0 : _c.siteId,
|
|
152
|
+
sitePass: (_d = params.availableChannel.credentials) === null || _d === void 0 ? void 0 : _d.sitePass
|
|
153
|
+
};
|
|
154
|
+
entryTranResult = yield repos.creditCardService.entryTran(entryTranArgs);
|
|
155
|
+
execTranArgs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ accessId: entryTranResult.accessId, accessPass: entryTranResult.accessPass, orderId: params.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);
|
|
156
|
+
execTranResult = yield repos.creditCardService.execTran(execTranArgs);
|
|
157
|
+
}
|
|
158
|
+
return { entryTranArgs, entryTranResult, execTranArgs, execTranResult };
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function processAuthorizeCreditCard3ds(params) {
|
|
162
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const { entryTranArgs, entryTranResult, execTranArgs, execTranResult } = params.pendingPaymentAgencyTransaction;
|
|
164
|
+
const { accessId, accessPass } = entryTranResult;
|
|
165
|
+
const secureTran2Result = yield repos.creditCardService.secureTran2({ accessId, accessPass });
|
|
166
|
+
return { entryTranArgs, entryTranResult, execTranArgs, execTranResult, secureTran2Result };
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function handleAuthorizeError(error) {
|
|
170
|
+
debug('handling creditCard authorizeError:', error);
|
|
171
|
+
let handledError = error;
|
|
172
|
+
if (error.name === 'GMOServiceBadRequestError') {
|
|
173
|
+
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
174
|
+
const gmoErrors = error.errors;
|
|
175
|
+
// 流量制限オーバーエラーの場合
|
|
176
|
+
const serviceUnavailableError = gmoErrors.find((gmoError) => { var _a; return (_a = gmoError.info) === null || _a === void 0 ? void 0 : _a.match(/^E92000001|E92000002$/); });
|
|
177
|
+
// オーダーID重複エラーの場合
|
|
178
|
+
const duplicateError = gmoErrors.find((gmoError) => { var _a; return (_a = gmoError.info) === null || _a === void 0 ? void 0 : _a.match(/^E01040010$/); });
|
|
179
|
+
if (serviceUnavailableError !== undefined) {
|
|
180
|
+
handledError = new factory.errors.RateLimitExceeded(serviceUnavailableError.userMessage);
|
|
181
|
+
}
|
|
182
|
+
else if (duplicateError !== undefined) {
|
|
183
|
+
handledError = new factory.errors.AlreadyInUse('payment', ['orderId'], duplicateError.userMessage);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const userMessages = gmoErrors.map((gmoError) => gmoError.userMessage)
|
|
187
|
+
.join(',');
|
|
188
|
+
handledError = new factory.errors.Argument('payment', userMessages);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// その他の場合、なんらかのクライアントエラー
|
|
193
|
+
handledError = new factory.errors.Argument('payment', 'unexpected bad request');
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else if (error.name === 'RequestError') {
|
|
197
|
+
// タイムアウト設定によって中止されたリクエストの場合
|
|
198
|
+
// const uri: string | undefined = error.requestOptions?.uri;
|
|
199
|
+
handledError = new factory.errors.GatewayTimeout(`Gateway Timeout. name:${error.name} type:${error.type} message:${error.message}`);
|
|
200
|
+
}
|
|
201
|
+
else if (error.name === 'AbortError') {
|
|
202
|
+
// タイムアウト設定によって中止されたリクエストの場合
|
|
203
|
+
// AbortErrorハンドリング(2024-03-27~)
|
|
204
|
+
// {
|
|
205
|
+
// "type": "aborted",
|
|
206
|
+
// "message": "The user aborted a request.",
|
|
207
|
+
// "name": "AbortError"
|
|
208
|
+
// }
|
|
209
|
+
handledError = new factory.errors.GatewayTimeout(`Gateway Timeout. name:${error.name} type:${error.type} message:${error.message}`);
|
|
210
|
+
}
|
|
211
|
+
// 決済代行側が4xxを返却した場合
|
|
212
|
+
if (typeof error.code === 'number' && error.code < http_status_1.INTERNAL_SERVER_ERROR) {
|
|
213
|
+
handledError = new factory.errors.Argument('payment', `bad request code:${error.code} message:${error.message}`);
|
|
214
|
+
}
|
|
215
|
+
return handledError;
|
|
216
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as GMO from '@motionpicture/gmo-service';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
interface IProcessAlterTranResult {
|
|
4
|
+
searchTradeArgs?: GMO.factory.credit.ISearchTradeArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
5
|
+
searchTradeResult?: GMO.factory.credit.ISearchTradeResult;
|
|
6
|
+
alterTranArgs?: GMO.factory.credit.IAlterTranArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
7
|
+
alterTranResult?: GMO.factory.credit.IAlterTranResult;
|
|
8
|
+
}
|
|
9
|
+
interface IProcessAlterTranResult4refund {
|
|
10
|
+
searchTradeArgs?: GMO.factory.credit.ISearchTradeArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
11
|
+
searchTradeResult?: GMO.factory.credit.ISearchTradeResult;
|
|
12
|
+
alterTranArgs?: GMO.factory.credit.IAlterTranArgs & GMO.factory.credit.IOptionalSiteArgs;
|
|
13
|
+
alterTranResult?: GMO.factory.credit.IAlterTranResult | factory.action.trade.refund.IAlterTranResultAsError;
|
|
14
|
+
}
|
|
15
|
+
declare function processAlterTranResult2payRecipe(params: {
|
|
16
|
+
processAlterTranResults: IProcessAlterTranResult[];
|
|
17
|
+
project: {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
action: {
|
|
21
|
+
id: string;
|
|
22
|
+
typeOf: factory.actionType;
|
|
23
|
+
};
|
|
24
|
+
}): factory.action.trade.pay.IPayCreditCardRecipe;
|
|
25
|
+
declare function processAlterTranResult2refundRecipe(params: {
|
|
26
|
+
processAlterTranResult: IProcessAlterTranResult4refund;
|
|
27
|
+
project: {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
action: {
|
|
31
|
+
id: string;
|
|
32
|
+
typeOf: factory.actionType;
|
|
33
|
+
};
|
|
34
|
+
}): factory.action.trade.refund.IRefundCreditCardRecipe;
|
|
35
|
+
export { IProcessAlterTranResult, IProcessAlterTranResult4refund, processAlterTranResult2payRecipe, processAlterTranResult2refundRecipe };
|