@chevre/domain 24.0.0-alpha.67 → 24.0.0-alpha.68
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/index.d.ts +1 -1
- package/lib/chevre/index.js +4 -4
- package/lib/chevre/repo/paymentMethod/creditCard.d.ts +1 -1
- package/lib/chevre/repo/paymentMethod/creditCard.js +5 -28
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +3 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +8 -31
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3dsResult2recipe.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCardResult2recipe.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +3 -27
- package/lib/chevre/service/payment/creditCard/factory.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +10 -34
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +9 -33
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +3 -27
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +5 -29
- package/lib/chevre/service/task/deletePerson.js +3 -4
- package/lib/chevre/settings.d.ts +0 -2
- package/package.json +2 -3
package/lib/chevre/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* index module
|
|
3
3
|
*/
|
|
4
4
|
import type * as COAService from '@motionpicture/coa-service';
|
|
5
|
-
import type
|
|
5
|
+
import type { GMO as GMOService } from '@motionpicture/gmo-service';
|
|
6
6
|
import type * as Pecorinoapi from './pecorinoapi';
|
|
7
7
|
import { credentials } from './credentials';
|
|
8
8
|
import * as errorHandler from './errorHandler';
|
package/lib/chevre/index.js
CHANGED
|
@@ -57,10 +57,10 @@ async function loadCOA() {
|
|
|
57
57
|
}
|
|
58
58
|
return COA;
|
|
59
59
|
}
|
|
60
|
-
let
|
|
60
|
+
let cachedGMO;
|
|
61
61
|
async function loadGMO() {
|
|
62
|
-
if (
|
|
63
|
-
|
|
62
|
+
if (cachedGMO === undefined) {
|
|
63
|
+
cachedGMO = (await Promise.resolve().then(() => __importStar(require('@motionpicture/gmo-service')))).GMO;
|
|
64
64
|
}
|
|
65
|
-
return
|
|
65
|
+
return cachedGMO;
|
|
66
66
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
export type IUncheckedCardRaw = factory.paymentMethod.paymentCard.creditCard.IUncheckedCardRaw;
|
|
4
4
|
export type IUncheckedCardTokenized = factory.paymentMethod.paymentCard.creditCard.IUncheckedCardTokenized;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.CreditCardRepo = void 0;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../factory");
|
|
29
6
|
/**
|
|
30
7
|
* クレジットカードリポジトリ
|
|
@@ -70,7 +47,7 @@ class CreditCardRepo {
|
|
|
70
47
|
siteId: this.options.siteId,
|
|
71
48
|
sitePass: this.options.sitePass,
|
|
72
49
|
memberId: memberId,
|
|
73
|
-
seqMode: GMO.utils.util.SeqMode.Physics,
|
|
50
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics,
|
|
74
51
|
cardNo: params.creditCard.cardNo,
|
|
75
52
|
cardPass: params.creditCard.cardPass,
|
|
76
53
|
expire: params.creditCard.expire,
|
|
@@ -82,7 +59,7 @@ class CreditCardRepo {
|
|
|
82
59
|
siteId: this.options.siteId,
|
|
83
60
|
sitePass: this.options.sitePass,
|
|
84
61
|
memberId: memberId,
|
|
85
|
-
seqMode: GMO.utils.util.SeqMode.Physics,
|
|
62
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics,
|
|
86
63
|
cardSeq: saveCardResult.cardSeq
|
|
87
64
|
});
|
|
88
65
|
addedCreditCard = searchCardResults[0];
|
|
@@ -108,7 +85,7 @@ class CreditCardRepo {
|
|
|
108
85
|
siteId: this.options.siteId,
|
|
109
86
|
sitePass: this.options.sitePass,
|
|
110
87
|
memberId: memberId,
|
|
111
|
-
seqMode: GMO.utils.util.SeqMode.Physics,
|
|
88
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics,
|
|
112
89
|
cardSeq: params.cardSeq
|
|
113
90
|
});
|
|
114
91
|
}
|
|
@@ -198,7 +175,7 @@ class CreditCardRepo {
|
|
|
198
175
|
siteId: this.options.siteId,
|
|
199
176
|
sitePass: this.options.sitePass,
|
|
200
177
|
memberId: memberId,
|
|
201
|
-
seqMode: GMO.utils.util.SeqMode.Physics
|
|
178
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics
|
|
202
179
|
// 未削除のものに絞り込む
|
|
203
180
|
})
|
|
204
181
|
.then((results) => results.filter((result) => result.deleteFlag === '0'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 決済取引サービス
|
|
3
3
|
*/
|
|
4
|
-
import type
|
|
4
|
+
import type { GMO } from '@motionpicture/gmo-service';
|
|
5
5
|
import { Settings } from '../../../settings';
|
|
6
6
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
7
7
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -40,7 +40,9 @@ function handleAuthorizeError(error) {
|
|
|
40
40
|
// const uri: string | undefined = error.requestOptions?.uri;
|
|
41
41
|
handledError = new factory_1.factory.errors.GatewayTimeout(`Gateway Timeout. name:${error.name} type:${error.type} message:${error.message}`);
|
|
42
42
|
}
|
|
43
|
-
else if (error.name === 'AbortError'
|
|
43
|
+
else if (error.name === 'AbortError'
|
|
44
|
+
|| error.name === 'TimeoutError' // native AbortSignalの場合(2026-04-07~)
|
|
45
|
+
) {
|
|
44
46
|
// タイムアウト設定によって中止されたリクエストの場合
|
|
45
47
|
// AbortErrorハンドリング(2024-03-27~)
|
|
46
48
|
// {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
3
3
|
import { factory } from '../../../../factory';
|
|
4
4
|
interface ICreditCardPaymentAgencyTransaction {
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.processAuthorizeCreditCard = processAuthorizeCreditCard;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../../../factory");
|
|
29
6
|
const processAuthorizeCreditCardResult2recipe_1 = require("./processAuthorizeCreditCardResult2recipe");
|
|
30
7
|
function processAuthorizeCreditCard(params) {
|
|
@@ -54,15 +31,15 @@ function processAuthorizeCreditCard(params) {
|
|
|
54
31
|
}
|
|
55
32
|
entryTranArgs = {
|
|
56
33
|
shopId, shopPass, orderId,
|
|
57
|
-
jobCd: GMO.utils.util.JobCd.Auth,
|
|
34
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Auth,
|
|
58
35
|
amount: (typeof params.object.amount === 'number')
|
|
59
36
|
? params.object.amount
|
|
60
37
|
: params.object.amount.value,
|
|
61
38
|
// siteId: params.availableChannel.credentials?.siteId,
|
|
62
39
|
// sitePass: params.availableChannel.credentials?.sitePass,
|
|
63
|
-
tdFlag: GMO.utils.util.TdFlag.Version2,
|
|
40
|
+
tdFlag: gmo_service_1.GMO.utils.util.TdFlag.Version2,
|
|
64
41
|
// tdTenantName: '',
|
|
65
|
-
tds2Type: GMO.utils.util.Tds2Type.Error
|
|
42
|
+
tds2Type: gmo_service_1.GMO.utils.util.Tds2Type.Error
|
|
66
43
|
};
|
|
67
44
|
entryTranResult = await repos.creditCardService.entryTran(entryTranArgs);
|
|
68
45
|
execTranArgs = {
|
|
@@ -72,9 +49,9 @@ function processAuthorizeCreditCard(params) {
|
|
|
72
49
|
method: params.object.method,
|
|
73
50
|
siteId: params.availableChannel.credentials?.siteId,
|
|
74
51
|
sitePass: params.availableChannel.credentials?.sitePass,
|
|
75
|
-
seqMode: GMO.utils.util.SeqMode.Physics,
|
|
52
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics,
|
|
76
53
|
retUrl,
|
|
77
|
-
callbackType: (params.callbackType3ds === 'GET') ? GMO.utils.util.CallbackType.Get : GMO.utils.util.CallbackType.Post,
|
|
54
|
+
callbackType: (params.callbackType3ds === 'GET') ? gmo_service_1.GMO.utils.util.CallbackType.Get : gmo_service_1.GMO.utils.util.CallbackType.Post,
|
|
78
55
|
...(typeof cardNo === 'string') ? { cardNo } : undefined,
|
|
79
56
|
...(typeof cardPass === 'string') ? { cardPass } : undefined,
|
|
80
57
|
...(typeof expire === 'string') ? { expire } : undefined,
|
|
@@ -87,7 +64,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
87
64
|
else {
|
|
88
65
|
entryTranArgs = {
|
|
89
66
|
shopId, shopPass, orderId,
|
|
90
|
-
jobCd: GMO.utils.util.JobCd.Auth,
|
|
67
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Auth,
|
|
91
68
|
amount: (typeof params.object.amount === 'number')
|
|
92
69
|
? params.object.amount
|
|
93
70
|
: params.object.amount.value,
|
|
@@ -119,7 +96,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
119
96
|
method: params.object.method,
|
|
120
97
|
siteId: params.availableChannel.credentials?.siteId,
|
|
121
98
|
sitePass: params.availableChannel.credentials?.sitePass,
|
|
122
|
-
seqMode: GMO.utils.util.SeqMode.Physics,
|
|
99
|
+
seqMode: gmo_service_1.GMO.utils.util.SeqMode.Physics,
|
|
123
100
|
...(typeof cardNo === 'string') ? { cardNo } : undefined,
|
|
124
101
|
...(typeof cardPass === 'string') ? { cardPass } : undefined,
|
|
125
102
|
...(typeof expire === 'string') ? { expire } : undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
3
3
|
import { factory } from '../../../../factory';
|
|
4
4
|
interface ICreditCardPaymentAgencyTransaction3ds {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { factory } from '../../../../factory';
|
|
3
3
|
interface IProcessAuthorizeCreditCard3dsResult {
|
|
4
4
|
secureTran2Args?: GMO.factory.service.credit.ISecureTran2Args;
|
|
@@ -1,33 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.authorize = authorize;
|
|
30
|
-
const
|
|
7
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
31
8
|
const debug_1 = __importDefault(require("debug"));
|
|
32
9
|
const factory_1 = require("../../../factory");
|
|
33
10
|
const handleAuthorizeError_1 = require("./authorize/handleAuthorizeError");
|
|
@@ -75,9 +52,8 @@ payTransaction, paymentServiceId, options) {
|
|
|
75
52
|
? settings.gmo.timeoutBackground
|
|
76
53
|
: settings.gmo.timeout;
|
|
77
54
|
debug('processAuthorizeCreditCard processing... executor:', options.executor?.id, 'timeout:', timeout);
|
|
78
|
-
const creditCardService = new GMO.service.Credit({
|
|
79
|
-
endpoint: String(availableChannel.serviceUrl)
|
|
80
|
-
useFetch: settings.gmo.useFetch
|
|
55
|
+
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
56
|
+
endpoint: String(availableChannel.serviceUrl)
|
|
81
57
|
}, { timeout });
|
|
82
58
|
const pendingPaymentAgencyTransaction = options.pendingPaymentAgencyTransaction;
|
|
83
59
|
const redirectUrl = pendingPaymentAgencyTransaction?.execTranResult?.redirectUrl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { GMO } from '@motionpicture/gmo-service';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
3
|
interface IProcessAlterTranResult {
|
|
4
4
|
searchTradeArgs?: GMO.factory.service.credit.ISearchTradeArgs & GMO.factory.service.credit.IOptionalSiteArgs;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.payCreditCard = payCreditCard;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../../factory");
|
|
29
6
|
const onPayActionCompleted_1 = require("../any/onPayActionCompleted");
|
|
30
7
|
const factory_2 = require("./factory");
|
|
@@ -60,9 +37,8 @@ function payCreditCard(params) {
|
|
|
60
37
|
const processAlterTranResults = [];
|
|
61
38
|
let recipe;
|
|
62
39
|
try {
|
|
63
|
-
const creditService = new GMO.service.Credit({
|
|
64
|
-
endpoint: String(availableChannel.serviceUrl)
|
|
65
|
-
useFetch: settings.gmo.useFetch
|
|
40
|
+
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
41
|
+
endpoint: String(availableChannel.serviceUrl)
|
|
66
42
|
}, { timeout: settings.gmo.timeout });
|
|
67
43
|
await Promise.all(payObject.map(async (paymentMethod) => {
|
|
68
44
|
const processAlterTranResult = await processAlterTran({
|
|
@@ -137,28 +113,28 @@ function processAlterTran(params) {
|
|
|
137
113
|
throw new factory_1.factory.errors.ArgumentNull('object.paymentMethod.totalPaymentDue?.value');
|
|
138
114
|
}
|
|
139
115
|
switch (jobCd) {
|
|
140
|
-
case GMO.utils.util.JobCd.Capture:
|
|
141
|
-
case GMO.utils.util.JobCd.Sales:
|
|
116
|
+
case gmo_service_1.GMO.utils.util.JobCd.Capture:
|
|
117
|
+
case gmo_service_1.GMO.utils.util.JobCd.Sales:
|
|
142
118
|
// すでに即時売上済み
|
|
143
119
|
alterTranResult = { accessId, accessPass, forward, approve, tranId, tranDate: '' };
|
|
144
120
|
break;
|
|
145
|
-
case GMO.utils.util.JobCd.Void:
|
|
121
|
+
case gmo_service_1.GMO.utils.util.JobCd.Void:
|
|
146
122
|
// 返品手数料決済の場合を追加(状態が取消であれば即時売上)
|
|
147
123
|
alterTranArgs = {
|
|
148
124
|
shopId, shopPass, accessId, accessPass,
|
|
149
|
-
jobCd: GMO.utils.util.JobCd.Capture,
|
|
125
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Capture,
|
|
150
126
|
amount, // 手数料を指定
|
|
151
127
|
siteId: params.availableChannel.credentials?.siteId,
|
|
152
128
|
sitePass: params.availableChannel.credentials?.sitePass,
|
|
153
|
-
method: GMO.utils.util.Method.Lump // 再オーソリの場合、支払方法指定は必須
|
|
129
|
+
method: gmo_service_1.GMO.utils.util.Method.Lump // 再オーソリの場合、支払方法指定は必須
|
|
154
130
|
};
|
|
155
131
|
alterTranResult = await repos.creditService.alterTran(alterTranArgs);
|
|
156
132
|
break;
|
|
157
|
-
case GMO.utils.util.JobCd.Auth:
|
|
133
|
+
case gmo_service_1.GMO.utils.util.JobCd.Auth:
|
|
158
134
|
alterTranArgs = {
|
|
159
135
|
shopId, shopPass,
|
|
160
136
|
accessId, accessPass,
|
|
161
|
-
jobCd: GMO.utils.util.JobCd.Sales,
|
|
137
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Sales,
|
|
162
138
|
amount: amount,
|
|
163
139
|
siteId: params.availableChannel.credentials?.siteId,
|
|
164
140
|
sitePass: params.availableChannel.credentials?.sitePass
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.refundCreditCard = refundCreditCard;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../../factory");
|
|
29
6
|
const onRefundActionCompletedOrFailed_1 = require("../any/onRefundActionCompletedOrFailed");
|
|
30
7
|
const factory_2 = require("./factory");
|
|
@@ -80,9 +57,8 @@ function refundCreditCard(params
|
|
|
80
57
|
let processAlterTranResult;
|
|
81
58
|
let recipe;
|
|
82
59
|
try {
|
|
83
|
-
const creditService = new GMO.service.Credit({
|
|
84
|
-
endpoint: String(availableChannel.serviceUrl)
|
|
85
|
-
useFetch: settings.gmo.useFetch
|
|
60
|
+
const creditService = new gmo_service_1.GMO.service.Credit({
|
|
61
|
+
endpoint: String(availableChannel.serviceUrl)
|
|
86
62
|
}, { timeout: settings.gmo.timeout });
|
|
87
63
|
processAlterTranResult = await processAlterTran({
|
|
88
64
|
availableChannel,
|
|
@@ -190,7 +166,7 @@ function processAlterTran(params) {
|
|
|
190
166
|
}
|
|
191
167
|
// tranIdが空文字のケース(SPSwrapperで発生)に対応(Voidに対してVoidを実行してしまうので)(2024-04-20~)
|
|
192
168
|
if (tranId === '' && creditCardSalesBefore.tranId === '') {
|
|
193
|
-
if (status === GMO.utils.util.Status.Void) {
|
|
169
|
+
if (status === gmo_service_1.GMO.utils.util.Status.Void) {
|
|
194
170
|
alreadyRefunded = true;
|
|
195
171
|
}
|
|
196
172
|
}
|
|
@@ -200,7 +176,7 @@ function processAlterTran(params) {
|
|
|
200
176
|
// 決済時のGMO取引を確認できれば、既に返金済かどうかを判定
|
|
201
177
|
// tranIdが空文字のケース(SPSwrapperで発生)に対応(Voidに対してVoidを実行してしまうので)(2024-04-20~)
|
|
202
178
|
if (tranId === '' && creditCardSalesBefore === undefined) {
|
|
203
|
-
if (status === GMO.utils.util.Status.Void) {
|
|
179
|
+
if (status === gmo_service_1.GMO.utils.util.Status.Void) {
|
|
204
180
|
alreadyRefunded = true;
|
|
205
181
|
}
|
|
206
182
|
}
|
|
@@ -216,7 +192,7 @@ function processAlterTran(params) {
|
|
|
216
192
|
try {
|
|
217
193
|
alterTranArgs = {
|
|
218
194
|
shopId, shopPass, accessId, accessPass,
|
|
219
|
-
jobCd: GMO.utils.util.JobCd.Void,
|
|
195
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Void,
|
|
220
196
|
siteId: params.availableChannel.credentials?.siteId,
|
|
221
197
|
sitePass: params.availableChannel.credentials?.sitePass
|
|
222
198
|
};
|
|
@@ -228,9 +204,9 @@ function processAlterTran(params) {
|
|
|
228
204
|
if (error.name === 'GMOServiceBadRequestError') {
|
|
229
205
|
if (Array.isArray(error.errors) && error.errors.length === 1
|
|
230
206
|
&& error.errors[0].info === gmoError_1.GMOErrorInfo.JobCodeNotAcceptable) {
|
|
231
|
-
if (status === GMO.utils.util.Status.Authenticated
|
|
232
|
-
|| status === GMO.utils.util.Status.Void
|
|
233
|
-
|| status === GMO.utils.util.Status.Unprocessed // handle UNPROCESSED(2025-02-26~)
|
|
207
|
+
if (status === gmo_service_1.GMO.utils.util.Status.Authenticated
|
|
208
|
+
|| status === gmo_service_1.GMO.utils.util.Status.Void
|
|
209
|
+
|| status === gmo_service_1.GMO.utils.util.Status.Unprocessed // handle UNPROCESSED(2025-02-26~)
|
|
234
210
|
) {
|
|
235
211
|
caughtAlterTranError = error;
|
|
236
212
|
throwsError = false;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.searchGMOTrade = searchGMOTrade;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../../factory");
|
|
29
6
|
const gmoError_1 = require("./gmoError");
|
|
30
7
|
/**
|
|
@@ -32,9 +9,8 @@ const gmoError_1 = require("./gmoError");
|
|
|
32
9
|
* 存在しない場合NotFoundエラー
|
|
33
10
|
*/
|
|
34
11
|
async function searchGMOTrade(params, settings) {
|
|
35
|
-
const creditCardService = new GMO.service.Credit({
|
|
36
|
-
endpoint: String(params.availableChannel.serviceUrl)
|
|
37
|
-
useFetch: settings.gmo.useFetch
|
|
12
|
+
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
13
|
+
endpoint: String(params.availableChannel.serviceUrl)
|
|
38
14
|
}, { timeout: settings.gmo.timeout });
|
|
39
15
|
// 取引状態参照
|
|
40
16
|
let searchTradeResult;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.voidTransaction = voidTransaction;
|
|
27
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
28
5
|
const factory_1 = require("../../../factory");
|
|
29
6
|
const getGMOInfoFromSeller_1 = require("./getGMOInfoFromSeller");
|
|
30
7
|
const gmoError_1 = require("./gmoError");
|
|
@@ -80,9 +57,8 @@ function voidTransaction(params) {
|
|
|
80
57
|
};
|
|
81
58
|
await repos.authorizeInvoiceAction.cancelWithVoid({ typeOf: authorizeInvoiceAction.typeOf, id: authorizeInvoiceAction.id, cancelAction });
|
|
82
59
|
}
|
|
83
|
-
const creditCardService = new GMO.service.Credit({
|
|
84
|
-
endpoint: String(availableChannel.serviceUrl)
|
|
85
|
-
useFetch: settings.gmo.useFetch
|
|
60
|
+
const creditCardService = new gmo_service_1.GMO.service.Credit({
|
|
61
|
+
endpoint: String(availableChannel.serviceUrl)
|
|
86
62
|
}, { timeout: settings.gmo.timeout });
|
|
87
63
|
let searchTradeResult;
|
|
88
64
|
try {
|
|
@@ -112,13 +88,13 @@ function voidTransaction(params) {
|
|
|
112
88
|
}
|
|
113
89
|
}
|
|
114
90
|
// 仮売上であれば取消
|
|
115
|
-
if (searchTradeResult?.status === GMO.utils.util.JobCd.Auth) {
|
|
91
|
+
if (searchTradeResult?.status === gmo_service_1.GMO.utils.util.JobCd.Auth) {
|
|
116
92
|
await creditCardService.alterTran({
|
|
117
93
|
shopId: shopId,
|
|
118
94
|
shopPass: shopPass,
|
|
119
95
|
accessId: searchTradeResult.accessId,
|
|
120
96
|
accessPass: searchTradeResult.accessPass,
|
|
121
|
-
jobCd: GMO.utils.util.JobCd.Void,
|
|
97
|
+
jobCd: gmo_service_1.GMO.utils.util.JobCd.Void,
|
|
122
98
|
siteId: availableChannel.credentials?.siteId,
|
|
123
99
|
sitePass: availableChannel.credentials?.sitePass
|
|
124
100
|
});
|
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.call = call;
|
|
30
|
-
const
|
|
30
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
31
31
|
const debug_1 = __importDefault(require("debug"));
|
|
32
32
|
const factory_1 = require("../../factory");
|
|
33
33
|
const person2username_1 = require("../payment/any/person2username");
|
|
@@ -81,9 +81,8 @@ function call(params) {
|
|
|
81
81
|
creditCardRepo = new creditCard_1.CreditCardRepo({
|
|
82
82
|
siteId: credentials.siteId,
|
|
83
83
|
sitePass: credentials.sitePass,
|
|
84
|
-
cardService: new GMO.service.Card({
|
|
85
|
-
endpoint: credentials.endpoint
|
|
86
|
-
useFetch: settings.gmo.useFetch
|
|
84
|
+
cardService: new gmo_service_1.GMO.service.Card({
|
|
85
|
+
endpoint: credentials.endpoint
|
|
87
86
|
}, {
|
|
88
87
|
timeout: (params.data.executeBackground)
|
|
89
88
|
? settings.gmo.timeout
|
package/lib/chevre/settings.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ interface IOptions {
|
|
|
27
27
|
gmo: {
|
|
28
28
|
timeout: number;
|
|
29
29
|
timeoutBackground: number;
|
|
30
|
-
useFetch: boolean;
|
|
31
30
|
};
|
|
32
31
|
movieticketReserve: ISurfrockSettings;
|
|
33
32
|
useExperimentalFeature: boolean;
|
|
@@ -45,7 +44,6 @@ declare class Settings {
|
|
|
45
44
|
readonly gmo: {
|
|
46
45
|
timeout: number;
|
|
47
46
|
timeoutBackground: number;
|
|
48
|
-
useFetch: boolean;
|
|
49
47
|
};
|
|
50
48
|
readonly movieticketReserve: ISurfrockSettings;
|
|
51
49
|
readonly useExperimentalFeature: boolean;
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@chevre/factory": "6.2.0-alpha.9",
|
|
15
15
|
"@cinerino/sdk": "14.0.0-alpha.6",
|
|
16
16
|
"@motionpicture/coa-service": "9.7.0-alpha.2",
|
|
17
|
-
"@motionpicture/gmo-service": "6.0.0-alpha.
|
|
17
|
+
"@motionpicture/gmo-service": "6.0.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
19
19
|
"@surfrock/sdk": "2.0.0-alpha.2",
|
|
20
20
|
"debug": "^3.2.7",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"csvtojson": "^2.0.10",
|
|
50
50
|
"dependency-cruiser": "17.3.8",
|
|
51
51
|
"eslint": "9.39.2",
|
|
52
|
-
"googleapis": "^85.0.0",
|
|
53
52
|
"jose": "6.0.12",
|
|
54
53
|
"mongodb": "6.20.0",
|
|
55
54
|
"mongoose": "8.23.0",
|
|
@@ -97,5 +96,5 @@
|
|
|
97
96
|
"postversion": "git push origin --tags",
|
|
98
97
|
"prepublishOnly": "npm run clean && npm run build"
|
|
99
98
|
},
|
|
100
|
-
"version": "24.0.0-alpha.
|
|
99
|
+
"version": "24.0.0-alpha.68"
|
|
101
100
|
}
|