@chevre/domain 24.0.0-alpha.40 → 24.0.0-alpha.41
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/accountTitle.d.ts +3 -3
- package/lib/chevre/repo/action/pay.d.ts +9 -0
- package/lib/chevre/repo/action/pay.js +13 -0
- package/lib/chevre/repo/action/refund.d.ts +9 -0
- package/lib/chevre/repo/action/refund.js +13 -0
- package/lib/chevre/repo/action.d.ts +3 -3
- package/lib/chevre/repo/additionalProperty.js +2 -2
- package/lib/chevre/repo/advanceBookingRequirement.d.ts +1 -3
- package/lib/chevre/repo/advanceBookingRequirement.js +2 -2
- package/lib/chevre/repo/aggregateOffer.d.ts +5 -9
- package/lib/chevre/repo/aggregateOffer.js +3 -3
- package/lib/chevre/repo/assetTransaction.d.ts +3 -3
- package/lib/chevre/repo/assetTransaction.js +12 -6
- package/lib/chevre/repo/categoryCode.d.ts +4 -6
- package/lib/chevre/repo/categoryCode.js +2 -2
- package/lib/chevre/repo/comment.d.ts +3 -3
- package/lib/chevre/repo/creativeWork.d.ts +3 -3
- package/lib/chevre/repo/creativeWork.js +3 -3
- package/lib/chevre/repo/customer.d.ts +3 -3
- package/lib/chevre/repo/customer.js +2 -2
- package/lib/chevre/repo/emailMessage.js +1 -1
- package/lib/chevre/repo/event.d.ts +6 -6
- package/lib/chevre/repo/event.js +10 -4
- package/lib/chevre/repo/eventSeries.d.ts +6 -6
- package/lib/chevre/repo/eventSeries.js +2 -2
- package/lib/chevre/repo/identity.d.ts +4 -6
- package/lib/chevre/repo/identityProvider.d.ts +4 -6
- package/lib/chevre/repo/identityProvider.js +2 -2
- package/lib/chevre/repo/issuer.d.ts +3 -3
- package/lib/chevre/repo/issuer.js +3 -3
- package/lib/chevre/repo/member.d.ts +3 -3
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +3 -3
- package/lib/chevre/repo/merchantReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/acceptedPaymentMethod.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/advanceBookingRequirement.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/aggregateOrder.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/civicStructure.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/eventOffer.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/identity.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/identityProvider.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/issuer.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/member/global.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/message.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/movieTicketTypes.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/note.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/paymentServiceChannel.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/pendingReservation.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/pendingReservationAggregate.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/potentialAction.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/reserveInterface.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/schedule.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/sellerReturnPolicy.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/service/availableHour.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/transactionNumber.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +2 -2
- package/lib/chevre/repo/mongoose/schemas/webSite.d.ts +2 -2
- package/lib/chevre/repo/movieTicketType.d.ts +1 -3
- package/lib/chevre/repo/movieTicketType.js +2 -2
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +1 -3
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +1 -3
- package/lib/chevre/repo/offerCatalog.d.ts +3 -3
- package/lib/chevre/repo/offerCatalog.js +5 -4
- package/lib/chevre/repo/offerCatalogItem.js +4 -4
- package/lib/chevre/repo/offerItemCondition.js +2 -2
- package/lib/chevre/repo/order.d.ts +3 -3
- package/lib/chevre/repo/ownershipInfo.d.ts +3 -3
- package/lib/chevre/repo/passport.js +1 -1
- package/lib/chevre/repo/paymentService.d.ts +1 -3
- package/lib/chevre/repo/paymentService.js +2 -2
- package/lib/chevre/repo/paymentServiceChannel.d.ts +1 -3
- package/lib/chevre/repo/paymentServiceChannel.js +2 -2
- package/lib/chevre/repo/person.js +2 -2
- package/lib/chevre/repo/place/busStop.js +1 -1
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -3
- package/lib/chevre/repo/place/movieTheater.js +10 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +3 -3
- package/lib/chevre/repo/place/screeningRoom.js +2 -2
- package/lib/chevre/repo/place/seat.d.ts +2 -4
- package/lib/chevre/repo/potentialAction.d.ts +4 -6
- package/lib/chevre/repo/potentialAction.js +2 -2
- package/lib/chevre/repo/priceSpecification.d.ts +3 -3
- package/lib/chevre/repo/priceSpecification.js +2 -2
- package/lib/chevre/repo/product.d.ts +5 -9
- package/lib/chevre/repo/product.js +3 -3
- package/lib/chevre/repo/productModel.js +2 -2
- package/lib/chevre/repo/project.d.ts +3 -3
- package/lib/chevre/repo/rateLimit/offer.js +1 -1
- package/lib/chevre/repo/reservation.d.ts +4 -6
- package/lib/chevre/repo/seller.d.ts +5 -9
- package/lib/chevre/repo/seller.js +2 -2
- package/lib/chevre/repo/sellerReturnPolicy.d.ts +1 -3
- package/lib/chevre/repo/sellerReturnPolicy.js +2 -2
- package/lib/chevre/repo/task.d.ts +3 -3
- package/lib/chevre/repo/task.js +1 -1
- package/lib/chevre/repo/transaction.d.ts +3 -3
- package/lib/chevre/repo/transactionProcess.js +1 -1
- package/lib/chevre/repo/trip.d.ts +4 -12
- package/lib/chevre/repo/trip.js +3 -3
- package/lib/chevre/repo/webSite.d.ts +1 -3
- package/lib/chevre/repo/webSite.js +3 -2
- package/lib/chevre/repository.d.ts +10 -0
- package/lib/chevre/repository.js +22 -0
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +8 -5
- package/lib/chevre/service/assetTransaction/pay/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +2 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +2 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +2 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +6 -0
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +6 -0
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +6 -0
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +6 -3
- package/lib/chevre/service/delivery/factory.js +2 -1
- package/lib/chevre/service/event/saveScreeningEvents.js +2 -2
- package/lib/chevre/service/event.js +1 -1
- package/lib/chevre/service/notification/notifyByEmail.d.ts +1 -1
- package/lib/chevre/service/notification/triggerWebhook.js +1 -1
- package/lib/chevre/service/offer/event/authorize.js +2 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +2 -1
- package/lib/chevre/service/offer/event/searchOffersByIds.js +2 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +6 -3
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +2 -1
- package/lib/chevre/service/offer/product.js +1 -1
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +4 -2
- package/lib/chevre/service/payment/any/authorize.d.ts +6 -0
- package/lib/chevre/service/payment/any/findAcceptAction.js +2 -1
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +2 -1
- package/lib/chevre/service/payment/any/findCheckAction.js +2 -1
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +2 -1
- package/lib/chevre/service/payment/any/onPayActionCompleted.d.ts +6 -2
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +7 -2
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +10 -5
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +21 -11
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.d.ts +12 -10
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +9 -6
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -1
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +2 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +6 -0
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +6 -0
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +10 -0
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +2 -1
- package/lib/chevre/service/payment/factory.js +4 -2
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +6 -0
- package/lib/chevre/service/payment/movieTicket/authorize.js +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.d.ts +12 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js +72 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.d.ts +8 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket/processSeatInfoSync.js +29 -0
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +7 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +4 -71
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +6 -0
- package/lib/chevre/service/payment/movieTicket/validation.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/validation.js +37 -29
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +6 -0
- package/lib/chevre/service/payment/paymentCard.d.ts +10 -0
- package/lib/chevre/service/permit.js +4 -2
- package/lib/chevre/service/reserve/factory.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +2 -1
- package/lib/chevre/service/reserve/searchByOrder.js +2 -1
- package/lib/chevre/service/reserve/verifyToken4reservation.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +6 -0
- package/lib/chevre/service/task/confirmReserveTransaction.js +4 -2
- package/lib/chevre/service/task/invalidatePaymentUrl.js +6 -0
- package/lib/chevre/service/task/onResourceUpdated.js +1 -1
- package/lib/chevre/service/task/pay.js +6 -0
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +6 -0
- package/lib/chevre/service/task/payment/payByTask.d.ts +6 -0
- package/lib/chevre/service/task/payment/payByTask.js +2 -1
- package/lib/chevre/service/task/payment/refundByTask.d.ts +6 -0
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +6 -0
- package/lib/chevre/service/task/refund.js +6 -0
- package/lib/chevre/service/task/returnReserveTransaction.js +2 -1
- package/lib/chevre/service/task/voidPayment.js +6 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +4 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +2 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +2 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart/getReturnPolicyByProject.js +5 -3
- package/lib/chevre/service/validation/validateOrder.js +4 -2
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import * as factory from '../../factory';
|
|
5
5
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
6
6
|
import type { ActionRepo } from '../../repo/action';
|
|
7
|
+
import type { PayActionRepo } from '../../repo/action/pay';
|
|
8
|
+
import type { RefundActionRepo } from '../../repo/action/refund';
|
|
7
9
|
import type { ProductRepo } from '../../repo/product';
|
|
8
10
|
import type { TaskRepo } from '../../repo/task';
|
|
9
11
|
declare function voidTransaction(__: factory.task.voidPayment.IData): (___: {
|
|
@@ -11,12 +13,20 @@ declare function voidTransaction(__: factory.task.voidPayment.IData): (___: {
|
|
|
11
13
|
}) => Promise<void>;
|
|
12
14
|
declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (repos: {
|
|
13
15
|
action: ActionRepo;
|
|
16
|
+
actions: {
|
|
17
|
+
pay: PayActionRepo;
|
|
18
|
+
refund: RefundActionRepo;
|
|
19
|
+
};
|
|
14
20
|
accountingReport: AccountingReportRepo;
|
|
15
21
|
product: ProductRepo;
|
|
16
22
|
task: TaskRepo;
|
|
17
23
|
}) => Promise<void>;
|
|
18
24
|
declare function refundFaceToFace(params: factory.task.refund.IData): (repos: {
|
|
19
25
|
action: ActionRepo;
|
|
26
|
+
actions: {
|
|
27
|
+
pay: PayActionRepo;
|
|
28
|
+
refund: RefundActionRepo;
|
|
29
|
+
};
|
|
20
30
|
accountingReport: AccountingReportRepo;
|
|
21
31
|
product: ProductRepo;
|
|
22
32
|
task: TaskRepo;
|
|
@@ -39,7 +39,7 @@ function createPayObjectServiceOutput(params) {
|
|
|
39
39
|
case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
40
40
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
41
41
|
break;
|
|
42
|
-
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
42
|
+
case factory.service.paymentService.PaymentServiceType.MovieTicket: {
|
|
43
43
|
const paymentMethodType = paymentMethod?.identifier;
|
|
44
44
|
const movieTickets = paymentMethod?.movieTickets;
|
|
45
45
|
if (Array.isArray(movieTickets)) {
|
|
@@ -58,6 +58,7 @@ function createPayObjectServiceOutput(params) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
break;
|
|
61
|
+
}
|
|
61
62
|
default:
|
|
62
63
|
throw new factory.errors.NotImplemented(`Payment service "${transaction.object.typeOf}" not implemented.`);
|
|
63
64
|
}
|
|
@@ -82,7 +82,7 @@ function createPayObject(params) {
|
|
|
82
82
|
const paymentServiceOutput = (0, createPayObjectServiceOutput_1.createPayObjectServiceOutput)(params);
|
|
83
83
|
let payObject;
|
|
84
84
|
switch (transaction.object.typeOf) {
|
|
85
|
-
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
85
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace: {
|
|
86
86
|
// 対面決済ではとりあえず問答無用にJPY
|
|
87
87
|
const totalPaymentDue4faceToFace = {
|
|
88
88
|
typeOf: 'MonetaryAmount',
|
|
@@ -102,7 +102,8 @@ function createPayObject(params) {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
break;
|
|
105
|
-
|
|
105
|
+
}
|
|
106
|
+
case factory.service.paymentService.PaymentServiceType.PaymentCard: {
|
|
106
107
|
const totalPaymentDue = (typeof paymentMethod?.totalPaymentDue?.typeOf === 'string')
|
|
107
108
|
? paymentMethod.totalPaymentDue
|
|
108
109
|
: {
|
|
@@ -124,6 +125,7 @@ function createPayObject(params) {
|
|
|
124
125
|
pendingTransaction: transaction.object.pendingTransaction
|
|
125
126
|
};
|
|
126
127
|
break;
|
|
128
|
+
}
|
|
127
129
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
128
130
|
payObject = {
|
|
129
131
|
typeOf: transaction.object.typeOf,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
+
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
|
+
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
3
5
|
import type { CheckMovieTicketActionRepo } from '../../../repo/action/checkMovieTicket';
|
|
4
6
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
5
7
|
import type { EventRepo } from '../../../repo/event';
|
|
@@ -39,6 +41,10 @@ declare function authorize(params: factory.assetTransaction.pay.IStartParamsWith
|
|
|
39
41
|
};
|
|
40
42
|
}): (repos: {
|
|
41
43
|
action: ActionRepo;
|
|
44
|
+
actions: {
|
|
45
|
+
pay: PayActionRepo;
|
|
46
|
+
refund: RefundActionRepo;
|
|
47
|
+
};
|
|
42
48
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
43
49
|
accountingReport: AccountingReportRepo;
|
|
44
50
|
credentials: CredentialsRepo;
|
|
@@ -38,7 +38,7 @@ function authorize(params, transaction, paymentServiceId, options) {
|
|
|
38
38
|
let accountsReceivablesByServiceType;
|
|
39
39
|
try {
|
|
40
40
|
// MovieTicket決済の場合、認証
|
|
41
|
-
const validateMovieTicketResult = await (0, validation_1.validateMovieTicket)(params, paymentServiceId, options.checkedAction, options.purpose)(repos
|
|
41
|
+
const validateMovieTicketResult = await (0, validation_1.validateMovieTicket)(params, paymentServiceId, options.checkedAction, options.purpose)(repos);
|
|
42
42
|
accountsReceivablesByServiceType = validateMovieTicketResult.accountsReceivablesByServiceType;
|
|
43
43
|
const paymentMethod = transaction.object.paymentMethod;
|
|
44
44
|
const paymentMethodType = String(paymentMethod?.identifier);
|
package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as surfrock from '@surfrock/sdk';
|
|
2
|
+
import type { EventRepo } from '../../../../repo/event';
|
|
3
|
+
import type { PaymentServiceProviderRepo } from '../../../../repo/paymentServiceProvider';
|
|
4
|
+
import type { SellerPaymentAcceptedRepo } from '../../../../repo/sellerPaymentAccepted';
|
|
5
|
+
import * as factory from '../../../../factory';
|
|
6
|
+
export declare function payActionParams2seatInfoSyncIn(params: Omit<factory.action.trade.pay.IAttributes, 'purpose'> & {
|
|
7
|
+
purpose: factory.action.trade.pay.IOrderAsPayPurpose;
|
|
8
|
+
}): (repos: {
|
|
9
|
+
event: EventRepo;
|
|
10
|
+
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
11
|
+
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
12
|
+
}) => Promise<surfrock.factory.service.seat.seatInfoSync.ISeatInfoSyncIn>;
|
package/lib/chevre/service/payment/movieTicket/payMovieTicket/payActionParams2seatInfoSyncIn.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.payActionParams2seatInfoSyncIn = payActionParams2seatInfoSyncIn;
|
|
27
|
+
const factory = __importStar(require("../../../../factory"));
|
|
28
|
+
const factory_1 = require("../factory");
|
|
29
|
+
const getCredentials_1 = require("../getCredentials");
|
|
30
|
+
function payActionParams2seatInfoSyncIn(params) {
|
|
31
|
+
return async (repos) => {
|
|
32
|
+
const paymentMethodType = params.object[0]?.paymentMethod.typeOf;
|
|
33
|
+
const paymentMethodId = params.object[0]?.paymentMethod.paymentMethodId;
|
|
34
|
+
const paymentServiceId = params.object[0]?.id;
|
|
35
|
+
// イベントがひとつに特定されているかどうか確認
|
|
36
|
+
const eventIds = [...new Set(params.object.reduce((a, b) => [
|
|
37
|
+
...a,
|
|
38
|
+
...(Array.isArray(b.movieTickets)) ? b.movieTickets.map((ticket) => ticket.serviceOutput.reservationFor.id) : []
|
|
39
|
+
], []))];
|
|
40
|
+
if (eventIds.length !== 1) {
|
|
41
|
+
throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
|
|
42
|
+
}
|
|
43
|
+
const event = await repos.event.projectEventFieldsById({ id: eventIds[0] },
|
|
44
|
+
// optimize projection(2024-07-19~)
|
|
45
|
+
[
|
|
46
|
+
'coaInfo', 'startDate', 'project',
|
|
47
|
+
'offers.offeredThrough', 'location.branchCode', 'superEvent.workPerformed.identifier'
|
|
48
|
+
]);
|
|
49
|
+
const sellerId = String(params.recipient?.id);
|
|
50
|
+
// 全購入管理番号のMovieTicketをマージ
|
|
51
|
+
const movieTickets = params.object.reduce((a, b) => [...a, ...(Array.isArray(b.movieTickets)) ? b.movieTickets : []], []);
|
|
52
|
+
const sellerCredentials = await (0, getCredentials_1.getCredentials)({
|
|
53
|
+
seller: { id: sellerId, project: { id: event.project.id } },
|
|
54
|
+
paymentServiceId
|
|
55
|
+
})(repos);
|
|
56
|
+
const paymentAccepted = await repos.paymentAccepted.isAcceptedBySeller({
|
|
57
|
+
seller: { id: sellerId },
|
|
58
|
+
codeValue: paymentMethodType
|
|
59
|
+
});
|
|
60
|
+
if (paymentAccepted !== true) {
|
|
61
|
+
throw new factory.errors.Argument('transactionId', `payment not accepted [${paymentMethodType}]`);
|
|
62
|
+
}
|
|
63
|
+
return (0, factory_1.createSeatInfoSyncIn)({
|
|
64
|
+
paymentMethodType: paymentMethodType,
|
|
65
|
+
paymentMethodId: paymentMethodId,
|
|
66
|
+
movieTickets: movieTickets,
|
|
67
|
+
event: event,
|
|
68
|
+
purpose: params.purpose,
|
|
69
|
+
credentials: sellerCredentials
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as surfrock from '@surfrock/sdk';
|
|
2
|
+
import * as factory from '../../../../factory';
|
|
3
|
+
import { IProcessSeatInfoSyncResult } from '../factory';
|
|
4
|
+
export declare function processSeatInfoSync(params: {
|
|
5
|
+
seatInfoSyncIn: factory.action.trade.refund.ISeatInfoSyncIn;
|
|
6
|
+
}): (repos: {
|
|
7
|
+
seatService: surfrock.service.seat.SeatService;
|
|
8
|
+
}) => Promise<IProcessSeatInfoSyncResult>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processSeatInfoSync = processSeatInfoSync;
|
|
4
|
+
const http_status_1 = require("http-status");
|
|
5
|
+
const errorHandler_1 = require("../../../../errorHandler");
|
|
6
|
+
const factory_1 = require("../factory");
|
|
7
|
+
function processSeatInfoSync(params) {
|
|
8
|
+
return async (repos) => {
|
|
9
|
+
let seatInfoSyncResult;
|
|
10
|
+
const { seatInfoSyncIn } = params;
|
|
11
|
+
try {
|
|
12
|
+
seatInfoSyncResult = await repos.seatService.seatInfoSync(seatInfoSyncIn);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
let throwsError = true;
|
|
16
|
+
// 「既に存在する興行システム座席予約番号が入力されました」の場合、着券済なのでok
|
|
17
|
+
if (error.name === errorHandler_1.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME) {
|
|
18
|
+
if (error.code === http_status_1.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.AlreadyPaid) {
|
|
19
|
+
seatInfoSyncResult = error;
|
|
20
|
+
throwsError = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (throwsError) {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { seatInfoSyncIn, seatInfoSyncResult };
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
+
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
|
+
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
3
5
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
4
6
|
import type { EventRepo } from '../../../repo/event';
|
|
5
7
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
@@ -10,6 +12,10 @@ import * as factory from '../../../factory';
|
|
|
10
12
|
import { Settings } from '../../../settings';
|
|
11
13
|
interface IPayOperationRepos {
|
|
12
14
|
action: ActionRepo;
|
|
15
|
+
actions: {
|
|
16
|
+
pay: PayActionRepo;
|
|
17
|
+
refund: RefundActionRepo;
|
|
18
|
+
};
|
|
13
19
|
accountingReport: AccountingReportRepo;
|
|
14
20
|
credentials: CredentialsRepo;
|
|
15
21
|
event: EventRepo;
|
|
@@ -27,4 +33,4 @@ declare function payMovieTicket(params: Omit<factory.action.trade.pay.IAttribute
|
|
|
27
33
|
}, options: {
|
|
28
34
|
callOnPayActionCompleted: boolean;
|
|
29
35
|
}): IPayOperation<void>;
|
|
30
|
-
export { payMovieTicket };
|
|
36
|
+
export { IPayOperationRepos, payMovieTicket };
|
|
@@ -25,12 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.payMovieTicket = payMovieTicket;
|
|
27
27
|
const surfrock = __importStar(require("@surfrock/sdk"));
|
|
28
|
-
const http_status_1 = require("http-status");
|
|
29
28
|
const errorHandler_1 = require("../../../errorHandler");
|
|
30
|
-
const factory = __importStar(require("../../../factory"));
|
|
31
29
|
const onPayActionCompleted_1 = require("../any/onPayActionCompleted");
|
|
32
30
|
const factory_1 = require("./factory");
|
|
33
|
-
const
|
|
31
|
+
const payActionParams2seatInfoSyncIn_1 = require("./payMovieTicket/payActionParams2seatInfoSyncIn");
|
|
32
|
+
const processSeatInfoSync_1 = require("./payMovieTicket/processSeatInfoSync");
|
|
34
33
|
/**
|
|
35
34
|
* 決済カード決済
|
|
36
35
|
*/
|
|
@@ -39,7 +38,7 @@ function payMovieTicket(params, options) {
|
|
|
39
38
|
const { callOnPayActionCompleted } = options;
|
|
40
39
|
const paymentMethodId = params.object[0]?.paymentMethod.paymentMethodId;
|
|
41
40
|
const paymentServiceId = params.object[0]?.id;
|
|
42
|
-
const seatInfoSyncIn = await payActionParams2seatInfoSyncIn(params)(repos);
|
|
41
|
+
const seatInfoSyncIn = await (0, payActionParams2seatInfoSyncIn_1.payActionParams2seatInfoSyncIn)(params)(repos);
|
|
43
42
|
const startingAction = (0, factory_1.createStartingPayAction)(params);
|
|
44
43
|
let recipe = (0, factory_1.processSeatInfoSyncResult2payRecipe)({
|
|
45
44
|
processSeatInfoSyncResult: { seatInfoSyncIn },
|
|
@@ -78,7 +77,7 @@ function payMovieTicket(params, options) {
|
|
|
78
77
|
credentialsRepo: repos.credentials // set credentialsRepo(2024-11-20~)
|
|
79
78
|
});
|
|
80
79
|
const seatService = new surfrock.service.seat.SeatService({ endpoint: String(availableChannel.serviceUrl), auth: mvtkReserveAuthClient }, { timeout: settings.movieticketReserve.timeout });
|
|
81
|
-
processSeatInfoSyncResult = await processSeatInfoSync({ seatInfoSyncIn })({ seatService });
|
|
80
|
+
processSeatInfoSyncResult = await (0, processSeatInfoSync_1.processSeatInfoSync)({ seatInfoSyncIn })({ seatService });
|
|
82
81
|
}
|
|
83
82
|
// add recipe(2024-06-03~)
|
|
84
83
|
recipe = (0, factory_1.processSeatInfoSyncResult2payRecipe)({
|
|
@@ -119,69 +118,3 @@ function payMovieTicket(params, options) {
|
|
|
119
118
|
}
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
|
-
function payActionParams2seatInfoSyncIn(params) {
|
|
123
|
-
return async (repos) => {
|
|
124
|
-
const paymentMethodType = params.object[0]?.paymentMethod.typeOf;
|
|
125
|
-
const paymentMethodId = params.object[0]?.paymentMethod.paymentMethodId;
|
|
126
|
-
const paymentServiceId = params.object[0]?.id;
|
|
127
|
-
// イベントがひとつに特定されているかどうか確認
|
|
128
|
-
const eventIds = [...new Set(params.object.reduce((a, b) => [
|
|
129
|
-
...a,
|
|
130
|
-
...(Array.isArray(b.movieTickets)) ? b.movieTickets.map((ticket) => ticket.serviceOutput.reservationFor.id) : []
|
|
131
|
-
], []))];
|
|
132
|
-
if (eventIds.length !== 1) {
|
|
133
|
-
throw new factory.errors.Argument('movieTickets', 'Number of events must be 1');
|
|
134
|
-
}
|
|
135
|
-
const event = await repos.event.projectEventFieldsById({ id: eventIds[0] },
|
|
136
|
-
// optimize projection(2024-07-19~)
|
|
137
|
-
[
|
|
138
|
-
'coaInfo', 'startDate', 'project',
|
|
139
|
-
'offers.offeredThrough', 'location.branchCode', 'superEvent.workPerformed.identifier'
|
|
140
|
-
]);
|
|
141
|
-
const sellerId = String(params.recipient?.id);
|
|
142
|
-
// 全購入管理番号のMovieTicketをマージ
|
|
143
|
-
const movieTickets = params.object.reduce((a, b) => [...a, ...(Array.isArray(b.movieTickets)) ? b.movieTickets : []], []);
|
|
144
|
-
const sellerCredentials = await (0, getCredentials_1.getCredentials)({
|
|
145
|
-
seller: { id: sellerId, project: { id: event.project.id } },
|
|
146
|
-
paymentServiceId
|
|
147
|
-
})(repos);
|
|
148
|
-
const paymentAccepted = await repos.paymentAccepted.isAcceptedBySeller({
|
|
149
|
-
seller: { id: sellerId },
|
|
150
|
-
codeValue: paymentMethodType
|
|
151
|
-
});
|
|
152
|
-
if (paymentAccepted !== true) {
|
|
153
|
-
throw new factory.errors.Argument('transactionId', `payment not accepted [${paymentMethodType}]`);
|
|
154
|
-
}
|
|
155
|
-
return (0, factory_1.createSeatInfoSyncIn)({
|
|
156
|
-
paymentMethodType: paymentMethodType,
|
|
157
|
-
paymentMethodId: paymentMethodId,
|
|
158
|
-
movieTickets: movieTickets,
|
|
159
|
-
event: event,
|
|
160
|
-
purpose: params.purpose,
|
|
161
|
-
credentials: sellerCredentials
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function processSeatInfoSync(params) {
|
|
166
|
-
return async (repos) => {
|
|
167
|
-
let seatInfoSyncResult;
|
|
168
|
-
const { seatInfoSyncIn } = params;
|
|
169
|
-
try {
|
|
170
|
-
seatInfoSyncResult = await repos.seatService.seatInfoSync(seatInfoSyncIn);
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
let throwsError = true;
|
|
174
|
-
// 「既に存在する興行システム座席予約番号が入力されました」の場合、着券済なのでok
|
|
175
|
-
if (error.name === errorHandler_1.MOVIE_TICKET_RESERVE_REQUEST_ERROR_NAME) {
|
|
176
|
-
if (error.code === http_status_1.BAD_REQUEST && error.message === factory_1.MovieticketReserveRequestErrorMessage.AlreadyPaid) {
|
|
177
|
-
seatInfoSyncResult = error;
|
|
178
|
-
throwsError = false;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
if (throwsError) {
|
|
182
|
-
throw error;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return { seatInfoSyncIn, seatInfoSyncResult };
|
|
186
|
-
};
|
|
187
|
-
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
+
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
|
+
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
3
5
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
4
6
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
@@ -7,6 +9,10 @@ import * as factory from '../../../factory';
|
|
|
7
9
|
import { Settings } from '../../../settings';
|
|
8
10
|
interface IRefundOperationRepos {
|
|
9
11
|
action: ActionRepo;
|
|
12
|
+
actions: {
|
|
13
|
+
pay: PayActionRepo;
|
|
14
|
+
refund: RefundActionRepo;
|
|
15
|
+
};
|
|
10
16
|
accountingReport: AccountingReportRepo;
|
|
11
17
|
credentials: CredentialsRepo;
|
|
12
18
|
paymentService: PaymentServiceRepo;
|
|
@@ -6,7 +6,6 @@ import type { PaymentServiceProviderRepo } from '../../../repo/paymentServicePro
|
|
|
6
6
|
import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
8
|
import * as factory from '../../../factory';
|
|
9
|
-
import { Settings } from '../../../settings';
|
|
10
9
|
export interface IValidateMovieTicketRepos {
|
|
11
10
|
checkMovieTicketAction: CheckMovieTicketActionRepo;
|
|
12
11
|
credentials: CredentialsRepo;
|
|
@@ -23,6 +22,6 @@ export declare function validateMovieTicket(params: factory.assetTransaction.pay
|
|
|
23
22
|
* placeOrder ID
|
|
24
23
|
*/
|
|
25
24
|
id?: string;
|
|
26
|
-
}): (repos: IValidateMovieTicketRepos
|
|
25
|
+
}): (repos: IValidateMovieTicketRepos) => Promise<{
|
|
27
26
|
accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
|
|
28
27
|
}>;
|
|
@@ -29,12 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.validateMovieTicket = validateMovieTicket;
|
|
30
30
|
const debug_1 = __importDefault(require("debug"));
|
|
31
31
|
const factory = __importStar(require("../../../factory"));
|
|
32
|
-
const processPurchaseNumberAuth_1 = require("./processPurchaseNumberAuth");
|
|
33
32
|
const debug = (0, debug_1.default)('chevre-domain:service:payment');
|
|
34
33
|
function validateMovieTicket(params, paymentServiceId,
|
|
35
34
|
// useCheckByIdentifierIfNotYet: boolean,
|
|
36
35
|
checkedAction, purpose) {
|
|
37
|
-
return async (repos
|
|
36
|
+
return async (repos) => {
|
|
38
37
|
const movieTickets = params.object.paymentMethod?.movieTickets;
|
|
39
38
|
if (!Array.isArray(movieTickets)) {
|
|
40
39
|
throw new factory.errors.Argument('movieTickets', 'object.paymentMethod.movieTickets must be an array');
|
|
@@ -100,7 +99,7 @@ checkedAction, purpose) {
|
|
|
100
99
|
// useCheckByIdentifierIfNotYet,
|
|
101
100
|
checkedAction,
|
|
102
101
|
purpose
|
|
103
|
-
})(repos
|
|
102
|
+
})(repos);
|
|
104
103
|
const accountsReceivablesByServiceType = [];
|
|
105
104
|
// 券種ごとに枚数が足りているか
|
|
106
105
|
const serviceTypes = [...new Set(movieTickets.map((t) => t.serviceType))];
|
|
@@ -130,7 +129,7 @@ checkedAction, purpose) {
|
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
131
|
function checkByIdentifierIfNotYet(params) {
|
|
133
|
-
return async (repos
|
|
132
|
+
return async (repos) => {
|
|
134
133
|
let checkResult;
|
|
135
134
|
let alreadyCheckedAction; // すでにCheckActionが存在すれば認証しない(2023-06-06~)
|
|
136
135
|
const placeOrderId = params.purpose.id;
|
|
@@ -138,8 +137,10 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
138
137
|
// no op
|
|
139
138
|
}
|
|
140
139
|
else {
|
|
141
|
-
// 注文取引ID
|
|
142
|
-
|
|
140
|
+
// 注文取引IDの未指定ケースは廃止(2026-03-21~)
|
|
141
|
+
throw new factory.errors.ArgumentNull('purpose.id');
|
|
142
|
+
// // 注文取引IDの未指定ケースがあるかどうか確認するためにlog
|
|
143
|
+
// console.log('checkByIdentifierIfNotYet: placeOrderId undefined. params:', JSON.stringify(params));
|
|
143
144
|
}
|
|
144
145
|
const specifiedCheckedActionId = params.checkedAction?.id;
|
|
145
146
|
if (typeof specifiedCheckedActionId === 'string' && specifiedCheckedActionId !== '') {
|
|
@@ -157,27 +158,31 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
else {
|
|
160
|
-
// 認証ID
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
161
|
+
// 認証IDの未指定ケースは廃止(2026-03-21~)
|
|
162
|
+
throw new factory.errors.ArgumentNull('checkedAction.id');
|
|
163
|
+
// // 認証IDの未指定ケースがあるかどうか確認するためにlog
|
|
164
|
+
// console.log('checkByIdentifierIfNotYet: specifiedCheckedActionId undefined. params:', JSON.stringify(params));
|
|
165
|
+
// alreadyCheckedAction = (await repos.checkMovieTicketAction.findCompletedCheckActions(
|
|
166
|
+
// {
|
|
167
|
+
// // limit: 1,
|
|
168
|
+
// // page: 1,
|
|
169
|
+
// sort: { startDate: factory.sortType.Descending },
|
|
170
|
+
// // typeOf: { $eq: factory.actionType.CheckAction },
|
|
171
|
+
// // actionStatus: { $in: [factory.actionStatusType.CompletedActionStatus] },
|
|
172
|
+
// object: {
|
|
173
|
+
// typeOf: { $eq: factory.service.paymentService.PaymentServiceType.MovieTicket },
|
|
174
|
+
// id: { $eq: params.paymentServiceId }, // 指定の決済サービスにおいて
|
|
175
|
+
// movieTickets: {
|
|
176
|
+
// identifier: { $eq: params.movieTicketIdentifier }, // 指定の決済カードコードを
|
|
177
|
+
// serviceOutput: {
|
|
178
|
+
// reservationFor: { id: { $eq: params.screeningEvent.id } } // 指定のイベントにおいて
|
|
179
|
+
// }
|
|
180
|
+
// }
|
|
181
|
+
// },
|
|
182
|
+
// // ...(typeof placeOrderId === 'string') ? { purpose: { id: { $in: [placeOrderId] } } } : undefined
|
|
183
|
+
// ...(typeof placeOrderId === 'string') ? { purpose: { id: placeOrderId } } : undefined
|
|
184
|
+
// }
|
|
185
|
+
// )).shift();
|
|
181
186
|
}
|
|
182
187
|
debug('checkByIdentifierIfNotYet: alreadyCheckedAction:', JSON.stringify(alreadyCheckedAction), 'params:', JSON.stringify(params));
|
|
183
188
|
if (alreadyCheckedAction !== undefined) {
|
|
@@ -194,8 +199,11 @@ function checkByIdentifierIfNotYet(params) {
|
|
|
194
199
|
}
|
|
195
200
|
}
|
|
196
201
|
if (checkResult === undefined) {
|
|
197
|
-
|
|
198
|
-
checkResult
|
|
202
|
+
// 認証IDの未指定ケースは廃止(2026-03-21~)
|
|
203
|
+
console.error('checkByIdentifierIfNotYet: checkResult undefined. params:', JSON.stringify(params));
|
|
204
|
+
throw new factory.errors.NotFound('checkResult');
|
|
205
|
+
// debug('checkByIdentifier processing because movieTickets not checked yet...', checkResult);
|
|
206
|
+
// checkResult = await processPurchaseNumberAuth(params)(repos, settings);
|
|
199
207
|
}
|
|
200
208
|
return checkResult;
|
|
201
209
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AccountingReportRepo } from '../../../repo/accountingReport';
|
|
2
2
|
import type { ActionRepo } from '../../../repo/action';
|
|
3
|
+
import type { PayActionRepo } from '../../../repo/action/pay';
|
|
4
|
+
import type { RefundActionRepo } from '../../../repo/action/refund';
|
|
3
5
|
import type { CredentialsRepo } from '../../../repo/credentials';
|
|
4
6
|
import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
5
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
@@ -7,6 +9,10 @@ import * as factory from '../../../factory';
|
|
|
7
9
|
import { Settings } from '../../../settings';
|
|
8
10
|
declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
|
|
9
11
|
action: ActionRepo;
|
|
12
|
+
actions: {
|
|
13
|
+
pay: PayActionRepo;
|
|
14
|
+
refund: RefundActionRepo;
|
|
15
|
+
};
|
|
10
16
|
accountingReport: AccountingReportRepo;
|
|
11
17
|
credentials: CredentialsRepo;
|
|
12
18
|
paymentService: PaymentServiceRepo;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
import type { AccountingReportRepo } from '../../repo/accountingReport';
|
|
3
3
|
import type { ActionRepo } from '../../repo/action';
|
|
4
|
+
import type { PayActionRepo } from '../../repo/action/pay';
|
|
5
|
+
import type { RefundActionRepo } from '../../repo/action/refund';
|
|
4
6
|
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
5
7
|
import type { ProductRepo } from '../../repo/product';
|
|
6
8
|
import type { TaskRepo } from '../../repo/task';
|
|
@@ -18,12 +20,20 @@ declare function voidTransaction(params: factory.task.voidPayment.IData): (repos
|
|
|
18
20
|
}) => Promise<void>;
|
|
19
21
|
declare function payPaymentCard(params: factory.action.trade.pay.IAttributes): (repos: {
|
|
20
22
|
action: ActionRepo;
|
|
23
|
+
actions: {
|
|
24
|
+
pay: PayActionRepo;
|
|
25
|
+
refund: RefundActionRepo;
|
|
26
|
+
};
|
|
21
27
|
accountingReport: AccountingReportRepo;
|
|
22
28
|
product: ProductRepo;
|
|
23
29
|
task: TaskRepo;
|
|
24
30
|
}) => Promise<void>;
|
|
25
31
|
declare function refundPaymentCard(params: factory.task.refund.IData): (repos: {
|
|
26
32
|
action: ActionRepo;
|
|
33
|
+
actions: {
|
|
34
|
+
pay: PayActionRepo;
|
|
35
|
+
refund: RefundActionRepo;
|
|
36
|
+
};
|
|
27
37
|
accountingReport: AccountingReportRepo;
|
|
28
38
|
product: ProductRepo;
|
|
29
39
|
task: TaskRepo;
|
|
@@ -37,7 +37,7 @@ const AccountService = __importStar(require("./account"));
|
|
|
37
37
|
function issue(params) {
|
|
38
38
|
return async (repos) => {
|
|
39
39
|
switch (params.issuedThrough.typeOf) {
|
|
40
|
-
case factory.product.ProductType.PaymentCard:
|
|
40
|
+
case factory.product.ProductType.PaymentCard: {
|
|
41
41
|
// 口座開設
|
|
42
42
|
const openAccountParams = params.serviceOutputs.map((serviceOutput) => {
|
|
43
43
|
const accountTypeOf = serviceOutput?.paymentAccount?.typeOf;
|
|
@@ -76,6 +76,7 @@ function issue(params) {
|
|
|
76
76
|
account: repos.account
|
|
77
77
|
});
|
|
78
78
|
break;
|
|
79
|
+
}
|
|
79
80
|
default:
|
|
80
81
|
// no op
|
|
81
82
|
}
|
|
@@ -105,7 +106,7 @@ function search(project, params, projection) {
|
|
|
105
106
|
};
|
|
106
107
|
const productType = params.issuedThrough?.typeOf?.$eq;
|
|
107
108
|
switch (productType) {
|
|
108
|
-
case factory.product.ProductType.PaymentCard:
|
|
109
|
+
case factory.product.ProductType.PaymentCard: {
|
|
109
110
|
const permits = await repos.serviceOutput.search(searchConditions, projection);
|
|
110
111
|
permitsWithAccountDetail = permits;
|
|
111
112
|
// 口座詳細取得
|
|
@@ -138,6 +139,7 @@ function search(project, params, projection) {
|
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
141
|
break;
|
|
142
|
+
}
|
|
141
143
|
default:
|
|
142
144
|
permitsWithAccountDetail = await repos.serviceOutput.search(searchConditions, projection);
|
|
143
145
|
}
|
|
@@ -3,7 +3,7 @@ export declare function optimizeUnderName4inform(params: {
|
|
|
3
3
|
underName: factory.reservation.IUnderName<factory.reservationType.EventReservation>;
|
|
4
4
|
}): factory.notification.reservation.IMaskedUnderName;
|
|
5
5
|
export type IPotentialInformReservationAction = factory.task.triggerWebhook.IPotentialInformReservationAction;
|
|
6
|
-
export declare const NUM_TRY_INFORM_RESERVATION
|
|
6
|
+
export declare const NUM_TRY_INFORM_RESERVATION = 10;
|
|
7
7
|
export declare function createMoneyTransferActions(params: {
|
|
8
8
|
acceptedOffer?: factory.assetTransaction.reserve.IAcceptedOffer4object;
|
|
9
9
|
reservation: Pick<factory.assetTransaction.reserve.IObjectSubReservation, 'reservedTicket'>;
|
|
@@ -39,7 +39,7 @@ function findByCode(params) {
|
|
|
39
39
|
code: params.code
|
|
40
40
|
});
|
|
41
41
|
switch (authorization.object.typeOf) {
|
|
42
|
-
case factory.order.OrderType.Order:
|
|
42
|
+
case factory.order.OrderType.Order: {
|
|
43
43
|
const { orderNumber } = authorization.object;
|
|
44
44
|
if (typeof orderNumber === 'string' && orderNumber.length > 0) {
|
|
45
45
|
// reservationIdを含む注文の存在を確認するだけでよい
|
|
@@ -51,6 +51,7 @@ function findByCode(params) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
break;
|
|
54
|
+
}
|
|
54
55
|
default:
|
|
55
56
|
throw new factory.errors.NotImplemented(`authorization object typeOf: ${authorization.object.typeOf} not implemented`);
|
|
56
57
|
}
|
|
@@ -52,7 +52,7 @@ function searchByOrder(params) {
|
|
|
52
52
|
if (reservationIds.length > 0) {
|
|
53
53
|
switch (offeredThroughIdentifier) {
|
|
54
54
|
// COA対応
|
|
55
|
-
case factory.service.webAPI.Identifier.COA:
|
|
55
|
+
case factory.service.webAPI.Identifier.COA: {
|
|
56
56
|
const order = (await repos.order.projectFields({
|
|
57
57
|
limit: 1,
|
|
58
58
|
page: 1,
|
|
@@ -102,6 +102,7 @@ function searchByOrder(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
break;
|
|
105
|
+
}
|
|
105
106
|
default:
|
|
106
107
|
reservations = await repos.reservation.projectFields({
|
|
107
108
|
project: { id: { $eq: params.project.id } },
|