@chevre/domain 24.0.0-alpha.22 → 24.0.0-alpha.23
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/repo/action/authorizeInvoice.d.ts +13 -0
- package/lib/chevre/repo/action/authorizeInvoice.js +13 -0
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.d.ts +19 -4
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +7 -1
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4coa.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +2 -0
- package/lib/chevre/service/offer/event/voidTransaction.js +1 -0
- package/lib/chevre/service/payment/any/authorize.d.ts +2 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +2 -2
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +7 -6
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +3 -3
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.d.ts +7 -6
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +3 -3
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +2 -2
- package/lib/chevre/service/payment/creditCard/authorize.js +2 -2
- package/lib/chevre/service/task/authorizePayment.js +2 -0
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -2
- package/lib/chevre/service/task/voidReserveTransaction.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
2
|
+
import { IActionRecipe, ActionProcessRepo } from './actionProcess';
|
|
3
|
+
export type IAuthorizeInvoiceAction = factory.action.authorize.invoice.IAction & {
|
|
4
|
+
/**
|
|
5
|
+
* 実際存在しない属性だが、ActionProcessRepoのTActionに適合させるために補完
|
|
6
|
+
*/
|
|
7
|
+
recipient: any;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* インボイス承認リポジトリ
|
|
11
|
+
*/
|
|
12
|
+
export declare class AuthorizeInvoiceActionRepo extends ActionProcessRepo<IAuthorizeInvoiceAction, IActionRecipe<factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds>> {
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthorizeInvoiceActionRepo = void 0;
|
|
4
|
+
// import { MONGO_MAX_TIME_MS } from '../settings';
|
|
5
|
+
// import { createSchema, IModel as IActionModel, modelName } from './mongoose/schemas/action';
|
|
6
|
+
// import { createSchema as createRecipeSchema, IModel as IActionRecipeModel, modelName as recipeModelName } from './mongoose/schemas/actionRecipe';
|
|
7
|
+
const actionProcess_1 = require("./actionProcess");
|
|
8
|
+
/**
|
|
9
|
+
* インボイス承認リポジトリ
|
|
10
|
+
*/
|
|
11
|
+
class AuthorizeInvoiceActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
12
|
+
}
|
|
13
|
+
exports.AuthorizeInvoiceActionRepo = AuthorizeInvoiceActionRepo;
|
|
@@ -7,7 +7,7 @@ export { ICancelActionAction };
|
|
|
7
7
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
8
8
|
*/
|
|
9
9
|
type StartableActionType = Exclude<factory.actionType, factory.actionType.AcceptAction | factory.actionType.CheckAction>;
|
|
10
|
-
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket>>;
|
|
10
|
+
type IAvailableActionRecipe = IActionRecipe<Exclude<factory.recipe.RecipeCategory, factory.recipe.RecipeCategory.publishPaymentUrl | factory.recipe.RecipeCategory.checkMovieTicket | factory.recipe.RecipeCategory.acceptCOAOffer | factory.recipe.RecipeCategory.authorizeInvoice | factory.recipe.RecipeCategory.authorizeInvoice3ds>>;
|
|
11
11
|
/**
|
|
12
12
|
* アクションリポジトリ
|
|
13
13
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
5
4
|
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
5
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
6
6
|
import type { EventRepo } from '../../../repo/event';
|
|
7
7
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
8
8
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -11,7 +11,7 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
11
11
|
import * as CreditCardPayment from '../../payment/creditCard';
|
|
12
12
|
export interface IPublishPaymentUrlRepos {
|
|
13
13
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
14
|
-
|
|
14
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
15
15
|
acceptPayAction: AcceptPayActionRepo;
|
|
16
16
|
event: EventRepo;
|
|
17
17
|
eventSeries: EventSeriesRepo;
|
|
@@ -3,6 +3,7 @@ import { Settings } from '../../../../settings';
|
|
|
3
3
|
import type { AccountingReportRepo } from '../../../../repo/accountingReport';
|
|
4
4
|
import type { ActionRepo } from '../../../../repo/action';
|
|
5
5
|
import type { CheckMovieTicketActionRepo } from '../../../../repo/action/checkMovieTicket';
|
|
6
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
6
7
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
7
8
|
import type { CredentialsRepo } from '../../../../repo/credentials';
|
|
8
9
|
import type { EventRepo } from '../../../../repo/event';
|
|
@@ -16,6 +17,7 @@ export interface IProcessAuthorizeOperationRepos {
|
|
|
16
17
|
accountingReport: AccountingReportRepo;
|
|
17
18
|
action: ActionRepo;
|
|
18
19
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
20
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
19
21
|
credentials: CredentialsRepo;
|
|
20
22
|
event: EventRepo;
|
|
21
23
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../../../factory';
|
|
2
2
|
import { Settings } from '../../../../settings';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
5
5
|
import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
6
6
|
import type { PaymentServiceProviderRepo } from '../../../../repo/paymentServiceProvider';
|
|
@@ -21,7 +21,7 @@ export declare function processAuthorizeCreditCard(params: factory.assetTransact
|
|
|
21
21
|
id?: string;
|
|
22
22
|
};
|
|
23
23
|
}): (repos: {
|
|
24
|
-
|
|
24
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
25
25
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
26
26
|
paymentService: PaymentServiceRepo;
|
|
27
27
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
@@ -4,6 +4,7 @@ import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMet
|
|
|
4
4
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
5
5
|
import type { ActionRepo } from '../../../repo/action';
|
|
6
6
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
7
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
7
8
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
8
9
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
9
10
|
import type { EventRepo } from '../../../repo/event';
|
|
@@ -20,6 +21,7 @@ export interface IStartOperationRepos {
|
|
|
20
21
|
accountingReport: AccountingReportRepo;
|
|
21
22
|
action: ActionRepo;
|
|
22
23
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
24
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
23
25
|
credentials: CredentialsRepo;
|
|
24
26
|
event: EventRepo;
|
|
25
27
|
eventSeries: EventSeriesRepo;
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type * as COA from '@motionpicture/coa-service';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
3
|
import { ActionRepo } from '../../../repo/action';
|
|
4
|
+
import { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
4
5
|
import { TaskRepo } from '../../../repo/task';
|
|
5
|
-
|
|
6
|
+
interface ICancelRepos {
|
|
6
7
|
action: ActionRepo;
|
|
7
8
|
reserveService: COA.service.Reserve;
|
|
8
9
|
task: TaskRepo;
|
|
9
|
-
}
|
|
10
|
+
}
|
|
11
|
+
type ICancelOperation<T> = (repos: ICancelRepos) => Promise<T>;
|
|
12
|
+
interface ICancelByAcceptActionRepos {
|
|
13
|
+
action: ActionRepo;
|
|
14
|
+
acceptCOAOfferAction: AcceptCOAOfferActionRepo;
|
|
15
|
+
reserveService: COA.service.Reserve;
|
|
16
|
+
task: TaskRepo;
|
|
17
|
+
}
|
|
18
|
+
type ICancelByAcceptActionOperation<T> = (repos: ICancelByAcceptActionRepos) => Promise<T>;
|
|
19
|
+
/**
|
|
20
|
+
* 興行オファー承認アクションからCOA予約を取り消す
|
|
21
|
+
*/
|
|
10
22
|
declare function cancel(params: {
|
|
11
23
|
action: factory.action.authorize.offer.eventService.IAction;
|
|
12
24
|
}, options: {
|
|
@@ -15,6 +27,9 @@ declare function cancel(params: {
|
|
|
15
27
|
*/
|
|
16
28
|
asyncCancelPendingReservation: boolean;
|
|
17
29
|
}): ICancelOperation<void>;
|
|
30
|
+
/**
|
|
31
|
+
* 興行オファー採用アクションからCOA予約を取り消す
|
|
32
|
+
*/
|
|
18
33
|
declare function cancelByAcceptAction(params: {
|
|
19
34
|
action: factory.action.accept.coaOffer.IAction;
|
|
20
35
|
}, options: {
|
|
@@ -22,5 +37,5 @@ declare function cancelByAcceptAction(params: {
|
|
|
22
37
|
* cancelPendingReservation async?(2025-03-03~)
|
|
23
38
|
*/
|
|
24
39
|
asyncCancelPendingReservation: boolean;
|
|
25
|
-
}):
|
|
26
|
-
export { cancel, cancelByAcceptAction };
|
|
40
|
+
}): ICancelByAcceptActionOperation<void>;
|
|
41
|
+
export { ICancelRepos, ICancelByAcceptActionRepos, cancel, cancelByAcceptAction };
|
|
@@ -27,6 +27,9 @@ exports.cancel = cancel;
|
|
|
27
27
|
exports.cancelByAcceptAction = cancelByAcceptAction;
|
|
28
28
|
const factory = __importStar(require("../../../factory"));
|
|
29
29
|
const cancelReservation_1 = require("../../reserveCOA/cancelReservation");
|
|
30
|
+
/**
|
|
31
|
+
* 興行オファー承認アクションからCOA予約を取り消す
|
|
32
|
+
*/
|
|
30
33
|
function cancel(params, options) {
|
|
31
34
|
return async (repos) => {
|
|
32
35
|
// object.pendingTransactionに連携内容情報が記録されているので、その情報を元に仮予約を取り消す
|
|
@@ -77,9 +80,12 @@ function cancel(params, options) {
|
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* 興行オファー採用アクションからCOA予約を取り消す
|
|
85
|
+
*/
|
|
80
86
|
function cancelByAcceptAction(params, options) {
|
|
81
87
|
return async (repos) => {
|
|
82
|
-
const recipe = await repos.
|
|
88
|
+
const recipe = await repos.acceptCOAOfferAction.findRecipeByAction({
|
|
83
89
|
project: { id: params.action.project.id },
|
|
84
90
|
recipeFor: { id: params.action.id }
|
|
85
91
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as COA from '@motionpicture/coa-service';
|
|
2
2
|
import * as factory from '../../../../factory';
|
|
3
3
|
import { ActionRepo } from '../../../../repo/action';
|
|
4
|
+
import { AcceptCOAOfferActionRepo } from '../../../../repo/action/acceptCOAOffer';
|
|
4
5
|
import { TaskRepo } from '../../../../repo/task';
|
|
5
6
|
declare function processVoidTransaction4coa(params: {
|
|
6
7
|
action: factory.action.authorize.offer.eventService.IAction;
|
|
@@ -23,6 +24,7 @@ declare function processVoidTransactionByAcceptAction4coa(params: {
|
|
|
23
24
|
asyncCancelPendingReservation: boolean;
|
|
24
25
|
}): (repos: {
|
|
25
26
|
action: ActionRepo;
|
|
27
|
+
acceptCOAOfferAction: AcceptCOAOfferActionRepo;
|
|
26
28
|
reserveService: COA.service.Reserve;
|
|
27
29
|
task: TaskRepo;
|
|
28
30
|
}) => Promise<void>;
|
|
@@ -2,6 +2,7 @@ import type * as COA from '@motionpicture/coa-service';
|
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
3
|
import { Settings } from '../../../settings';
|
|
4
4
|
import type { ActionRepo } from '../../../repo/action';
|
|
5
|
+
import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
|
|
5
6
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
6
7
|
import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
|
|
7
8
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
@@ -12,6 +13,7 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
12
13
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
13
14
|
interface IVoidTransactionRepos {
|
|
14
15
|
action: ActionRepo;
|
|
16
|
+
acceptCOAOfferAction: AcceptCOAOfferActionRepo;
|
|
15
17
|
assetTransaction: AssetTransactionRepo;
|
|
16
18
|
stockHolder: StockHolderRepo;
|
|
17
19
|
offerRateLimit: OfferRateLimitRepo;
|
|
@@ -179,6 +179,7 @@ function cancelAcceptActions(params) {
|
|
|
179
179
|
}
|
|
180
180
|
await (0, processVoidTransaction4coa_1.processVoidTransactionByAcceptAction4coa)({ action }, { asyncCancelPendingReservation: true })({
|
|
181
181
|
action: repos.action,
|
|
182
|
+
acceptCOAOfferAction: repos.acceptCOAOfferAction,
|
|
182
183
|
reserveService,
|
|
183
184
|
task: repos.task
|
|
184
185
|
});
|
|
@@ -4,6 +4,7 @@ import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMet
|
|
|
4
4
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
5
5
|
import type { ActionRepo } from '../../../repo/action';
|
|
6
6
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
7
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
7
8
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
8
9
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
9
10
|
import type { ConfirmationNumberRepo } from '../../../repo/confirmationNumber';
|
|
@@ -26,6 +27,7 @@ interface IAuthorizeRepos {
|
|
|
26
27
|
accountingReport: AccountingReportRepo;
|
|
27
28
|
action: ActionRepo;
|
|
28
29
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
30
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
29
31
|
assetTransaction: AssetTransactionRepo;
|
|
30
32
|
authorization: AuthorizationRepo;
|
|
31
33
|
confirmationNumber: ConfirmationNumberRepo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
3
|
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
|
-
import type { ActionRepo } from '../../../repo/action';
|
|
5
4
|
import type { AcceptPayActionRepo } from '../../../repo/action/acceptPay';
|
|
5
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
6
6
|
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
7
7
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
8
8
|
import type { EventRepo } from '../../../repo/event';
|
|
@@ -18,8 +18,8 @@ import type { TransactionNumberRepo } from '../../../repo/transactionNumber';
|
|
|
18
18
|
import * as PayTransactionService from '../../assetTransaction/pay';
|
|
19
19
|
interface IPublishPaymentUrlRepos {
|
|
20
20
|
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
21
|
-
action: ActionRepo;
|
|
22
21
|
acceptPayAction: AcceptPayActionRepo;
|
|
22
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
23
23
|
assetTransaction: AssetTransactionRepo;
|
|
24
24
|
authorization: AuthorizationRepo;
|
|
25
25
|
event: EventRepo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as GMO from '@motionpicture/gmo-service';
|
|
2
|
-
import {
|
|
2
|
+
import { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
3
3
|
import * as factory from '../../../../factory';
|
|
4
4
|
interface ICreditCardPaymentAgencyTransaction {
|
|
5
5
|
entryTranArgs: GMO.factory.credit.IEntryTranArgs;
|
|
@@ -8,6 +8,10 @@ interface ICreditCardPaymentAgencyTransaction {
|
|
|
8
8
|
execTranResult: GMO.factory.credit.IExecTranResult | GMO.factory.credit.IExecTran3dsResult;
|
|
9
9
|
secureTran2Result?: never;
|
|
10
10
|
}
|
|
11
|
+
interface IProcessAuthorizeCreditCardRepos {
|
|
12
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
13
|
+
creditCardService: GMO.service.Credit;
|
|
14
|
+
}
|
|
11
15
|
declare function processAuthorizeCreditCard(params: {
|
|
12
16
|
project: {
|
|
13
17
|
id: string;
|
|
@@ -26,8 +30,5 @@ declare function processAuthorizeCreditCard(params: {
|
|
|
26
30
|
* 決済URL発行処理かどうか
|
|
27
31
|
*/
|
|
28
32
|
processPublishPaymentUrl: boolean;
|
|
29
|
-
}): (repos:
|
|
30
|
-
|
|
31
|
-
creditCardService: GMO.service.Credit;
|
|
32
|
-
}) => Promise<ICreditCardPaymentAgencyTransaction>;
|
|
33
|
-
export { ICreditCardPaymentAgencyTransaction, processAuthorizeCreditCard };
|
|
33
|
+
}): (repos: IProcessAuthorizeCreditCardRepos) => Promise<ICreditCardPaymentAgencyTransaction>;
|
|
34
|
+
export { ICreditCardPaymentAgencyTransaction, IProcessAuthorizeCreditCardRepos, processAuthorizeCreditCard };
|
|
@@ -109,7 +109,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
109
109
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
110
110
|
};
|
|
111
111
|
// add action(2024-06-12~)
|
|
112
|
-
const action = await repos.
|
|
112
|
+
const action = await repos.authorizeInvoiceAction.start(actionAttributes, { recipe });
|
|
113
113
|
try {
|
|
114
114
|
entryTranResult = await repos.creditCardService.entryTran(entryTranArgs);
|
|
115
115
|
execTranArgs = {
|
|
@@ -131,7 +131,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
131
131
|
}
|
|
132
132
|
catch (error) {
|
|
133
133
|
try {
|
|
134
|
-
await repos.
|
|
134
|
+
await repos.authorizeInvoiceAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
|
|
135
135
|
}
|
|
136
136
|
catch (__) {
|
|
137
137
|
// 失敗したら仕方ない
|
|
@@ -146,7 +146,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
const actionResult = {};
|
|
149
|
-
await repos.
|
|
149
|
+
await repos.authorizeInvoiceAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
150
150
|
}
|
|
151
151
|
return { entryTranArgs, entryTranResult, execTranArgs, execTranResult };
|
|
152
152
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as GMO from '@motionpicture/gmo-service';
|
|
2
|
-
import {
|
|
2
|
+
import { AuthorizeInvoiceActionRepo } from '../../../../repo/action/authorizeInvoice';
|
|
3
3
|
import * as factory from '../../../../factory';
|
|
4
4
|
interface ICreditCardPaymentAgencyTransaction3ds {
|
|
5
5
|
entryTranArgs: GMO.factory.credit.IEntryTranArgs;
|
|
@@ -8,6 +8,10 @@ interface ICreditCardPaymentAgencyTransaction3ds {
|
|
|
8
8
|
execTranResult: GMO.factory.credit.IExecTranResult | GMO.factory.credit.IExecTran3dsResult;
|
|
9
9
|
secureTran2Result: GMO.factory.credit.ISecureTran2Result;
|
|
10
10
|
}
|
|
11
|
+
interface IProcessAuthorizeCreditCard3dsRepos {
|
|
12
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
13
|
+
creditCardService: GMO.service.Credit;
|
|
14
|
+
}
|
|
11
15
|
declare function processAuthorizeCreditCard3ds(params: {
|
|
12
16
|
project: {
|
|
13
17
|
id: string;
|
|
@@ -17,8 +21,5 @@ declare function processAuthorizeCreditCard3ds(params: {
|
|
|
17
21
|
};
|
|
18
22
|
availableChannel: Pick<factory.serviceChannel.IServiceChannelCreditCard, 'credentials' | 'serviceUrl'>;
|
|
19
23
|
pendingPaymentAgencyTransaction: Pick<ICreditCardPaymentAgencyTransaction3ds, 'entryTranArgs' | 'entryTranResult' | 'execTranArgs' | 'execTranResult'>;
|
|
20
|
-
}): (repos:
|
|
21
|
-
|
|
22
|
-
creditCardService: GMO.service.Credit;
|
|
23
|
-
}) => Promise<ICreditCardPaymentAgencyTransaction3ds>;
|
|
24
|
-
export { ICreditCardPaymentAgencyTransaction3ds, processAuthorizeCreditCard3ds };
|
|
24
|
+
}): (repos: IProcessAuthorizeCreditCard3dsRepos) => Promise<ICreditCardPaymentAgencyTransaction3ds>;
|
|
25
|
+
export { IProcessAuthorizeCreditCard3dsRepos, ICreditCardPaymentAgencyTransaction3ds, processAuthorizeCreditCard3ds };
|
|
@@ -47,13 +47,13 @@ function processAuthorizeCreditCard3ds(params) {
|
|
|
47
47
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
48
48
|
};
|
|
49
49
|
// add action(2024-06-12~)
|
|
50
|
-
const action = await repos.
|
|
50
|
+
const action = await repos.authorizeInvoiceAction.start(actionAttributes, { recipe });
|
|
51
51
|
try {
|
|
52
52
|
secureTran2Result = await repos.creditCardService.secureTran2(secureTran2Args);
|
|
53
53
|
}
|
|
54
54
|
catch (error) {
|
|
55
55
|
try {
|
|
56
|
-
await repos.
|
|
56
|
+
await repos.authorizeInvoiceAction.giveUp({ typeOf: actionAttributes.typeOf, id: action.id, error });
|
|
57
57
|
}
|
|
58
58
|
catch (__) {
|
|
59
59
|
// 失敗したら仕方ない
|
|
@@ -65,7 +65,7 @@ function processAuthorizeCreditCard3ds(params) {
|
|
|
65
65
|
result: { secureTran2Args, secureTran2Result }
|
|
66
66
|
});
|
|
67
67
|
const actionResult = {};
|
|
68
|
-
await repos.
|
|
68
|
+
await repos.authorizeInvoiceAction.completeWithVoid({ typeOf: actionAttributes.typeOf, id: action.id, result: actionResult, recipe });
|
|
69
69
|
return { entryTranArgs, entryTranResult, execTranArgs, execTranResult, secureTran2Result };
|
|
70
70
|
};
|
|
71
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import { Settings } from '../../../settings';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AuthorizeInvoiceActionRepo } from '../../../repo/action/authorizeInvoice';
|
|
4
4
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
5
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
@@ -41,7 +41,7 @@ payTransaction: IPayTransactionAsAuthorizeInvoiceAction, paymentServiceId: strin
|
|
|
41
41
|
id?: string;
|
|
42
42
|
};
|
|
43
43
|
}): (repos: {
|
|
44
|
-
|
|
44
|
+
authorizeInvoiceAction: AuthorizeInvoiceActionRepo;
|
|
45
45
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
46
46
|
paymentService: PaymentServiceRepo;
|
|
47
47
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
@@ -88,7 +88,7 @@ payTransaction, paymentServiceId, options) {
|
|
|
88
88
|
payTransaction: { id: payTransaction.id },
|
|
89
89
|
availableChannel,
|
|
90
90
|
pendingPaymentAgencyTransaction
|
|
91
|
-
})({
|
|
91
|
+
})({ authorizeInvoiceAction: repos.authorizeInvoiceAction, creditCardService });
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
94
|
authorizeResult = await (0, processAuthorizeCreditCard_1.processAuthorizeCreditCard)({
|
|
@@ -97,7 +97,7 @@ payTransaction, paymentServiceId, options) {
|
|
|
97
97
|
shopId, shopPass, returnUrls3ds, callbackType3ds, orderId, availableChannel,
|
|
98
98
|
object: payTransaction.object.paymentMethod,
|
|
99
99
|
processPublishPaymentUrl: options.processPublishPaymentUrl
|
|
100
|
-
})({
|
|
100
|
+
})({ authorizeInvoiceAction: repos.authorizeInvoiceAction, creditCardService });
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
catch (error) {
|
|
@@ -29,6 +29,7 @@ const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
|
29
29
|
const accountingReport_1 = require("../../repo/accountingReport");
|
|
30
30
|
const action_1 = require("../../repo/action");
|
|
31
31
|
const checkMovieTicket_1 = require("../../repo/action/checkMovieTicket");
|
|
32
|
+
const authorizeInvoice_1 = require("../../repo/action/authorizeInvoice");
|
|
32
33
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
33
34
|
const authorization_1 = require("../../repo/authorization");
|
|
34
35
|
const confirmationNumber_1 = require("../../repo/confirmationNumber");
|
|
@@ -78,6 +79,7 @@ function call(params) {
|
|
|
78
79
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
79
80
|
action: actionRepo,
|
|
80
81
|
checkMovieTicketAction: new checkMovieTicket_1.CheckMovieTicketActionRepo(connection),
|
|
82
|
+
authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
|
|
81
83
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
82
84
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
83
85
|
confirmationNumber: new confirmationNumber_1.ConfirmationNumberRepo({ connection }),
|
|
@@ -26,8 +26,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.call = call;
|
|
27
27
|
const factory = __importStar(require("../../factory"));
|
|
28
28
|
const acceptedPaymentMethod_1 = require("../../repo/acceptedPaymentMethod");
|
|
29
|
-
|
|
29
|
+
// import { ActionRepo } from '../../repo/action';
|
|
30
30
|
const acceptPay_1 = require("../../repo/action/acceptPay");
|
|
31
|
+
const authorizeInvoice_1 = require("../../repo/action/authorizeInvoice");
|
|
31
32
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
32
33
|
const authorization_1 = require("../../repo/authorization");
|
|
33
34
|
const event_1 = require("../../repo/event");
|
|
@@ -64,8 +65,9 @@ function call(params) {
|
|
|
64
65
|
sameAs: { id: params.id }
|
|
65
66
|
})({
|
|
66
67
|
acceptedPaymentMethod: new acceptedPaymentMethod_1.AcceptedPaymentMethodRepo(connection),
|
|
67
|
-
action: new
|
|
68
|
+
// action: new ActionRepo(connection),
|
|
68
69
|
acceptPayAction: actionRepo,
|
|
70
|
+
authorizeInvoiceAction: new authorizeInvoice_1.AuthorizeInvoiceActionRepo(connection),
|
|
69
71
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
70
72
|
authorization: new authorization_1.AuthorizationRepo(connection),
|
|
71
73
|
event: new event_1.EventRepo(connection),
|
|
@@ -28,6 +28,7 @@ const COA = __importStar(require("@motionpicture/coa-service"));
|
|
|
28
28
|
const factory = __importStar(require("../../factory"));
|
|
29
29
|
const voidTransaction_1 = require("../offer/event/voidTransaction");
|
|
30
30
|
const action_1 = require("../../repo/action");
|
|
31
|
+
const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
|
|
31
32
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
32
33
|
const orderInTransaction_1 = require("../../repo/orderInTransaction");
|
|
33
34
|
const offer_1 = require("../../repo/rateLimit/offer");
|
|
@@ -80,6 +81,7 @@ function call(params) {
|
|
|
80
81
|
sameAs: { id: params.id }
|
|
81
82
|
})({
|
|
82
83
|
action: new action_1.ActionRepo(connection),
|
|
84
|
+
acceptCOAOfferAction: new acceptCOAOffer_1.AcceptCOAOfferActionRepo(connection),
|
|
83
85
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
84
86
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
|
|
85
87
|
offerRateLimit: new offer_1.OfferRateLimitRepo(redisClient),
|
package/package.json
CHANGED