@chevre/domain 28.0.0-alpha.47 → 28.0.0-alpha.48
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/start/preStart/fixPaymentService.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +1 -15
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +7 -1
- package/lib/chevre/service/assetTransaction/pay/start.js +3 -3
- package/package.json +1 -1
|
@@ -6,5 +6,5 @@ export declare function fixPaymentService(params: factory.assetTransaction.pay.I
|
|
|
6
6
|
product: ProductRepo;
|
|
7
7
|
}) => Promise<{
|
|
8
8
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
9
|
-
paymentService?: Pick<factory.
|
|
9
|
+
paymentService?: Pick<factory.service.paymentService.IService, "availableChannel" | "id" | "serviceOutput" | "serviceType" | "potentialAction"> | undefined;
|
|
10
10
|
}>;
|
|
@@ -33,22 +33,8 @@ function fixPaymentService(params) {
|
|
|
33
33
|
// no op
|
|
34
34
|
// FaceToFaceの場合プロダクトは存在しない
|
|
35
35
|
break;
|
|
36
|
-
//
|
|
36
|
+
// PaymentCardは廃止済
|
|
37
37
|
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
38
|
-
// paymentService = (await repos.product.projectFields(
|
|
39
|
-
// {
|
|
40
|
-
// limit: 1,
|
|
41
|
-
// page: 1,
|
|
42
|
-
// project: { id: { $eq: params.project.id } },
|
|
43
|
-
// typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
44
|
-
// id: { $eq: getPaymentServiceId(params) }
|
|
45
|
-
// },
|
|
46
|
-
// ['availableChannel', 'serviceOutput', 'serviceType', 'potentialAction']
|
|
47
|
-
// // []
|
|
48
|
-
// ) as Pick<factory.product.IProduct, 'availableChannel' | 'id' | 'serviceOutput' | 'serviceType' | 'potentialAction'>[]).shift();
|
|
49
|
-
// if (paymentService === undefined) {
|
|
50
|
-
// throw new factory.errors.NotFound('PaymentService');
|
|
51
|
-
// }
|
|
52
38
|
// break;
|
|
53
39
|
default:
|
|
54
40
|
paymentService = (await repos.paymentService.projectFields({
|
|
@@ -3,6 +3,6 @@ import type { SellerPaymentAcceptedRepo } from '../../../../../repo/sellerPaymen
|
|
|
3
3
|
/**
|
|
4
4
|
* 販売者の対応決済方法検証
|
|
5
5
|
*/
|
|
6
|
-
export declare function validateSeller(params: Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'object' | 'recipient'>): (repos: {
|
|
6
|
+
export declare function validateSeller(params: Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'object' | 'recipient'>, paymentService?: Pick<factory.service.paymentService.IService, 'availableChannel' | 'id' | 'serviceOutput' | 'serviceType' | 'potentialAction'>): (repos: {
|
|
7
7
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
8
8
|
}) => Promise<void>;
|
|
@@ -5,7 +5,7 @@ const factory_1 = require("../../../../../factory");
|
|
|
5
5
|
/**
|
|
6
6
|
* 販売者の対応決済方法検証
|
|
7
7
|
*/
|
|
8
|
-
function validateSeller(params) {
|
|
8
|
+
function validateSeller(params, paymentService) {
|
|
9
9
|
return async (repos) => {
|
|
10
10
|
const sellerId = params.recipient?.id;
|
|
11
11
|
if (typeof sellerId !== 'string') {
|
|
@@ -15,6 +15,12 @@ function validateSeller(params) {
|
|
|
15
15
|
if (typeof paymentMethodType !== 'string') {
|
|
16
16
|
throw new factory_1.factory.errors.ArgumentNull('object.paymentMethod.identifier');
|
|
17
17
|
}
|
|
18
|
+
// 決済方法管理がある場合、決済方法区分の一致検証(2026-10-23~)
|
|
19
|
+
if (paymentService !== undefined) {
|
|
20
|
+
if (paymentMethodType !== paymentService.serviceType.codeValue) {
|
|
21
|
+
throw new factory_1.factory.errors.Argument('object.paymentMethod.identifier', 'paymentMethodType not matched');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
18
24
|
// FaceToFaceの場合、決済方法区分未指定に対応(2023-08-29~)
|
|
19
25
|
if (params.object.typeOf === factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace) {
|
|
20
26
|
if (paymentMethodType.length > 0) {
|
|
@@ -12,15 +12,15 @@ const processAuthorize_1 = require("./start/processAuthorize");
|
|
|
12
12
|
*/
|
|
13
13
|
function start(params, options) {
|
|
14
14
|
return async (repos, settings) => {
|
|
15
|
-
await (0, validateSeller_1.validateSeller)(params)(repos);
|
|
16
|
-
// リソースの対応決済方法検証(2025-12-02~)
|
|
17
|
-
await (0, validateAcceptedPaymentMethodIfNeeded_1.validateAcceptedPaymentMethodIfNeeded)(params)(repos);
|
|
18
15
|
// 決済サービス確認
|
|
19
16
|
const { paymentServiceType, paymentService } = await (0, fixPaymentService_1.fixPaymentService)(params)(repos);
|
|
20
17
|
const informActions = await (0, fixInformAction_1.fixInformAction)({
|
|
21
18
|
paymentService,
|
|
22
19
|
project: { id: params.project.id }
|
|
23
20
|
})(repos);
|
|
21
|
+
await (0, validateSeller_1.validateSeller)(params, paymentService)(repos);
|
|
22
|
+
// リソースの対応決済方法検証(2025-12-02~)
|
|
23
|
+
await (0, validateAcceptedPaymentMethodIfNeeded_1.validateAcceptedPaymentMethodIfNeeded)(params)(repos);
|
|
24
24
|
// 取引開始
|
|
25
25
|
const startParams = (0, factory_1.createStartParams)({
|
|
26
26
|
...params,
|
package/package.json
CHANGED