@chevre/domain 21.27.0-alpha.3 → 21.27.0-alpha.4
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/transaction/processPlaceOrder.ts +1 -2
- package/lib/chevre/service/assetTransaction/pay.d.ts +0 -1
- package/lib/chevre/service/assetTransaction/pay.js +3 -3
- package/lib/chevre/service/payment/any.d.ts +0 -1
- package/lib/chevre/service/payment/any.js +1 -1
- package/lib/chevre/service/payment/creditCard.d.ts +0 -1
- package/lib/chevre/service/payment/creditCard.js +9 -28
- package/package.json +1 -1
|
@@ -116,8 +116,7 @@ async function main() {
|
|
|
116
116
|
options: {
|
|
117
117
|
useCancelPayTransactionOnFailed: false,
|
|
118
118
|
useCheckMovieTicketBeforePay: false,
|
|
119
|
-
useCheckByIdentifierIfNotYet: false
|
|
120
|
-
useSearchTrade4accountId: false
|
|
119
|
+
useCheckByIdentifierIfNotYet: false
|
|
121
120
|
}
|
|
122
121
|
})({
|
|
123
122
|
accountingReport: await chevre.repository.AccountingReport.createInstance(mongoose.connection),
|
|
@@ -94,7 +94,6 @@ export import IPaymentAgencyTransaction = CreditCardPayment.IPaymentAgencyTransa
|
|
|
94
94
|
export declare function start(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, options: {
|
|
95
95
|
useCheckMovieTicketBeforePay: boolean;
|
|
96
96
|
useCheckByIdentifierIfNotYet: boolean;
|
|
97
|
-
searchTrade4accountId: boolean;
|
|
98
97
|
pendingPaymentAgencyTransaction?: CreditCardPayment.IPaymentAgencyTransaction;
|
|
99
98
|
}): IStartOperation<factory.assetTransaction.pay.ITransaction>;
|
|
100
99
|
/**
|
|
@@ -41,7 +41,7 @@ function publishPaymentUrl(params) {
|
|
|
41
41
|
let result;
|
|
42
42
|
switch (paymentServiceType) {
|
|
43
43
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
44
|
-
const authorizeResult = yield CreditCardPayment.authorize(params, paymentServiceId, {
|
|
44
|
+
const authorizeResult = yield CreditCardPayment.authorize(params, paymentServiceId, { processPublishPaymentUrl: true })(repos);
|
|
45
45
|
let paymentUrl;
|
|
46
46
|
// 3DS拡張(2024-01-02~)
|
|
47
47
|
const retUrl = (_c = params.object.paymentMethod.creditCard) === null || _c === void 0 ? void 0 : _c.retUrl;
|
|
@@ -147,7 +147,7 @@ function start(params, options) {
|
|
|
147
147
|
break;
|
|
148
148
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
149
149
|
transaction =
|
|
150
|
-
yield processAuthorizeCreditCard(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id), Object.assign({
|
|
150
|
+
yield processAuthorizeCreditCard(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id), Object.assign({}, (options.pendingPaymentAgencyTransaction !== undefined)
|
|
151
151
|
? { pendingPaymentAgencyTransaction: options.pendingPaymentAgencyTransaction }
|
|
152
152
|
: undefined))(repos);
|
|
153
153
|
break;
|
|
@@ -305,7 +305,7 @@ function processAuthorizeAccount(params, transaction, paymentServiceId) {
|
|
|
305
305
|
}
|
|
306
306
|
function processAuthorizeCreditCard(params, transaction, paymentServiceId, options) {
|
|
307
307
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
308
|
-
const authorizeResult = yield CreditCardPayment.authorize(params, paymentServiceId, Object.assign({ processPublishPaymentUrl: false
|
|
308
|
+
const authorizeResult = yield CreditCardPayment.authorize(params, paymentServiceId, Object.assign({ processPublishPaymentUrl: false }, (options.pendingPaymentAgencyTransaction !== undefined)
|
|
309
309
|
? { pendingPaymentAgencyTransaction: options.pendingPaymentAgencyTransaction }
|
|
310
310
|
: undefined))(repos);
|
|
311
311
|
return saveAuthorizeResult({
|
|
@@ -358,7 +358,7 @@ function authorize(params) {
|
|
|
358
358
|
transactionNumber: transactionNumber,
|
|
359
359
|
location: params.location
|
|
360
360
|
});
|
|
361
|
-
payTransaction = yield PayTransactionService.start(startParams, Object.assign({ useCheckMovieTicketBeforePay: params.options.useCheckMovieTicketBeforePay, useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet
|
|
361
|
+
payTransaction = yield PayTransactionService.start(startParams, Object.assign({ useCheckMovieTicketBeforePay: params.options.useCheckMovieTicketBeforePay, useCheckByIdentifierIfNotYet: params.options.useCheckByIdentifierIfNotYet }, (pendingPaymentAgencyTransaction !== undefined) ? { pendingPaymentAgencyTransaction } : undefined))(repos);
|
|
362
362
|
}
|
|
363
363
|
catch (error) {
|
|
364
364
|
try {
|
|
@@ -24,7 +24,6 @@ type IAuthorizeResult = IPaymentAgencyTransaction & {
|
|
|
24
24
|
* クレジットカード決済承認
|
|
25
25
|
*/
|
|
26
26
|
declare function authorize(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, paymentServiceId: string, options: {
|
|
27
|
-
searchTrade4accountId: boolean;
|
|
28
27
|
pendingPaymentAgencyTransaction?: IPaymentAgencyTransaction;
|
|
29
28
|
/**
|
|
30
29
|
* 決済URL発行処理かどうか
|
|
@@ -25,9 +25,8 @@ const debug = createDebug('chevre-domain:service:payment');
|
|
|
25
25
|
* クレジットカード決済承認
|
|
26
26
|
*/
|
|
27
27
|
function authorize(params, paymentServiceId, options) {
|
|
28
|
-
// tslint:disable-next-line:max-func-body-length
|
|
29
28
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
var _a, _b, _c
|
|
29
|
+
var _a, _b, _c;
|
|
31
30
|
// CreditCard系統の決済方法タイプは動的
|
|
32
31
|
const paymentMethodType = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.identifier;
|
|
33
32
|
if (typeof paymentMethodType !== 'string') {
|
|
@@ -50,7 +49,7 @@ function authorize(params, paymentServiceId, options) {
|
|
|
50
49
|
}
|
|
51
50
|
// GMOオーソリ取得
|
|
52
51
|
let authorizeResult;
|
|
53
|
-
let searchTradeResult;
|
|
52
|
+
// let searchTradeResult: GMO.factory.credit.ISearchTradeResult | undefined;
|
|
54
53
|
try {
|
|
55
54
|
const pendingPaymentAgencyTransaction = options.pendingPaymentAgencyTransaction;
|
|
56
55
|
const redirectUrl = (_c = pendingPaymentAgencyTransaction === null || pendingPaymentAgencyTransaction === void 0 ? void 0 : pendingPaymentAgencyTransaction.execTranResult) === null || _c === void 0 ? void 0 : _c.redirectUrl;
|
|
@@ -78,31 +77,13 @@ function authorize(params, paymentServiceId, options) {
|
|
|
78
77
|
catch (error) {
|
|
79
78
|
throw handleAuthorizeError(error);
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// ベストエフォートでクレジットカード詳細情報を取得
|
|
89
|
-
const startSearchTradeDate = Date.now();
|
|
90
|
-
debug('searchTrade processing...orderId:', orderId, startSearchTradeDate);
|
|
91
|
-
searchTradeResult = yield creditCardService.searchTrade({
|
|
92
|
-
shopId: shopId,
|
|
93
|
-
shopPass: shopPass,
|
|
94
|
-
orderId: orderId,
|
|
95
|
-
siteId: (_d = availableChannel.credentials) === null || _d === void 0 ? void 0 : _d.siteId,
|
|
96
|
-
sitePass: (_e = availableChannel.credentials) === null || _e === void 0 ? void 0 : _e.sitePass
|
|
97
|
-
});
|
|
98
|
-
debug('searchTrade processed. orderId:', orderId, 'execution time:', (Date.now() - startSearchTradeDate), 'ms');
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
// no op
|
|
102
|
-
debug('searchTrade throwed an error. orderId:', orderId, error);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return Object.assign({ accountId: (searchTradeResult !== undefined) ? searchTradeResult.cardNo : '', paymentMethodId: orderId, entryTranArgs: authorizeResult.entryTranArgs, entryTranResult: authorizeResult.entryTranResult, execTranArgs: authorizeResult.execTranArgs, execTranResult: authorizeResult.execTranResult }, (authorizeResult.secureTran2Result !== undefined) ? { secureTran2Result: authorizeResult.secureTran2Result } : undefined);
|
|
80
|
+
// クレジットカード詳細情報取得廃止(2024-03-19~)
|
|
81
|
+
// const searchTrade4accountId = options?.searchTrade4accountId === true;
|
|
82
|
+
// if (searchTrade4accountId) {
|
|
83
|
+
// }
|
|
84
|
+
return Object.assign({
|
|
85
|
+
// accountId: (searchTradeResult !== undefined) ? searchTradeResult.cardNo : '',
|
|
86
|
+
accountId: '', paymentMethodId: orderId, entryTranArgs: authorizeResult.entryTranArgs, entryTranResult: authorizeResult.entryTranResult, execTranArgs: authorizeResult.execTranArgs, execTranResult: authorizeResult.execTranResult }, (authorizeResult.secureTran2Result !== undefined) ? { secureTran2Result: authorizeResult.secureTran2Result } : undefined);
|
|
106
87
|
});
|
|
107
88
|
}
|
|
108
89
|
exports.authorize = authorize;
|
package/package.json
CHANGED