@chevre/domain 21.34.0-alpha.11 → 21.34.0-alpha.12
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/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +5 -0
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +45 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.d.ts +13 -0
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.js +24 -0
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +2 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as GMO from '@motionpicture/gmo-service';
|
|
2
|
+
import { MongoRepository as ActionRepo } from '../../../../repo/action';
|
|
2
3
|
import * as factory from '../../../../factory';
|
|
3
4
|
interface ICreditCardPaymentAgencyTransaction3ds {
|
|
4
5
|
entryTranArgs: GMO.factory.credit.IEntryTranArgs;
|
|
@@ -8,9 +9,13 @@ interface ICreditCardPaymentAgencyTransaction3ds {
|
|
|
8
9
|
secureTran2Result: GMO.factory.credit.ISecureTran2Result;
|
|
9
10
|
}
|
|
10
11
|
declare function processAuthorizeCreditCard3ds(params: {
|
|
12
|
+
project: {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
11
15
|
availableChannel: factory.product.IAvailableChannel;
|
|
12
16
|
pendingPaymentAgencyTransaction: Pick<ICreditCardPaymentAgencyTransaction3ds, 'entryTranArgs' | 'entryTranResult' | 'execTranArgs' | 'execTranResult'>;
|
|
13
17
|
}): (repos: {
|
|
18
|
+
action: ActionRepo;
|
|
14
19
|
creditCardService: GMO.service.Credit;
|
|
15
20
|
}) => Promise<ICreditCardPaymentAgencyTransaction3ds>;
|
|
16
21
|
export { ICreditCardPaymentAgencyTransaction3ds, processAuthorizeCreditCard3ds };
|
|
@@ -10,11 +10,55 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.processAuthorizeCreditCard3ds = void 0;
|
|
13
|
+
const factory = require("../../../../factory");
|
|
14
|
+
const settings_1 = require("../../../../settings");
|
|
15
|
+
const processAuthorizeCreditCard3dsResult2recipe_1 = require("./processAuthorizeCreditCard3dsResult2recipe");
|
|
13
16
|
function processAuthorizeCreditCard3ds(params) {
|
|
14
17
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
15
18
|
const { entryTranArgs, entryTranResult, execTranArgs, execTranResult } = params.pendingPaymentAgencyTransaction;
|
|
16
19
|
const { accessId, accessPass } = entryTranResult;
|
|
17
|
-
const
|
|
20
|
+
const secureTran2Args = { accessId, accessPass };
|
|
21
|
+
let secureTran2Result;
|
|
22
|
+
let action;
|
|
23
|
+
let recipe = (0, processAuthorizeCreditCard3dsResult2recipe_1.processAuthorizeCreditCard3dsResult2recipe)({
|
|
24
|
+
project: { id: params.project.id },
|
|
25
|
+
result: { secureTran2Args }
|
|
26
|
+
});
|
|
27
|
+
const actionAttributes = {
|
|
28
|
+
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
29
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
30
|
+
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
31
|
+
object: {
|
|
32
|
+
paymentMethodId: entryTranArgs.orderId,
|
|
33
|
+
typeOf: 'Invoice'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
// add action(2024-06-12~)
|
|
37
|
+
if (settings_1.USE_EXPERIMENTAL_FEATURE) {
|
|
38
|
+
action = (yield repos.action.start(actionAttributes, { recipe }));
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
secureTran2Result = yield repos.creditCardService.secureTran2(secureTran2Args);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (action !== undefined) {
|
|
45
|
+
try {
|
|
46
|
+
yield repos.action.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
|
|
47
|
+
}
|
|
48
|
+
catch (__) {
|
|
49
|
+
// 失敗したら仕方ない
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
if (action !== undefined) {
|
|
55
|
+
recipe = (0, processAuthorizeCreditCard3dsResult2recipe_1.processAuthorizeCreditCard3dsResult2recipe)({
|
|
56
|
+
project: { id: params.project.id },
|
|
57
|
+
result: { secureTran2Args, secureTran2Result }
|
|
58
|
+
});
|
|
59
|
+
const actionResult = {};
|
|
60
|
+
yield repos.action.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
61
|
+
}
|
|
18
62
|
return { entryTranArgs, entryTranResult, execTranArgs, execTranResult, secureTran2Result };
|
|
19
63
|
});
|
|
20
64
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as GMO from '@motionpicture/gmo-service';
|
|
2
|
+
import * as factory from '../../../../factory';
|
|
3
|
+
interface IProcessAuthorizeCreditCard3dsResult {
|
|
4
|
+
secureTran2Args?: GMO.factory.credit.ISecureTran2Args;
|
|
5
|
+
secureTran2Result?: GMO.factory.credit.ISecureTran2Result;
|
|
6
|
+
}
|
|
7
|
+
declare function processAuthorizeCreditCard3dsResult2recipe(params: {
|
|
8
|
+
project: {
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
result: IProcessAuthorizeCreditCard3dsResult;
|
|
12
|
+
}): factory.action.authorize.invoice.IAuthorizeInvoice3dsRecipe;
|
|
13
|
+
export { processAuthorizeCreditCard3dsResult2recipe };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAuthorizeCreditCard3dsResult2recipe = void 0;
|
|
4
|
+
const factory = require("../../../../factory");
|
|
5
|
+
function processAuthorizeCreditCard3dsResult2recipe(params) {
|
|
6
|
+
const { project, result } = params;
|
|
7
|
+
const { secureTran2Args, secureTran2Result } = result;
|
|
8
|
+
return {
|
|
9
|
+
project: { id: project.id, typeOf: factory.organizationType.Project },
|
|
10
|
+
typeOf: 'Recipe',
|
|
11
|
+
recipeCategory: factory.recipe.RecipeCategory.authorizeInvoice3ds,
|
|
12
|
+
step: [{
|
|
13
|
+
typeOf: 'HowToSection',
|
|
14
|
+
itemListElement: [
|
|
15
|
+
{
|
|
16
|
+
typeOf: 'HowToStep',
|
|
17
|
+
identifier: factory.recipe.StepIdentifier.secureTran2,
|
|
18
|
+
itemListElement: [Object.assign(Object.assign({ typeOf: 'HowToDirection' }, (secureTran2Args !== undefined) ? { beforeMedia: secureTran2Args } : undefined), (secureTran2Result !== undefined) ? { afterMedia: secureTran2Result } : undefined)]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.processAuthorizeCreditCard3dsResult2recipe = processAuthorizeCreditCard3dsResult2recipe;
|
package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ declare function processAuthorizeCreditCardResult2recipe(params: {
|
|
|
11
11
|
id: string;
|
|
12
12
|
};
|
|
13
13
|
result: IProcessAuthorizeCreditCardResult;
|
|
14
|
-
}): factory.action.authorize.invoice.
|
|
14
|
+
}): factory.action.authorize.invoice.IAuthorizeInvoiceRecipe;
|
|
15
15
|
export { processAuthorizeCreditCardResult2recipe };
|
|
@@ -63,9 +63,10 @@ function authorize(params, paymentServiceId, options) {
|
|
|
63
63
|
if (pendingPaymentAgencyTransaction !== undefined
|
|
64
64
|
&& typeof redirectUrl === 'string' && redirectUrl.length > 0) {
|
|
65
65
|
authorizeResult = yield (0, processAuthorizeCreditCard3ds_1.processAuthorizeCreditCard3ds)({
|
|
66
|
+
project: { id: params.project.id },
|
|
66
67
|
availableChannel,
|
|
67
68
|
pendingPaymentAgencyTransaction
|
|
68
|
-
})({ creditCardService });
|
|
69
|
+
})({ action: repos.action, creditCardService });
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
71
72
|
authorizeResult = yield (0, processAuthorizeCreditCard_1.processAuthorizeCreditCard)({
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.374.0-alpha.
|
|
13
|
+
"@chevre/factory": "4.374.0-alpha.20",
|
|
14
14
|
"@cinerino/sdk": "7.1.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@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": "21.34.0-alpha.
|
|
113
|
+
"version": "21.34.0-alpha.12"
|
|
114
114
|
}
|