@chevre/domain 23.2.0-alpha.6 → 23.2.0-alpha.61
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/acceptedPaymentMethodOffer/adminAcceptedPaymentMethodOffers.ts +25 -17
- package/example/src/chevre/confirmationNumber/testRandomness.ts +49 -0
- package/example/src/chevre/emailMessage/createEmailMessageText.ts +63 -0
- package/example/src/chevre/event/importEventsFromCOAByTitle.ts +2 -2
- package/example/src/chevre/event/unsetSuperEventVideoFormat.ts +30 -0
- package/example/src/chevre/eventSeries/unsetVideoFormat.ts +31 -0
- package/example/src/chevre/{upsertScreeningEventSeriesByVersion.ts → eventSeries/upsertScreeningEventSeriesByVersion.ts} +47 -43
- package/example/src/chevre/{upsertOfferCatalogItemsByIdentifier.ts → offerCatalog/upsertOfferCatalogItemsByIdentifier.ts} +6 -3
- package/example/src/chevre/{upsertOfferCatalogsByIdentifier.ts → offerCatalog/upsertOfferCatalogsByIdentifier.ts} +8 -3
- package/example/src/chevre/{upsertOffersByIdentifier.ts → offers/upsertOffersByIdentifier.ts} +5 -3
- package/example/src/chevre/orderNumber/testRandomness.ts +54 -0
- package/example/src/chevre/place/adminEntranceGates.ts +69 -0
- package/example/src/chevre/place/checkEntranceGatesCount.ts +82 -0
- package/example/src/chevre/place/findRooms.ts +24 -0
- package/example/src/chevre/place/findSections.ts +28 -0
- package/example/src/chevre/place/migrateSectionIdentifier.ts +92 -0
- package/example/src/chevre/place/seatsJson2csv.ts +63 -0
- package/example/src/chevre/place/upsertMovieTheatersByBranchCode.ts +41 -0
- package/example/src/chevre/place/upsertRoomsByBranchCode.ts +40 -0
- package/example/src/chevre/place/upsertSeatSectionsByBranchCode.ts +56 -0
- package/example/src/chevre/reIndex.ts +1 -1
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodReadPermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminAcceptedPaymentMethodWritePermissionIfNotExists.ts +33 -0
- package/example/src/chevre/roles/addAdminMovieReadPermissionIfNotExists.ts +49 -0
- package/example/src/chevre/roles/addAdminRoomReadPermissionIfNotExists.ts +34 -0
- package/example/src/chevre/roles/addAdminRoomWritePermissionIfNotExists.ts +34 -0
- package/example/src/chevre/settings/addOrderNumberSetting.ts +44 -0
- package/example/src/chevre/settings/addTransactionNumberSetting.ts +40 -0
- package/example/src/chevre/transactionNumber/publishByTimestamp.ts +23 -0
- package/example/src/chevre/transactionNumber/testRandomness.ts +42 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +8 -4
- package/lib/chevre/emailMessageBuilder.js +1 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/factory/event.js +11 -5
- package/lib/chevre/factory/transactionNumber.d.ts +19 -0
- package/lib/chevre/factory/transactionNumber.js +54 -0
- package/lib/chevre/repo/acceptedPaymentMethod.d.ts +41 -8
- package/lib/chevre/repo/acceptedPaymentMethod.js +72 -27
- package/lib/chevre/repo/aggregateOffer.d.ts +6 -1
- package/lib/chevre/repo/aggregateOffer.js +11 -3
- package/lib/chevre/repo/aggregateOrder.js +0 -93
- package/lib/chevre/repo/aggregateReservation.d.ts +0 -1
- package/lib/chevre/repo/aggregateReservation.js +0 -2
- package/lib/chevre/repo/confirmationNumber.d.ts +1 -0
- package/lib/chevre/repo/confirmationNumber.js +32 -25
- package/lib/chevre/repo/event.d.ts +3 -18
- package/lib/chevre/repo/event.js +94 -83
- package/lib/chevre/repo/eventOffer.d.ts +8 -0
- package/lib/chevre/repo/eventOffer.js +11 -0
- package/lib/chevre/repo/eventSeries.d.ts +17 -30
- package/lib/chevre/repo/eventSeries.js +204 -146
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +0 -1
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +20 -5
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +2 -8
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +28 -2
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -2
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +40 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +3 -0
- package/lib/chevre/repo/offerCatalog.d.ts +14 -1
- package/lib/chevre/repo/offerCatalog.js +41 -19
- package/lib/chevre/repo/offerCatalogItem.d.ts +10 -1
- package/lib/chevre/repo/offerCatalogItem.js +32 -17
- package/lib/chevre/repo/orderNumber.d.ts +6 -0
- package/lib/chevre/repo/orderNumber.js +110 -35
- package/lib/chevre/repo/place/entranceGate.d.ts +57 -0
- package/lib/chevre/repo/place/entranceGate.js +172 -0
- package/lib/chevre/repo/place/movieTheater.d.ts +40 -3
- package/lib/chevre/repo/place/movieTheater.js +77 -6
- package/lib/chevre/repo/place/screeningRoom.d.ts +60 -31
- package/lib/chevre/repo/place/screeningRoom.js +227 -135
- package/lib/chevre/repo/place/seat.d.ts +47 -45
- package/lib/chevre/repo/place/seat.js +175 -45
- package/lib/chevre/repo/place/section.d.ts +60 -30
- package/lib/chevre/repo/place/section.js +337 -127
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +3 -1
- package/lib/chevre/repo/serviceOutputIdentifier.js +42 -27
- package/lib/chevre/repo/setting.d.ts +1 -1
- package/lib/chevre/repo/setting.js +2 -2
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transactionNumber.d.ts +5 -0
- package/lib/chevre/repo/transactionNumber.js +63 -27
- package/lib/chevre/repository.d.ts +8 -0
- package/lib/chevre/repository.js +16 -0
- package/lib/chevre/service/assetTransaction/fixInformAction.d.ts +3 -0
- package/lib/chevre/service/assetTransaction/fixInformAction.js +3 -0
- package/lib/chevre/service/assetTransaction/pay/cancel.d.ts +12 -0
- package/lib/chevre/service/assetTransaction/pay/cancel.js +25 -0
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +23 -0
- package/lib/chevre/service/assetTransaction/pay/check.js +37 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +24 -0
- package/lib/chevre/service/assetTransaction/pay/confirm.js +72 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.d.ts +18 -0
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +111 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +48 -0
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +164 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +20 -0
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.js +59 -0
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/pay/{account → start/account}/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/{factory.d.ts → start/factory.d.ts} +1 -1
- package/lib/chevre/service/assetTransaction/pay/{factory.js → start/factory.js} +1 -1
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.d.ts → start/preStart/validateAcceptedPaymentMethodIfNeeded.d.ts} +4 -4
- package/lib/chevre/service/assetTransaction/pay/{validateAcceptedPaymentMethodIfNeeded.js → start/preStart/validateAcceptedPaymentMethodIfNeeded.js} +1 -4
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.d.ts +8 -0
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateSeller.js +54 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.d.ts +13 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeAccount.js +49 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +29 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.js +37 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +42 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.js +31 -0
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +60 -0
- package/lib/chevre/service/assetTransaction/pay/start.js +145 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +8 -170
- package/lib/chevre/service/assetTransaction/pay.js +16 -623
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +10 -2
- package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +1 -1
- package/lib/chevre/service/event/processUpdateMovieTheater.js +13 -11
- package/lib/chevre/service/event/saveScreeningEventSeries.js +4 -5
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEvents.js +16 -12
- package/lib/chevre/service/offer/event/authorize/factory.js +9 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +7 -4
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +9 -6
- package/lib/chevre/service/offer/event/searchOffersByIds.js +7 -4
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +7 -1
- package/lib/chevre/service/offer/onEventChanged.js +10 -6
- package/lib/chevre/service/offer/product.js +1 -1
- package/lib/chevre/service/offer.d.ts +5 -0
- package/lib/chevre/service/offer.js +34 -9
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByAggregateOffer.js +53 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +13 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +56 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +15 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +58 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +17 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +75 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +19 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +60 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +20 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +51 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +27 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +100 -0
- package/lib/chevre/service/task/onResourceDeleted.d.ts +6 -0
- package/lib/chevre/service/task/onResourceDeleted.js +168 -0
- package/lib/chevre/service/task/onResourceUpdated.js +205 -42
- package/lib/chevre/service/task/syncResourcesFromCOA.js +4 -2
- package/lib/chevre/service/taskHandler.js +1 -0
- package/package.json +9 -9
- package/example/src/chevre/event/upsertManyScreeningEventByIdentifier.ts +0 -191
- package/example/src/chevre/eventSeries/migrateEventSeriesUnacceptedPaymentMethod.ts +0 -93
- package/example/src/chevre/offers/createSampleOffers.ts +0 -154
- package/example/src/chevre/settings/addSettings.ts +0 -46
- package/lib/chevre/service/eventOld.d.ts +0 -60
- package/lib/chevre/service/eventOld.js +0 -864
- package/lib/chevre/service/task/createEvent/createEvent.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEvent.js +0 -45
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.d.ts +0 -22
- package/lib/chevre/service/task/createEvent/createEventBySchedule/factory.js +0 -188
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.d.ts +0 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule/schedule2events.js +0 -116
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +0 -25
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +0 -107
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +0 -13
- package/lib/chevre/service/task/createEvent/createEventSeries.js +0 -118
- package/lib/chevre/service/task/createEvent.d.ts +0 -6
- package/lib/chevre/service/task/createEvent.js +0 -46
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +0 -45
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +0 -447
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.processAuthorizeCreditCard = processAuthorizeCreditCard;
|
|
13
|
+
const CreditCardPayment = require("../../../payment/creditCard");
|
|
14
|
+
function processAuthorizeCreditCard(params, transaction, paymentServiceId, options) {
|
|
15
|
+
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
var _a;
|
|
17
|
+
yield CreditCardPayment.authorize(Object.assign(Object.assign({}, params), { id: transaction.id }), paymentServiceId, Object.assign({ processPublishPaymentUrl: false, executor: (typeof ((_a = options.executor) === null || _a === void 0 ? void 0 : _a.id) === 'string') ? { id: options.executor.id } : {} }, (options.pendingPaymentAgencyTransaction !== undefined)
|
|
18
|
+
? { pendingPaymentAgencyTransaction: options.pendingPaymentAgencyTransaction }
|
|
19
|
+
: undefined))(repos, settings);
|
|
20
|
+
// ↓discontinue(2024-06-14~)
|
|
21
|
+
// return saveAuthorizeResult({
|
|
22
|
+
// id: transaction.id,
|
|
23
|
+
// update: {
|
|
24
|
+
// 'object.accountId': authorizeResult.accountId,
|
|
25
|
+
// 'object.paymentMethod.accountId': authorizeResult.accountId,
|
|
26
|
+
// 'object.paymentMethod.paymentMethodId': authorizeResult.paymentMethodId,
|
|
27
|
+
// 'object.entryTranArgs': authorizeResult.entryTranArgs,
|
|
28
|
+
// 'object.entryTranResult': authorizeResult.entryTranResult,
|
|
29
|
+
// 'object.execTranArgs': authorizeResult.execTranArgs,
|
|
30
|
+
// 'object.execTranResult': authorizeResult.execTranResult,
|
|
31
|
+
// ...(authorizeResult.secureTran2Result !== undefined)
|
|
32
|
+
// ? { 'object.secureTran2Result': authorizeResult.secureTran2Result }
|
|
33
|
+
// : undefined
|
|
34
|
+
// }
|
|
35
|
+
// })(repos);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as factory from '../../../../factory';
|
|
2
|
+
import { Settings } from '../../../../settings';
|
|
3
|
+
import type { AccountingReportRepo } from '../../../../repo/accountingReport';
|
|
4
|
+
import type { ActionRepo } from '../../../../repo/action';
|
|
5
|
+
import type { AssetTransactionRepo } from '../../../../repo/assetTransaction';
|
|
6
|
+
import type { CredentialsRepo } from '../../../../repo/credentials';
|
|
7
|
+
import type { EventRepo } from '../../../../repo/event';
|
|
8
|
+
import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
9
|
+
import type { PaymentServiceProviderRepo } from '../../../../repo/paymentServiceProvider';
|
|
10
|
+
import type { SellerPaymentAcceptedRepo } from '../../../../repo/sellerPaymentAccepted';
|
|
11
|
+
import type { TaskRepo } from '../../../../repo/task';
|
|
12
|
+
export declare function processAuthorizeMovieTicket(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, transaction: factory.assetTransaction.pay.ITransaction, paymentServiceId: string, options: {
|
|
13
|
+
/**
|
|
14
|
+
* 実行者
|
|
15
|
+
*/
|
|
16
|
+
executor?: {
|
|
17
|
+
/**
|
|
18
|
+
* task ID
|
|
19
|
+
* taskによって実行されている場合値が存在する
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
22
|
+
};
|
|
23
|
+
purpose: {
|
|
24
|
+
/**
|
|
25
|
+
* placeOrder ID
|
|
26
|
+
*/
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
checkedAction: {
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
}): (repos: {
|
|
33
|
+
accountingReport: AccountingReportRepo;
|
|
34
|
+
action: ActionRepo;
|
|
35
|
+
credentials: CredentialsRepo;
|
|
36
|
+
event: EventRepo;
|
|
37
|
+
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
38
|
+
paymentService: PaymentServiceRepo;
|
|
39
|
+
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
40
|
+
assetTransaction: AssetTransactionRepo;
|
|
41
|
+
task: TaskRepo;
|
|
42
|
+
}, settings: Settings) => Promise<factory.assetTransaction.pay.ITransaction>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.processAuthorizeMovieTicket = processAuthorizeMovieTicket;
|
|
13
|
+
const MovieTicketPayment = require("../../../payment/movieTicket");
|
|
14
|
+
function processAuthorizeMovieTicket(params, transaction, paymentServiceId,
|
|
15
|
+
// useCheckByIdentifierIfNotYet: boolean,
|
|
16
|
+
options) {
|
|
17
|
+
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
// const { accountsReceivablesByServiceType } = await MovieTicketPayment.authorize(
|
|
19
|
+
// params, transaction, paymentServiceId, options
|
|
20
|
+
// )(repos, settings);
|
|
21
|
+
yield MovieTicketPayment.authorize(params, transaction, paymentServiceId, options)(repos, settings);
|
|
22
|
+
return transaction;
|
|
23
|
+
// discontinue(2024-12-17~)
|
|
24
|
+
// return saveAuthorizeResult({
|
|
25
|
+
// id: transaction.id,
|
|
26
|
+
// update: {
|
|
27
|
+
// 'object.accountsReceivablesByServiceType': accountsReceivablesByServiceType // 認証レスポンスより計上金額を保管(2023-05-15~)
|
|
28
|
+
// }
|
|
29
|
+
// })(repos);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as factory from '../../../factory';
|
|
2
|
+
import { Settings } from '../../../settings';
|
|
3
|
+
import type { AcceptedPaymentMethodRepo } from '../../../repo/acceptedPaymentMethod';
|
|
4
|
+
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
5
|
+
import type { ActionRepo } from '../../../repo/action';
|
|
6
|
+
import type { AssetTransactionRepo } from '../../../repo/assetTransaction';
|
|
7
|
+
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
8
|
+
import type { EventRepo } from '../../../repo/event';
|
|
9
|
+
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
10
|
+
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
11
|
+
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
12
|
+
import type { PotentialActionRepo } from '../../../repo/potentialAction';
|
|
13
|
+
import type { ProductRepo } from '../../../repo/product';
|
|
14
|
+
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
15
|
+
import type { TaskRepo } from '../../../repo/task';
|
|
16
|
+
import { IPaymentAgencyTransaction } from '../../payment/creditCard';
|
|
17
|
+
export interface IStartOperationRepos {
|
|
18
|
+
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
19
|
+
accountingReport: AccountingReportRepo;
|
|
20
|
+
action: ActionRepo;
|
|
21
|
+
credentials: CredentialsRepo;
|
|
22
|
+
event: EventRepo;
|
|
23
|
+
eventSeries: EventSeriesRepo;
|
|
24
|
+
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
25
|
+
paymentService: PaymentServiceRepo;
|
|
26
|
+
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
27
|
+
potentialAction: PotentialActionRepo;
|
|
28
|
+
product: ProductRepo;
|
|
29
|
+
assetTransaction: AssetTransactionRepo;
|
|
30
|
+
task: TaskRepo;
|
|
31
|
+
}
|
|
32
|
+
export type IStartOperation<T> = (repos: IStartOperationRepos, settings: Settings) => Promise<T>;
|
|
33
|
+
export { IPaymentAgencyTransaction };
|
|
34
|
+
/**
|
|
35
|
+
* 取引開始
|
|
36
|
+
*/
|
|
37
|
+
export declare function start(params: factory.assetTransaction.pay.IStartParamsWithoutDetail & {
|
|
38
|
+
instrument: factory.action.trade.pay.IPlaceOrderRelatedInstrument[];
|
|
39
|
+
}, options: {
|
|
40
|
+
pendingPaymentAgencyTransaction?: IPaymentAgencyTransaction;
|
|
41
|
+
/**
|
|
42
|
+
* 実行者
|
|
43
|
+
*/
|
|
44
|
+
executor?: {
|
|
45
|
+
/**
|
|
46
|
+
* task ID
|
|
47
|
+
* taskによって実行されている場合値が存在する
|
|
48
|
+
*/
|
|
49
|
+
id?: string;
|
|
50
|
+
};
|
|
51
|
+
purpose: {
|
|
52
|
+
/**
|
|
53
|
+
* placeOrder ID
|
|
54
|
+
*/
|
|
55
|
+
id?: string;
|
|
56
|
+
};
|
|
57
|
+
checkedAction: {
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
}): IStartOperation<Pick<factory.assetTransaction.pay.ITransaction, 'id' | 'object'>>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.start = start;
|
|
13
|
+
const factory = require("../../../factory");
|
|
14
|
+
const fixInformAction_1 = require("../fixInformAction");
|
|
15
|
+
const validateAcceptedPaymentMethodIfNeeded_1 = require("./start/preStart/validateAcceptedPaymentMethodIfNeeded");
|
|
16
|
+
const validateSeller_1 = require("./start/preStart/validateSeller");
|
|
17
|
+
const factory_1 = require("./start/factory");
|
|
18
|
+
const processAuthorizeAccount_1 = require("./start/processAuthorizeAccount");
|
|
19
|
+
const processAuthorizeCreditCard_1 = require("./start/processAuthorizeCreditCard");
|
|
20
|
+
const processAuthorizeMovieTicket_1 = require("./start/processAuthorizeMovieTicket");
|
|
21
|
+
/**
|
|
22
|
+
* 取引開始
|
|
23
|
+
*/
|
|
24
|
+
function start(params, options) {
|
|
25
|
+
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
// 金額をfix
|
|
28
|
+
const amount = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.amount;
|
|
29
|
+
if (typeof amount !== 'number') {
|
|
30
|
+
throw new factory.errors.ArgumentNull('object.paymentMethod.amount');
|
|
31
|
+
}
|
|
32
|
+
const transactionNumber = params.transactionNumber;
|
|
33
|
+
if (typeof transactionNumber !== 'string' || transactionNumber.length === 0) {
|
|
34
|
+
throw new factory.errors.ArgumentNull('transactionNumber');
|
|
35
|
+
}
|
|
36
|
+
yield (0, validateSeller_1.validateSeller)(params)(repos);
|
|
37
|
+
// リソースの対応決済方法検証(2025-12-02~)
|
|
38
|
+
yield (0, validateAcceptedPaymentMethodIfNeeded_1.validateAcceptedPaymentMethodIfNeeded)(params)(repos);
|
|
39
|
+
// 決済サービス確認
|
|
40
|
+
const paymentServiceType = (_b = params.object) === null || _b === void 0 ? void 0 : _b.typeOf;
|
|
41
|
+
const paymentService = yield fixPaymentService(params)(repos);
|
|
42
|
+
const informActions = yield (0, fixInformAction_1.fixInformAction)({
|
|
43
|
+
paymentService,
|
|
44
|
+
project: { id: params.project.id }
|
|
45
|
+
})(repos);
|
|
46
|
+
// 取引開始
|
|
47
|
+
let transaction;
|
|
48
|
+
const startParams = (0, factory_1.createStartParams)(Object.assign(Object.assign({}, params), { transactionNumber,
|
|
49
|
+
paymentServiceType,
|
|
50
|
+
amount,
|
|
51
|
+
paymentService,
|
|
52
|
+
informActions }), { checkedAction: options.checkedAction } // 連携(2024-12-13~)
|
|
53
|
+
);
|
|
54
|
+
transaction = yield repos.assetTransaction.start(startParams);
|
|
55
|
+
switch (paymentServiceType) {
|
|
56
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
57
|
+
// 対面決済は特に何もしない
|
|
58
|
+
break;
|
|
59
|
+
case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
60
|
+
transaction = yield (0, processAuthorizeAccount_1.processAuthorizeAccount)(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id))(repos);
|
|
61
|
+
break;
|
|
62
|
+
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
63
|
+
// transaction =
|
|
64
|
+
yield (0, processAuthorizeCreditCard_1.processAuthorizeCreditCard)(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id), Object.assign({ executor: (typeof ((_c = options.executor) === null || _c === void 0 ? void 0 : _c.id) === 'string') ? { id: options.executor.id } : {} }, (options.pendingPaymentAgencyTransaction !== undefined)
|
|
65
|
+
? { pendingPaymentAgencyTransaction: options.pendingPaymentAgencyTransaction }
|
|
66
|
+
: undefined))(repos, settings);
|
|
67
|
+
break;
|
|
68
|
+
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
69
|
+
transaction = yield (0, processAuthorizeMovieTicket_1.processAuthorizeMovieTicket)(params, transaction, String(paymentService === null || paymentService === void 0 ? void 0 : paymentService.id),
|
|
70
|
+
// options.useCheckByIdentifierIfNotYet,
|
|
71
|
+
{
|
|
72
|
+
executor: (typeof ((_d = options.executor) === null || _d === void 0 ? void 0 : _d.id) === 'string') ? { id: options.executor.id } : {},
|
|
73
|
+
purpose: options.purpose,
|
|
74
|
+
checkedAction: options.checkedAction
|
|
75
|
+
})(repos, settings);
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
throw new factory.errors.NotImplemented(`Payment service '${paymentServiceType}' not implemented`);
|
|
79
|
+
}
|
|
80
|
+
return transaction;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function getPaymentServiceId(params) {
|
|
84
|
+
var _a;
|
|
85
|
+
let paymentServiceId = '';
|
|
86
|
+
const paymentServiceType = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf;
|
|
87
|
+
if (typeof params.object.id === 'string' && params.object.id.length > 0) {
|
|
88
|
+
paymentServiceId = params.object.id;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
switch (paymentServiceType) {
|
|
92
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
93
|
+
// 対面決済は特に何もしない
|
|
94
|
+
break;
|
|
95
|
+
case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
96
|
+
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
97
|
+
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
98
|
+
// リクエストでの指定を必須化(2022-04-12~)
|
|
99
|
+
throw new factory.errors.ArgumentNull('object.id');
|
|
100
|
+
default:
|
|
101
|
+
throw new factory.errors.NotImplemented(`Payment service '${paymentServiceType}' not implemented`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return paymentServiceId;
|
|
105
|
+
}
|
|
106
|
+
function fixPaymentService(params) {
|
|
107
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
var _a;
|
|
109
|
+
const paymentServiceType = (_a = params.object) === null || _a === void 0 ? void 0 : _a.typeOf;
|
|
110
|
+
let paymentService;
|
|
111
|
+
switch (paymentServiceType) {
|
|
112
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
113
|
+
// no op
|
|
114
|
+
// FaceToFaceの場合プロダクトは存在しない
|
|
115
|
+
break;
|
|
116
|
+
// PaymentCardの場合、プロダクト検索
|
|
117
|
+
case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
118
|
+
paymentService = (yield repos.product.projectFields({
|
|
119
|
+
limit: 1,
|
|
120
|
+
page: 1,
|
|
121
|
+
project: { id: { $eq: params.project.id } },
|
|
122
|
+
typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
123
|
+
id: { $eq: getPaymentServiceId(params) }
|
|
124
|
+
}, ['availableChannel', 'serviceOutput', 'serviceType', 'potentialAction']
|
|
125
|
+
// []
|
|
126
|
+
)).shift();
|
|
127
|
+
if (paymentService === undefined) {
|
|
128
|
+
throw new factory.errors.NotFound('PaymentService');
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
paymentService = (yield repos.paymentService.projectFields({
|
|
133
|
+
limit: 1,
|
|
134
|
+
page: 1,
|
|
135
|
+
project: { id: { $eq: params.project.id } },
|
|
136
|
+
typeOf: { $eq: paymentServiceType },
|
|
137
|
+
id: { $eq: getPaymentServiceId(params) }
|
|
138
|
+
}, ['availableChannel', 'serviceOutput', 'serviceType', 'potentialAction'])).shift();
|
|
139
|
+
if (paymentService === undefined) {
|
|
140
|
+
throw new factory.errors.NotFound('PaymentService');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return paymentService;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
@@ -1,173 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 決済取引サービス
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import type { CredentialsRepo } from '../../repo/credentials';
|
|
13
|
-
import type { EventRepo } from '../../repo/event';
|
|
14
|
-
import type { EventSeriesRepo } from '../../repo/eventSeries';
|
|
15
|
-
import type { OrderRepo } from '../../repo/order';
|
|
16
|
-
import type { PaymentServiceRepo } from '../../repo/paymentService';
|
|
17
|
-
import type { PaymentServiceProviderRepo } from '../../repo/paymentServiceProvider';
|
|
18
|
-
import type { PotentialActionRepo } from '../../repo/potentialAction';
|
|
19
|
-
import type { ProductRepo } from '../../repo/product';
|
|
20
|
-
import type { SellerPaymentAcceptedRepo } from '../../repo/sellerPaymentAccepted';
|
|
21
|
-
import type { TaskRepo } from '../../repo/task';
|
|
22
|
-
import * as CreditCardPayment from '../payment/creditCard';
|
|
23
|
-
import * as MovieTicketPayment from '../payment/movieTicket';
|
|
24
|
-
export interface IStartOperationRepos {
|
|
25
|
-
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
26
|
-
accountingReport: AccountingReportRepo;
|
|
27
|
-
action: ActionRepo;
|
|
28
|
-
credentials: CredentialsRepo;
|
|
29
|
-
event: EventRepo;
|
|
30
|
-
eventSeries: EventSeriesRepo;
|
|
31
|
-
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
32
|
-
paymentService: PaymentServiceRepo;
|
|
33
|
-
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
34
|
-
potentialAction: PotentialActionRepo;
|
|
35
|
-
product: ProductRepo;
|
|
36
|
-
assetTransaction: AssetTransactionRepo;
|
|
37
|
-
task: TaskRepo;
|
|
38
|
-
}
|
|
39
|
-
export type IStartOperation<T> = (repos: IStartOperationRepos, settings: Settings) => Promise<T>;
|
|
40
|
-
export interface ICancelRepos {
|
|
41
|
-
assetTransaction: AssetTransactionRepo;
|
|
42
|
-
}
|
|
43
|
-
export type ICancelOperation<T> = (repos: ICancelRepos) => Promise<T>;
|
|
44
|
-
export interface IConfirmRepos {
|
|
45
|
-
acceptedOffer: AcceptedOfferRepo;
|
|
46
|
-
action: ActionRepo;
|
|
47
|
-
accountingReport: AccountingReportRepo;
|
|
48
|
-
assetTransaction: AssetTransactionRepo;
|
|
49
|
-
event: EventRepo;
|
|
50
|
-
order: OrderRepo;
|
|
51
|
-
task: TaskRepo;
|
|
52
|
-
}
|
|
53
|
-
export type IConfirmOperation<T> = (repos: IConfirmRepos) => Promise<T>;
|
|
54
|
-
export type IExportTasksOperation<T> = (repos: {
|
|
55
|
-
task: TaskRepo;
|
|
56
|
-
assetTransaction: AssetTransactionRepo;
|
|
57
|
-
}) => Promise<T>;
|
|
58
|
-
export type ICheckOperation<T> = (repos: {
|
|
59
|
-
action: ActionRepo;
|
|
60
|
-
credentials: CredentialsRepo;
|
|
61
|
-
event: EventRepo;
|
|
62
|
-
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
63
|
-
paymentService: PaymentServiceRepo;
|
|
64
|
-
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
65
|
-
}, settings: Settings) => Promise<T>;
|
|
66
|
-
export type IPublishPaymentUrlOperation<T> = (repos: {
|
|
67
|
-
acceptedPaymentMethod: AcceptedPaymentMethodRepo;
|
|
68
|
-
action: ActionRepo;
|
|
69
|
-
event: EventRepo;
|
|
70
|
-
eventSeries: EventSeriesRepo;
|
|
71
|
-
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
72
|
-
paymentService: PaymentServiceRepo;
|
|
73
|
-
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
74
|
-
}, settings: Settings) => Promise<T>;
|
|
75
|
-
export type IPublishPaymentUrlResult = CreditCardPayment.IPaymentAgencyTransaction & {
|
|
76
|
-
paymentMethodId: string;
|
|
77
|
-
paymentUrl: string;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* 決済ロケーション発行
|
|
81
|
-
*/
|
|
82
|
-
export declare function publishPaymentUrl(params: Pick<factory.assetTransaction.pay.IStartParamsWithoutDetail, 'agent' | 'location' | 'project' | 'recipient' | 'transactionNumber' | 'typeOf'> & {
|
|
83
|
-
object: factory.action.accept.pay.IPayObject;
|
|
84
|
-
/**
|
|
85
|
-
* add identifier for an unique index(2025-02-25~)
|
|
86
|
-
*/
|
|
87
|
-
identifier?: string;
|
|
88
|
-
instrument: factory.action.accept.pay.IInstrument[];
|
|
89
|
-
}, options: {
|
|
90
|
-
purposeAsTransaction: {
|
|
91
|
-
id: string;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* 実行者
|
|
95
|
-
*/
|
|
96
|
-
executor?: {
|
|
97
|
-
/**
|
|
98
|
-
* task ID
|
|
99
|
-
* taskによって実行されている場合値が存在する
|
|
100
|
-
*/
|
|
101
|
-
id?: string;
|
|
102
|
-
};
|
|
103
|
-
}): IPublishPaymentUrlOperation<IPublishPaymentUrlResult>;
|
|
104
|
-
/**
|
|
105
|
-
* 決済方法認証
|
|
106
|
-
*/
|
|
107
|
-
export declare function check(params: factory.action.check.paymentMethod.movieTicket.IAttributes): ICheckOperation<{
|
|
108
|
-
result: MovieTicketPayment.ICheckResult;
|
|
109
|
-
}>;
|
|
110
|
-
export import IPaymentAgencyTransaction = CreditCardPayment.IPaymentAgencyTransaction;
|
|
111
|
-
/**
|
|
112
|
-
* 取引開始
|
|
113
|
-
*/
|
|
114
|
-
export declare function start(params: factory.assetTransaction.pay.IStartParamsWithoutDetail & {
|
|
115
|
-
instrument: factory.action.trade.pay.IPlaceOrderRelatedInstrument[];
|
|
116
|
-
}, options: {
|
|
117
|
-
pendingPaymentAgencyTransaction?: CreditCardPayment.IPaymentAgencyTransaction;
|
|
118
|
-
/**
|
|
119
|
-
* 実行者
|
|
120
|
-
*/
|
|
121
|
-
executor?: {
|
|
122
|
-
/**
|
|
123
|
-
* task ID
|
|
124
|
-
* taskによって実行されている場合値が存在する
|
|
125
|
-
*/
|
|
126
|
-
id?: string;
|
|
127
|
-
};
|
|
128
|
-
purpose: {
|
|
129
|
-
/**
|
|
130
|
-
* placeOrder ID
|
|
131
|
-
*/
|
|
132
|
-
id?: string;
|
|
133
|
-
};
|
|
134
|
-
checkedAction: {
|
|
135
|
-
id: string;
|
|
136
|
-
};
|
|
137
|
-
}): IStartOperation<Pick<factory.assetTransaction.pay.ITransaction, 'id' | 'object'>>;
|
|
138
|
-
/**
|
|
139
|
-
* 取引確定
|
|
140
|
-
*/
|
|
141
|
-
export declare function confirm(params: factory.assetTransaction.pay.IConfirmParams & {
|
|
142
|
-
options: {};
|
|
143
|
-
}): IConfirmOperation<void>;
|
|
144
|
-
/**
|
|
145
|
-
* 取引中止
|
|
146
|
-
*/
|
|
147
|
-
export declare function cancel(params: {
|
|
148
|
-
id?: string;
|
|
149
|
-
transactionNumber?: string;
|
|
150
|
-
}): ICancelOperation<void>;
|
|
151
|
-
/**
|
|
152
|
-
* 取引のタスク出力
|
|
153
|
-
*/
|
|
154
|
-
export declare function exportTasksById(params: {
|
|
155
|
-
id: string;
|
|
156
|
-
/**
|
|
157
|
-
* タスク実行日時バッファ
|
|
158
|
-
*/
|
|
159
|
-
runsTasksAfterInSeconds?: number;
|
|
160
|
-
}): IExportTasksOperation<{
|
|
161
|
-
id: string;
|
|
162
|
-
}[]>;
|
|
163
|
-
/**
|
|
164
|
-
* 決済代行取引参照
|
|
165
|
-
*/
|
|
166
|
-
export declare function searchGMOTrade(params: {
|
|
167
|
-
transactionNumber: string;
|
|
168
|
-
}): (repos: {
|
|
169
|
-
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
170
|
-
paymentService: PaymentServiceRepo;
|
|
171
|
-
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
172
|
-
assetTransaction: AssetTransactionRepo;
|
|
173
|
-
}, settings: Settings) => Promise<GMO.factory.credit.ISearchTradeResult>;
|
|
4
|
+
import { cancel } from './pay/cancel';
|
|
5
|
+
import { check } from './pay/check';
|
|
6
|
+
import { confirm } from './pay/confirm';
|
|
7
|
+
import { exportTasksById } from './pay/exportTasksById';
|
|
8
|
+
import { IPublishPaymentUrlResult, publishPaymentUrl } from './pay/publishPaymentUrl';
|
|
9
|
+
import { searchGMOTrade } from './pay/searchGMOTrade';
|
|
10
|
+
import { IPaymentAgencyTransaction, start } from './pay/start';
|
|
11
|
+
export { IPaymentAgencyTransaction, IPublishPaymentUrlResult, cancel, check, confirm, exportTasksById, publishPaymentUrl, searchGMOTrade, start };
|