@chevre/domain 15.65.0-alpha.9 → 20.0.0-alpha.1
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/README.md +26 -19
- package/example/src/chevre/accountBlanceTest.ts +24 -0
- package/example/src/chevre/aggregateAllEvents.ts +55 -0
- package/example/src/chevre/aggregateAllEvents2.ts +52 -0
- package/example/src/chevre/aggregateReservationOnProject.ts +32 -0
- package/example/src/chevre/assetTransaction/searchGMOTrade.ts +27 -0
- package/example/src/chevre/checkOffersAppliesToMovieTicket.ts +56 -0
- package/example/src/chevre/checkOrderMembershipTasks.ts +127 -0
- package/example/src/chevre/cleanAccountingReports.ts +57 -0
- package/example/src/chevre/copyRedisKeys.ts +102 -0
- package/example/src/chevre/createSeats.ts +59 -0
- package/example/src/chevre/csv2json.ts +57 -0
- package/example/src/chevre/deleteEvents.ts +42 -0
- package/example/src/chevre/eventCatalog2eventService.ts +123 -0
- package/example/src/chevre/importEventsFromCOA.ts +37 -0
- package/example/src/chevre/importOffersFromCOA.ts +36 -0
- package/example/src/chevre/manageOwnedByOfOwnershipInfo.ts +35 -0
- package/example/src/chevre/migrateCognitoUser.ts +137 -0
- package/example/src/chevre/migrateEventOffersItemOfferedName.ts +82 -0
- package/example/src/chevre/migrateMovieTicketChargePriceSpecs.ts +92 -0
- package/example/src/chevre/migrateOwnershipInfos2newUserPool.ts +149 -0
- package/example/src/chevre/migrateSection.ts +105 -0
- package/example/src/chevre/migrateSellerMakesOffers.ts +84 -0
- package/example/src/chevre/migrateTTTSOldEventId.ts +68 -0
- package/example/src/chevre/ownershipInfosCsv2peopleJson.ts +182 -0
- package/example/src/chevre/person/getUserAttributes.ts +24 -0
- package/example/src/chevre/person/search.ts +46 -0
- package/example/src/chevre/person/updateProfile.ts +47 -0
- package/example/src/chevre/processPay.ts +81 -0
- package/example/src/chevre/processRegisterMembership.ts +129 -0
- package/example/src/chevre/processRegisterPaymentCard.ts +117 -0
- package/example/src/chevre/processReserve.ts +107 -0
- package/example/src/chevre/publishConfirmationNumber.ts +30 -0
- package/example/src/chevre/publishServiceOutputIdentifier.ts +28 -0
- package/example/src/chevre/publishTransactionNumber.ts +28 -0
- package/example/src/chevre/renameTransaction.ts +22 -0
- package/example/src/chevre/retryTasks.ts +69 -0
- package/example/src/chevre/searchAcceptedOfferIds.ts +23 -0
- package/example/src/chevre/searchEvents.ts +41 -0
- package/example/src/chevre/searchOffers.ts +34 -0
- package/example/src/chevre/searchOrders.ts +35 -0
- package/example/src/chevre/searchOrdersWithUnwoundOffers.ts +35 -0
- package/example/src/chevre/searchReservationNumbersByOrderNumbers.ts +22 -0
- package/example/src/chevre/transaction/callOrderMembershipServiceTask.ts +66 -0
- package/example/src/chevre/transaction/findCreditCard.ts +31 -0
- package/example/src/chevre/transaction/findPaymentCardPermit.ts +29 -0
- package/example/src/chevre/transaction/orderMembershipService.ts +106 -0
- package/example/src/customSearch.ts +48 -0
- package/example/src/handlePhoneNumber.ts +13 -0
- package/lib/chevre/credentials.d.ts +44 -0
- package/lib/chevre/credentials.js +50 -0
- package/lib/chevre/emailMessageBuilder.d.ts +29 -0
- package/lib/chevre/emailMessageBuilder.js +252 -0
- package/lib/chevre/errorHandler.d.ts +24 -0
- package/lib/chevre/errorHandler.js +160 -0
- package/lib/chevre/factory/accountTransactionIdentifier.d.ts +54 -0
- package/lib/chevre/factory/accountTransactionIdentifier.js +28 -0
- package/lib/chevre/factory/availableProductTypes.d.ts +1 -0
- package/lib/chevre/factory/availableProductTypes.js +8 -0
- package/lib/chevre/factory/order.d.ts +6 -0
- package/lib/chevre/factory/order.js +16 -0
- package/lib/{factory.d.ts → chevre/factory.d.ts} +0 -0
- package/lib/chevre/factory.js +20 -0
- package/lib/chevre/index.d.ts +15 -0
- package/lib/chevre/index.js +28 -0
- package/lib/chevre/pecorinoapi.d.ts +6 -0
- package/lib/chevre/pecorinoapi.js +9 -0
- package/lib/chevre/repo/account.d.ts +137 -0
- package/lib/chevre/repo/account.js +423 -0
- package/lib/chevre/repo/accountAction.d.ts +60 -0
- package/lib/chevre/repo/accountAction.js +427 -0
- package/lib/chevre/repo/accountTitle.d.ts +13 -0
- package/lib/chevre/repo/accountTitle.js +31 -0
- package/lib/chevre/repo/accountTransaction.d.ts +81 -0
- package/lib/chevre/repo/accountTransaction.js +328 -0
- package/lib/chevre/repo/accountingReport.d.ts +33 -0
- package/lib/chevre/repo/accountingReport.js +55 -0
- package/lib/chevre/repo/action/registerServiceInProgress.d.ts +29 -0
- package/lib/chevre/repo/action/registerServiceInProgress.js +95 -0
- package/lib/chevre/repo/action.d.ts +110 -0
- package/lib/chevre/repo/action.js +670 -0
- package/lib/chevre/repo/assetTransaction.d.ts +126 -0
- package/lib/chevre/repo/assetTransaction.js +540 -0
- package/lib/chevre/repo/categoryCode.d.ts +36 -0
- package/lib/chevre/repo/categoryCode.js +232 -0
- package/lib/chevre/repo/code.d.ts +58 -0
- package/lib/chevre/repo/code.js +255 -0
- package/lib/chevre/repo/confirmationNumber.d.ts +16 -0
- package/lib/chevre/repo/confirmationNumber.js +97 -0
- package/lib/chevre/repo/creativeWork.d.ts +36 -0
- package/lib/chevre/repo/creativeWork.js +252 -0
- package/lib/chevre/repo/customer.d.ts +24 -0
- package/lib/chevre/repo/customer.js +134 -0
- package/lib/chevre/repo/emailMessage.d.ts +37 -0
- package/lib/chevre/repo/emailMessage.js +122 -0
- package/lib/chevre/repo/event.d.ts +104 -0
- package/lib/chevre/repo/event.js +632 -0
- package/lib/chevre/repo/itemAvailability/screeningEvent.d.ts +75 -0
- package/lib/{repo → chevre/repo}/itemAvailability/screeningEvent.js +0 -0
- package/lib/chevre/repo/member.d.ts +63 -0
- package/lib/chevre/repo/member.js +234 -0
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +25 -0
- package/lib/chevre/repo/merchantReturnPolicy.js +167 -0
- package/lib/chevre/repo/mongoose/model/account.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/account.js +70 -0
- package/lib/chevre/repo/mongoose/model/accountAction.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/accountAction.js +177 -0
- package/lib/chevre/repo/mongoose/model/accountTitle.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/accountTitle.js +110 -0
- package/lib/chevre/repo/mongoose/model/accountTransaction.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/accountTransaction.js +126 -0
- package/lib/chevre/repo/mongoose/model/accountingReport.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/accountingReport.js +0 -0
- package/lib/chevre/repo/mongoose/model/action.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/action.js +244 -0
- package/lib/chevre/repo/mongoose/model/assetTransaction.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/assetTransaction.js +182 -0
- package/lib/chevre/repo/mongoose/model/authorization.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/authorization.js +105 -0
- package/lib/chevre/repo/mongoose/model/categoryCode.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/categoryCode.js +83 -0
- package/lib/chevre/repo/mongoose/model/creativeWork.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/creativeWork.js +123 -0
- package/lib/chevre/repo/mongoose/model/customer.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/customer.js +0 -0
- package/lib/chevre/repo/mongoose/model/emailMessages.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/emailMessages.js +0 -0
- package/lib/chevre/repo/mongoose/model/event.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/event.js +233 -0
- package/lib/chevre/repo/mongoose/model/member.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/member.js +0 -0
- package/lib/chevre/repo/mongoose/model/merchantReturnPolicy.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/merchantReturnPolicy.js +58 -0
- package/lib/chevre/repo/mongoose/model/offer.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/offer.js +201 -0
- package/lib/chevre/repo/mongoose/model/offerCatalog.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/offerCatalog.js +74 -0
- package/lib/chevre/repo/mongoose/model/order.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/order.js +309 -0
- package/lib/chevre/repo/mongoose/model/ownershipInfo.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/ownershipInfo.js +172 -0
- package/lib/chevre/repo/mongoose/model/place.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/place.js +101 -0
- package/lib/chevre/repo/mongoose/model/priceSpecification.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/priceSpecification.js +133 -0
- package/lib/chevre/repo/mongoose/model/product.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/product.js +98 -0
- package/lib/chevre/repo/mongoose/model/project.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/project.js +0 -0
- package/lib/chevre/repo/mongoose/model/reservation.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/reservation.js +303 -0
- package/lib/chevre/repo/mongoose/model/role.d.ts +7 -0
- package/lib/{repo → chevre/repo}/mongoose/model/role.js +0 -0
- package/lib/chevre/repo/mongoose/model/seller.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/seller.js +86 -0
- package/lib/chevre/repo/mongoose/model/serviceOutput.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/serviceOutput.js +106 -0
- package/lib/chevre/repo/mongoose/model/task.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/task.js +154 -0
- package/lib/chevre/repo/mongoose/model/telemetry.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/telemetry.js +93 -0
- package/lib/chevre/repo/mongoose/model/transaction.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/transaction.js +230 -0
- package/lib/chevre/repo/offer.d.ts +39 -0
- package/lib/chevre/repo/offer.js +450 -0
- package/lib/chevre/repo/offerCatalog.d.ts +25 -0
- package/lib/chevre/repo/offerCatalog.js +209 -0
- package/lib/chevre/repo/order.d.ts +79 -0
- package/lib/chevre/repo/order.js +924 -0
- package/lib/chevre/repo/orderNumber.d.ts +21 -0
- package/lib/chevre/repo/orderNumber.js +90 -0
- package/lib/chevre/repo/ownershipInfo.d.ts +102 -0
- package/lib/chevre/repo/ownershipInfo.js +443 -0
- package/lib/chevre/repo/paymentMethod/creditCard.d.ts +65 -0
- package/lib/{repo → chevre/repo}/paymentMethod/creditCard.js +0 -0
- package/lib/chevre/repo/permit.d.ts +42 -0
- package/lib/chevre/repo/permit.js +72 -0
- package/lib/chevre/repo/person.d.ts +76 -0
- package/lib/chevre/repo/person.js +441 -0
- package/lib/chevre/repo/place.d.ts +118 -0
- package/lib/chevre/repo/place.js +1040 -0
- package/lib/chevre/repo/priceSpecification.d.ts +34 -0
- package/lib/chevre/repo/priceSpecification.js +286 -0
- package/lib/chevre/repo/product.d.ts +51 -0
- package/lib/chevre/repo/product.js +277 -0
- package/lib/chevre/repo/project.d.ts +35 -0
- package/lib/chevre/repo/project.js +135 -0
- package/lib/chevre/repo/rateLimit/offer.d.ts +31 -0
- package/lib/{repo → chevre/repo}/rateLimit/offer.js +0 -0
- package/lib/chevre/repo/reservation.d.ts +104 -0
- package/lib/chevre/repo/reservation.js +1063 -0
- package/lib/chevre/repo/role.d.ts +23 -0
- package/lib/chevre/repo/role.js +113 -0
- package/lib/chevre/repo/seller.d.ts +44 -0
- package/lib/chevre/repo/seller.js +215 -0
- package/lib/chevre/repo/serviceOutput.d.ts +32 -0
- package/lib/chevre/repo/serviceOutput.js +173 -0
- package/lib/chevre/repo/serviceOutputIdentifier.d.ts +15 -0
- package/lib/{repo → chevre/repo}/serviceOutputIdentifier.js +0 -0
- package/lib/chevre/repo/task.d.ts +42 -0
- package/lib/chevre/repo/task.js +316 -0
- package/lib/{repo → chevre/repo}/telemetry.d.ts +0 -0
- package/lib/{repo → chevre/repo}/telemetry.js +0 -0
- package/lib/chevre/repo/transaction.d.ts +132 -0
- package/lib/chevre/repo/transaction.js +589 -0
- package/lib/chevre/repo/transactionNumber.d.ts +19 -0
- package/lib/chevre/repo/transactionNumber.js +89 -0
- package/lib/chevre/repository.d.ts +191 -0
- package/lib/chevre/repository.js +240 -0
- package/lib/chevre/service/account.d.ts +71 -0
- package/lib/chevre/service/account.js +147 -0
- package/lib/{service → chevre/service}/accountTransaction/deposit.d.ts +0 -0
- package/lib/chevre/service/accountTransaction/deposit.js +74 -0
- package/lib/{service → chevre/service}/accountTransaction/factory.d.ts +0 -0
- package/lib/chevre/service/accountTransaction/factory.js +106 -0
- package/lib/chevre/service/accountTransaction/transfer.d.ts +16 -0
- package/lib/chevre/service/accountTransaction/transfer.js +106 -0
- package/lib/chevre/service/accountTransaction/withdraw.d.ts +16 -0
- package/lib/chevre/service/accountTransaction/withdraw.js +85 -0
- package/lib/chevre/service/accountTransaction.d.ts +20 -0
- package/lib/chevre/service/accountTransaction.js +60 -0
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +30 -0
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +447 -0
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +15 -0
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +170 -0
- package/lib/chevre/service/aggregation/event/importFromCOA.d.ts +16 -0
- package/lib/chevre/service/aggregation/event/importFromCOA.js +104 -0
- package/lib/chevre/service/aggregation/event.d.ts +7 -0
- package/lib/chevre/service/aggregation/event.js +12 -0
- package/lib/{service → chevre/service}/aggregation/project.d.ts +0 -0
- package/lib/chevre/service/aggregation/project.js +122 -0
- package/lib/{service → chevre/service}/aggregation.d.ts +0 -0
- package/lib/{service → chevre/service}/aggregation.js +0 -0
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +14 -0
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +74 -0
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +35 -0
- package/lib/chevre/service/assetTransaction/cancelReservation.js +243 -0
- package/lib/{service/transaction → chevre/service/assetTransaction}/moneyTransfer/potentialActions.d.ts +0 -0
- package/lib/chevre/service/assetTransaction/moneyTransfer/potentialActions.js +117 -0
- package/lib/chevre/service/assetTransaction/moneyTransfer.d.ts +49 -0
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +433 -0
- package/lib/chevre/service/assetTransaction/pay/account/validation.d.ts +8 -0
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +50 -0
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +10 -0
- package/lib/chevre/service/assetTransaction/pay/factory.js +98 -0
- package/lib/chevre/service/assetTransaction/pay/movieTicket/validation.d.ts +14 -0
- package/lib/chevre/service/assetTransaction/pay/movieTicket/validation.js +79 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions.d.ts +10 -0
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +261 -0
- package/lib/chevre/service/assetTransaction/pay.d.ts +112 -0
- package/lib/chevre/service/assetTransaction/pay.js +480 -0
- package/lib/chevre/service/assetTransaction/refund/factory.d.ts +10 -0
- package/lib/chevre/service/assetTransaction/refund/factory.js +53 -0
- package/lib/{service/transaction → chevre/service/assetTransaction}/refund/potentialActions.d.ts +0 -0
- package/lib/chevre/service/assetTransaction/refund/potentialActions.js +78 -0
- package/lib/chevre/service/assetTransaction/refund.d.ts +46 -0
- package/lib/chevre/service/assetTransaction/refund.js +229 -0
- package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +19 -0
- package/lib/chevre/service/assetTransaction/registerService/factory.js +128 -0
- package/lib/{service/transaction → chevre/service/assetTransaction}/registerService/potentialActions.d.ts +0 -0
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +140 -0
- package/lib/chevre/service/assetTransaction/registerService.d.ts +49 -0
- package/lib/chevre/service/assetTransaction/registerService.js +306 -0
- package/lib/chevre/service/assetTransaction/reserve/factory/price.d.ts +14 -0
- package/lib/chevre/service/assetTransaction/reserve/factory/price.js +198 -0
- package/lib/chevre/service/assetTransaction/reserve/factory.d.ts +74 -0
- package/lib/chevre/service/assetTransaction/reserve/factory.js +554 -0
- package/lib/chevre/service/assetTransaction/reserve.d.ts +83 -0
- package/lib/chevre/service/assetTransaction/reserve.js +801 -0
- package/lib/chevre/service/assetTransaction.d.ts +36 -0
- package/lib/chevre/service/assetTransaction.js +87 -0
- package/lib/chevre/service/code.d.ts +36 -0
- package/lib/chevre/service/code.js +146 -0
- package/lib/chevre/service/delivery/factory.d.ts +8 -0
- package/lib/chevre/service/delivery/factory.js +111 -0
- package/lib/chevre/service/delivery/product/factory.d.ts +13 -0
- package/lib/chevre/service/delivery/product/factory.js +67 -0
- package/lib/chevre/service/delivery/reservation/factory.d.ts +13 -0
- package/lib/chevre/service/delivery/reservation/factory.js +54 -0
- package/lib/chevre/service/delivery.d.ts +28 -0
- package/lib/chevre/service/delivery.js +273 -0
- package/lib/chevre/service/event.d.ts +72 -0
- package/lib/chevre/service/event.js +744 -0
- package/lib/{service → chevre/service}/iam.d.ts +0 -0
- package/lib/{service → chevre/service}/iam.js +0 -0
- package/lib/chevre/service/moneyTransfer.d.ts +76 -0
- package/lib/chevre/service/moneyTransfer.js +602 -0
- package/lib/chevre/service/notification/factory.d.ts +12 -0
- package/lib/chevre/service/notification/factory.js +57 -0
- package/lib/{service → chevre/service}/notification.d.ts +0 -0
- package/lib/chevre/service/notification.js +211 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +60 -0
- package/lib/chevre/service/offer/event/authorize.js +387 -0
- package/lib/chevre/service/offer/event/cancel.d.ts +44 -0
- package/lib/chevre/service/offer/event/cancel.js +46 -0
- package/lib/chevre/service/offer/event/factory.d.ts +42 -0
- package/lib/chevre/service/offer/event/factory.js +320 -0
- package/lib/chevre/service/offer/event/importFromCOA.d.ts +13 -0
- package/lib/chevre/service/offer/event/importFromCOA.js +64 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +76 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +317 -0
- package/lib/chevre/service/offer/event/voidTransaction.d.ts +22 -0
- package/lib/chevre/service/offer/event/voidTransaction.js +123 -0
- package/lib/chevre/service/offer/event.d.ts +6 -0
- package/lib/chevre/service/offer/event.js +13 -0
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +25 -0
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +223 -0
- package/lib/chevre/service/offer/eventServiceByCOA.d.ts +83 -0
- package/lib/chevre/service/offer/eventServiceByCOA.js +258 -0
- package/lib/chevre/service/offer/factory.d.ts +12 -0
- package/lib/chevre/service/offer/factory.js +58 -0
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +28 -0
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +181 -0
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.d.ts +16 -0
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +83 -0
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +7 -0
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +35 -0
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +9 -0
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +66 -0
- package/lib/chevre/service/offer/moneyTransfer.d.ts +5 -0
- package/lib/chevre/service/offer/moneyTransfer.js +11 -0
- package/lib/chevre/service/offer/product/factory.d.ts +24 -0
- package/lib/chevre/service/offer/product/factory.js +125 -0
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +14 -0
- package/lib/chevre/service/offer/product/searchProductOffers.js +46 -0
- package/lib/chevre/service/offer/product.d.ts +97 -0
- package/lib/chevre/service/offer/product.js +419 -0
- package/lib/chevre/service/offer.d.ts +80 -0
- package/lib/chevre/service/offer.js +253 -0
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +5 -0
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +78 -0
- package/lib/chevre/service/order/deleteOrder.d.ts +16 -0
- package/lib/chevre/service/order/deleteOrder.js +75 -0
- package/lib/chevre/service/order/findPlaceOrderTransaction.d.ts +11 -0
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +37 -0
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +20 -0
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +284 -0
- package/lib/chevre/service/order/onOrderStatusChanged.d.ts +14 -0
- package/lib/chevre/service/order/onOrderStatusChanged.js +363 -0
- package/lib/chevre/service/order/placeOrder.d.ts +47 -0
- package/lib/chevre/service/order/placeOrder.js +248 -0
- package/lib/chevre/service/order/returnOrder.d.ts +26 -0
- package/lib/chevre/service/order/returnOrder.js +208 -0
- package/lib/chevre/service/order/sendOrder.d.ts +30 -0
- package/lib/chevre/service/order/sendOrder.js +179 -0
- package/lib/chevre/service/order.d.ts +9 -0
- package/lib/chevre/service/order.js +17 -0
- package/lib/chevre/service/payment/any/factory.d.ts +27 -0
- package/lib/chevre/service/payment/any/factory.js +147 -0
- package/lib/chevre/service/payment/any/onPaid.d.ts +16 -0
- package/lib/chevre/service/payment/any/onPaid.js +52 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.d.ts +6 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onPaid.js +73 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.d.ts +6 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged/onRefunded.js +49 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.d.ts +10 -0
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +94 -0
- package/lib/chevre/service/payment/any/onRefund.d.ts +16 -0
- package/lib/chevre/service/payment/any/onRefund.js +98 -0
- package/lib/chevre/service/payment/any/person2username.d.ts +3 -0
- package/lib/chevre/service/payment/any/person2username.js +52 -0
- package/lib/chevre/service/payment/any.d.ts +105 -0
- package/lib/chevre/service/payment/any.js +293 -0
- package/lib/chevre/service/payment/creditCard.d.ts +79 -0
- package/lib/chevre/service/payment/creditCard.js +564 -0
- package/lib/chevre/service/payment/faceToFace.d.ts +32 -0
- package/lib/chevre/service/payment/faceToFace.js +68 -0
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +14 -0
- package/lib/chevre/service/payment/movieTicket/factory.js +79 -0
- package/lib/chevre/service/payment/movieTicket.d.ts +89 -0
- package/lib/chevre/service/payment/movieTicket.js +589 -0
- package/lib/chevre/service/payment/paymentCard.d.ts +31 -0
- package/lib/chevre/service/payment/paymentCard.js +381 -0
- package/lib/chevre/service/payment.d.ts +46 -0
- package/lib/chevre/service/payment.js +91 -0
- package/lib/chevre/service/permit.d.ts +41 -0
- package/lib/chevre/service/permit.js +110 -0
- package/lib/{service → chevre/service}/product.d.ts +0 -0
- package/lib/chevre/service/product.js +84 -0
- package/lib/chevre/service/project.d.ts +57 -0
- package/lib/chevre/service/project.js +40 -0
- package/lib/chevre/service/report/ownershipInfo.d.ts +25 -0
- package/lib/chevre/service/report/ownershipInfo.js +34 -0
- package/lib/chevre/service/report/telemetry.d.ts +317 -0
- package/lib/chevre/service/report/telemetry.js +440 -0
- package/lib/chevre/service/report.d.ts +6 -0
- package/lib/chevre/service/report.js +10 -0
- package/lib/chevre/service/reserve/cancelReservation.d.ts +37 -0
- package/lib/chevre/service/reserve/cancelReservation.js +246 -0
- package/lib/chevre/service/reserve/checkInReservation.d.ts +29 -0
- package/lib/chevre/service/reserve/checkInReservation.js +40 -0
- package/lib/chevre/service/reserve/confirmReservation.d.ts +15 -0
- package/lib/chevre/service/reserve/confirmReservation.js +58 -0
- package/lib/chevre/service/reserve/factory.d.ts +51 -0
- package/lib/chevre/service/reserve/factory.js +15 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +13 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +104 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +25 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +125 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +16 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +94 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +11 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +141 -0
- package/lib/chevre/service/reserve/useReservation.d.ts +35 -0
- package/lib/chevre/service/reserve/useReservation.js +121 -0
- package/lib/chevre/service/reserve.d.ts +9 -0
- package/lib/chevre/service/reserve.js +17 -0
- package/lib/{service → chevre/service}/task/accountMoneyTransfer.d.ts +0 -0
- package/lib/chevre/service/task/accountMoneyTransfer.js +31 -0
- package/lib/{service → chevre/service}/task/aggregateScreeningEvent.d.ts +0 -0
- package/lib/chevre/service/task/aggregateScreeningEvent.js +45 -0
- package/lib/chevre/service/task/aggregateUseActionsOnEvent.d.ts +7 -0
- package/lib/chevre/service/task/aggregateUseActionsOnEvent.js +37 -0
- package/lib/{service → chevre/service}/task/cancelAccountMoneyTransfer.d.ts +0 -0
- package/lib/chevre/service/task/cancelAccountMoneyTransfer.js +33 -0
- package/lib/{service → chevre/service}/task/cancelMoneyTransfer.d.ts +0 -0
- package/lib/chevre/service/task/cancelMoneyTransfer.js +29 -0
- package/lib/{service → chevre/service}/task/cancelPendingReservation.d.ts +0 -0
- package/lib/chevre/service/task/cancelPendingReservation.js +45 -0
- package/lib/{service → chevre/service}/task/cancelReservation.d.ts +0 -0
- package/lib/chevre/service/task/cancelReservation.js +45 -0
- package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +6 -0
- package/lib/chevre/service/task/confirmMoneyTransfer.js +29 -0
- package/lib/chevre/service/task/confirmPayTransaction.d.ts +6 -0
- package/lib/chevre/service/task/confirmPayTransaction.js +62 -0
- package/lib/chevre/service/task/confirmRegisterService.d.ts +6 -0
- package/lib/chevre/service/task/confirmRegisterService.js +29 -0
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +17 -0
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +101 -0
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +17 -0
- package/lib/chevre/service/task/confirmReserveTransaction.js +96 -0
- package/lib/chevre/service/task/deleteAssetTransaction.d.ts +12 -0
- package/lib/chevre/service/task/deleteAssetTransaction.js +65 -0
- package/lib/chevre/service/task/deleteAuthorization.d.ts +6 -0
- package/lib/chevre/service/task/deleteAuthorization.js +29 -0
- package/lib/chevre/service/task/deleteOrder.d.ts +6 -0
- package/lib/chevre/service/task/deleteOrder.js +35 -0
- package/lib/chevre/service/task/deleteTransaction.d.ts +6 -0
- package/lib/chevre/service/task/deleteTransaction.js +35 -0
- package/lib/chevre/service/task/givePointAward.d.ts +6 -0
- package/lib/chevre/service/task/givePointAward.js +42 -0
- package/lib/{service → chevre/service}/task/importEventCapacitiesFromCOA.d.ts +0 -0
- package/lib/{service → chevre/service}/task/importEventCapacitiesFromCOA.js +0 -0
- package/lib/{service → chevre/service}/task/importEventsFromCOA.d.ts +0 -0
- package/lib/chevre/service/task/importEventsFromCOA.js +31 -0
- package/lib/{service → chevre/service}/task/importOffersFromCOA.d.ts +0 -0
- package/lib/chevre/service/task/importOffersFromCOA.js +40 -0
- package/lib/{service → chevre/service}/task/moneyTransfer.d.ts +0 -0
- package/lib/chevre/service/task/moneyTransfer.js +36 -0
- package/lib/chevre/service/task/orderProgramMembership.d.ts +6 -0
- package/lib/chevre/service/task/orderProgramMembership.js +98 -0
- package/lib/{service → chevre/service}/task/pay.d.ts +0 -0
- package/lib/chevre/service/task/pay.js +44 -0
- package/lib/chevre/service/task/placeOrder.d.ts +6 -0
- package/lib/chevre/service/task/placeOrder.js +45 -0
- package/lib/{service → chevre/service}/task/refund.d.ts +0 -0
- package/lib/chevre/service/task/refund.js +51 -0
- package/lib/{service → chevre/service}/task/registerService.d.ts +0 -0
- package/lib/{service → chevre/service}/task/registerService.js +0 -0
- package/lib/{service → chevre/service}/task/reserve.d.ts +0 -0
- package/lib/{service → chevre/service}/task/reserve.js +0 -0
- package/lib/chevre/service/task/returnMoneyTransfer.d.ts +6 -0
- package/lib/chevre/service/task/returnMoneyTransfer.js +42 -0
- package/lib/chevre/service/task/returnOrder.d.ts +6 -0
- package/lib/chevre/service/task/returnOrder.js +45 -0
- package/lib/chevre/service/task/returnPayTransaction.d.ts +6 -0
- package/lib/chevre/service/task/returnPayTransaction.js +220 -0
- package/lib/chevre/service/task/returnPointAward.d.ts +6 -0
- package/lib/chevre/service/task/returnPointAward.js +42 -0
- package/lib/chevre/service/task/returnReserveTransaction.d.ts +6 -0
- package/lib/chevre/service/task/returnReserveTransaction.js +123 -0
- package/lib/{service → chevre/service}/task/sendEmailMessage.d.ts +0 -0
- package/lib/{service → chevre/service}/task/sendEmailMessage.js +0 -0
- package/lib/chevre/service/task/sendOrder.d.ts +6 -0
- package/lib/chevre/service/task/sendOrder.js +45 -0
- package/lib/{service → chevre/service}/task/triggerWebhook.d.ts +0 -0
- package/lib/{service → chevre/service}/task/triggerWebhook.js +0 -0
- package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +6 -0
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +32 -0
- package/lib/chevre/service/task/voidPayTransaction.d.ts +6 -0
- package/lib/chevre/service/task/voidPayTransaction.js +47 -0
- package/lib/{service → chevre/service}/task/voidPayment.d.ts +0 -0
- package/lib/chevre/service/task/voidPayment.js +41 -0
- package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +6 -0
- package/lib/chevre/service/task/voidRegisterServiceTransaction.js +39 -0
- package/lib/chevre/service/task/voidReserveTransaction.d.ts +6 -0
- package/lib/chevre/service/task/voidReserveTransaction.js +45 -0
- package/lib/chevre/service/task.d.ts +47 -0
- package/lib/chevre/service/task.js +133 -0
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.d.ts +8 -0
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +87 -0
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +2 -0
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +26 -0
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +8 -0
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +72 -0
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +63 -0
- package/lib/chevre/service/transaction/moneyTransfer.js +582 -0
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.d.ts +23 -0
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +132 -0
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.d.ts +26 -0
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +65 -0
- package/lib/chevre/service/transaction/orderProgramMembership.d.ts +50 -0
- package/lib/chevre/service/transaction/orderProgramMembership.js +340 -0
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +8 -0
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +156 -0
- package/lib/chevre/service/transaction/placeOrder.d.ts +16 -0
- package/lib/chevre/service/transaction/placeOrder.js +44 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.d.ts +2 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +29 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.d.ts +6 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmPay.js +65 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.d.ts +11 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/confirmReservation.js +187 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.d.ts +5 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js +64 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.d.ts +6 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +84 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.d.ts +5 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +160 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.d.ts +7 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.js +61 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.d.ts +12 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +90 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.d.ts +22 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +152 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result.d.ts +12 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +94 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.d.ts +5 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +178 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +5 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.js +19 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.d.ts +49 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +247 -0
- package/lib/chevre/service/transaction/placeOrderInProgress.d.ts +143 -0
- package/lib/chevre/service/transaction/placeOrderInProgress.js +354 -0
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.d.ts +8 -0
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +71 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.d.ts +6 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +81 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.d.ts +6 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +192 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +9 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +106 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.d.ts +6 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +60 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions.d.ts +13 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +86 -0
- package/lib/chevre/service/transaction/returnOrder.d.ts +56 -0
- package/lib/chevre/service/transaction/returnOrder.js +385 -0
- package/lib/chevre/service/transaction/validation.d.ts +8 -0
- package/lib/chevre/service/transaction/validation.js +43 -0
- package/lib/chevre/service/transaction.d.ts +58 -0
- package/lib/chevre/service/transaction.js +265 -0
- package/lib/chevre/service/util.d.ts +19 -0
- package/lib/{service → chevre/service}/util.js +0 -0
- package/lib/chevre/service.d.ts +49 -0
- package/lib/chevre/service.js +55 -0
- package/lib/chevre/settings.d.ts +29 -0
- package/lib/chevre/settings.js +89 -0
- package/lib/index.d.ts +3 -54
- package/lib/index.js +5 -21
- package/package.json +44 -41
- package/CHANGELOG.md +0 -968
- package/example/.gitignore +0 -1
- package/example/aggregateAllEvents.js +0 -58
- package/example/aggregateOnProject.js +0 -34
- package/example/aggregateScreeningEvent.js +0 -39
- package/example/assetTransaction/invalidatePaymentUrl.js +0 -83
- package/example/assetTransaction/payCreditCard.js +0 -90
- package/example/assetTransaction/searchGMOTrade.js +0 -24
- package/example/cleanOwnershipInfos.js +0 -46
- package/example/cleanTasks.js +0 -34
- package/example/copyRedisKeys.js +0 -96
- package/example/createManyTasks.js +0 -42
- package/example/createSeats.js +0 -48
- package/example/createServiceOutputs.js +0 -123
- package/example/deleteProject.js +0 -34
- package/example/downloadReservationReport.js +0 -32
- package/example/downloadTransactions.js +0 -140
- package/example/expireTransactions.js +0 -51
- package/example/importEventCapacitiesFromCOA.js +0 -21
- package/example/importEventsFromCOA.js +0 -23
- package/example/importOffersFromCOA.js +0 -28
- package/example/initials/accountTitles.json +0 -2804
- package/example/initials/initializeAccountTitles.js +0 -22
- package/example/initials/screens.json +0 -12846
- package/example/initials/screensCsv2Json.js +0 -46
- package/example/lockIfNotLimitExceeded.js +0 -44
- package/example/lockOfferRateLimit.js +0 -42
- package/example/migrateAccount2permit.js +0 -63
- package/example/migrateAccount2serviceOutput.js +0 -95
- package/example/migrateAccountActions.js +0 -60
- package/example/migrateAccounts.js +0 -55
- package/example/migrateMovieDistributor.js +0 -51
- package/example/migrateOfferAvailableAtOrFrom.js +0 -64
- package/example/migrateOwnershipInfos.js +0 -69
- package/example/migratePaymentCardServiceOutput.js +0 -62
- package/example/migrateProductServiceType.js +0 -63
- package/example/migrateReservationIssuedThrough.js +0 -70
- package/example/migrateSalesReports.js +0 -76
- package/example/migrateSection.js +0 -101
- package/example/migrateServiceOutputOwnershipInfo2permit.js +0 -28
- package/example/momentTest.js +0 -9
- package/example/ownershipInfosCsv2peopleJson.js +0 -153
- package/example/processCancelReservation.js +0 -30
- package/example/processMoneyTransfer.js +0 -87
- package/example/processPayAccount.js +0 -154
- package/example/processPayCreditCard.js +0 -169
- package/example/processPayMGTicket.js +0 -82
- package/example/processPayMovieTicket.js +0 -192
- package/example/processRegisterMembership.js +0 -121
- package/example/processRegisterMoneyTransfer.js +0 -117
- package/example/processRegisterPaymentCard.js +0 -112
- package/example/projectPaymentServices2products.js +0 -59
- package/example/publishServiceOutputIdentifier.js +0 -22
- package/example/publishTransactionNumber.js +0 -22
- package/example/reIndex.js +0 -13
- package/example/readRedis.js +0 -49
- package/example/renameTransaction.js +0 -17
- package/example/rescheduleEvents.js +0 -58
- package/example/searcScreeningRooms.js +0 -63
- package/example/searchBugAccounts.js +0 -80
- package/example/searchEventItemAvailability.js +0 -42
- package/example/searchEventSeats.js +0 -28
- package/example/searchEvents.js +0 -30
- package/example/searchEventsOffers.js +0 -29
- package/example/searchOffers.js +0 -29
- package/example/searchPriceSpecifications.js +0 -25
- package/example/searchProducts.js +0 -36
- package/example/searchReservations.js +0 -52
- package/example/searchSellers.js +0 -22
- package/example/streamOwnershipInfos.js +0 -56
- package/example/unsetSellerLegalNames.js +0 -57
- package/example/updateEventOfferCatalogs.js +0 -55
- package/lib/credentials.d.ts +0 -39
- package/lib/credentials.js +0 -43
- package/lib/errorHandler.d.ts +0 -25
- package/lib/errorHandler.js +0 -155
- package/lib/factory.js +0 -16
- package/lib/repo/account.d.ts +0 -131
- package/lib/repo/account.js +0 -426
- package/lib/repo/accountAction.d.ts +0 -51
- package/lib/repo/accountAction.js +0 -412
- package/lib/repo/accountTitle.d.ts +0 -9
- package/lib/repo/accountTitle.js +0 -14
- package/lib/repo/accountTransaction.d.ts +0 -65
- package/lib/repo/accountTransaction.js +0 -268
- package/lib/repo/accountingReport.d.ts +0 -8
- package/lib/repo/accountingReport.js +0 -13
- package/lib/repo/action/registerServiceInProgress.d.ts +0 -29
- package/lib/repo/action/registerServiceInProgress.js +0 -95
- package/lib/repo/action.d.ts +0 -74
- package/lib/repo/action.js +0 -591
- package/lib/repo/assetTransaction.d.ts +0 -90
- package/lib/repo/assetTransaction.js +0 -415
- package/lib/repo/categoryCode.d.ts +0 -24
- package/lib/repo/categoryCode.js +0 -194
- package/lib/repo/code.d.ts +0 -40
- package/lib/repo/code.js +0 -240
- package/lib/repo/confirmationNumber.d.ts +0 -15
- package/lib/repo/confirmationNumber.js +0 -68
- package/lib/repo/creativeWork.d.ts +0 -35
- package/lib/repo/creativeWork.js +0 -214
- package/lib/repo/customer.d.ts +0 -24
- package/lib/repo/customer.js +0 -122
- package/lib/repo/emailMessage.d.ts +0 -37
- package/lib/repo/emailMessage.js +0 -110
- package/lib/repo/event.d.ts +0 -42
- package/lib/repo/event.js +0 -461
- package/lib/repo/invoice.d.ts +0 -26
- package/lib/repo/invoice.js +0 -262
- package/lib/repo/itemAvailability/screeningEvent.d.ts +0 -75
- package/lib/repo/member.d.ts +0 -15
- package/lib/repo/member.js +0 -149
- package/lib/repo/mongoose/model/account.d.ts +0 -7
- package/lib/repo/mongoose/model/account.js +0 -73
- package/lib/repo/mongoose/model/accountAction.d.ts +0 -7
- package/lib/repo/mongoose/model/accountAction.js +0 -180
- package/lib/repo/mongoose/model/accountTitle.d.ts +0 -3
- package/lib/repo/mongoose/model/accountTitle.js +0 -106
- package/lib/repo/mongoose/model/accountTransaction.d.ts +0 -7
- package/lib/repo/mongoose/model/accountTransaction.js +0 -144
- package/lib/repo/mongoose/model/accountingReport.d.ts +0 -7
- package/lib/repo/mongoose/model/action.d.ts +0 -7
- package/lib/repo/mongoose/model/action.js +0 -247
- package/lib/repo/mongoose/model/aggregateSale.d.ts +0 -3
- package/lib/repo/mongoose/model/aggregateSale.js +0 -100
- package/lib/repo/mongoose/model/assetTransaction.d.ts +0 -7
- package/lib/repo/mongoose/model/assetTransaction.js +0 -131
- package/lib/repo/mongoose/model/authorization.d.ts +0 -7
- package/lib/repo/mongoose/model/authorization.js +0 -103
- package/lib/repo/mongoose/model/categoryCode.d.ts +0 -7
- package/lib/repo/mongoose/model/categoryCode.js +0 -86
- package/lib/repo/mongoose/model/creativeWork.d.ts +0 -3
- package/lib/repo/mongoose/model/creativeWork.js +0 -109
- package/lib/repo/mongoose/model/customer.d.ts +0 -7
- package/lib/repo/mongoose/model/emailMessages.d.ts +0 -7
- package/lib/repo/mongoose/model/event.d.ts +0 -3
- package/lib/repo/mongoose/model/event.js +0 -193
- package/lib/repo/mongoose/model/invoice.d.ts +0 -7
- package/lib/repo/mongoose/model/invoice.js +0 -76
- package/lib/repo/mongoose/model/member.d.ts +0 -7
- package/lib/repo/mongoose/model/offer.d.ts +0 -3
- package/lib/repo/mongoose/model/offer.js +0 -187
- package/lib/repo/mongoose/model/offerCatalog.d.ts +0 -3
- package/lib/repo/mongoose/model/offerCatalog.js +0 -73
- package/lib/repo/mongoose/model/order.d.ts +0 -7
- package/lib/repo/mongoose/model/order.js +0 -292
- package/lib/repo/mongoose/model/ownershipInfo.d.ts +0 -7
- package/lib/repo/mongoose/model/ownershipInfo.js +0 -172
- package/lib/repo/mongoose/model/paymentMethod.d.ts +0 -7
- package/lib/repo/mongoose/model/paymentMethod.js +0 -58
- package/lib/repo/mongoose/model/place.d.ts +0 -3
- package/lib/repo/mongoose/model/place.js +0 -100
- package/lib/repo/mongoose/model/priceSpecification.d.ts +0 -3
- package/lib/repo/mongoose/model/priceSpecification.js +0 -139
- package/lib/repo/mongoose/model/product.d.ts +0 -7
- package/lib/repo/mongoose/model/product.js +0 -101
- package/lib/repo/mongoose/model/programMembership.d.ts +0 -7
- package/lib/repo/mongoose/model/programMembership.js +0 -53
- package/lib/repo/mongoose/model/project.d.ts +0 -7
- package/lib/repo/mongoose/model/reservation.d.ts +0 -3
- package/lib/repo/mongoose/model/reservation.js +0 -296
- package/lib/repo/mongoose/model/role.d.ts +0 -7
- package/lib/repo/mongoose/model/seller.d.ts +0 -7
- package/lib/repo/mongoose/model/seller.js +0 -89
- package/lib/repo/mongoose/model/serviceOutput.d.ts +0 -7
- package/lib/repo/mongoose/model/serviceOutput.js +0 -109
- package/lib/repo/mongoose/model/task.d.ts +0 -7
- package/lib/repo/mongoose/model/task.js +0 -136
- package/lib/repo/mongoose/model/telemetry.d.ts +0 -7
- package/lib/repo/mongoose/model/telemetry.js +0 -96
- package/lib/repo/mongoose/model/transaction.d.ts +0 -7
- package/lib/repo/mongoose/model/transaction.js +0 -233
- package/lib/repo/offer.d.ts +0 -36
- package/lib/repo/offer.js +0 -436
- package/lib/repo/offerCatalog.d.ts +0 -20
- package/lib/repo/offerCatalog.js +0 -183
- package/lib/repo/order.d.ts +0 -42
- package/lib/repo/order.js +0 -766
- package/lib/repo/orderNumber.d.ts +0 -21
- package/lib/repo/orderNumber.js +0 -86
- package/lib/repo/ownershipInfo.d.ts +0 -24
- package/lib/repo/ownershipInfo.js +0 -324
- package/lib/repo/paymentMethod/creditCard.d.ts +0 -65
- package/lib/repo/paymentMethod.d.ts +0 -12
- package/lib/repo/paymentMethod.js +0 -104
- package/lib/repo/person.d.ts +0 -76
- package/lib/repo/person.js +0 -426
- package/lib/repo/place.d.ts +0 -27
- package/lib/repo/place.js +0 -346
- package/lib/repo/priceSpecification.d.ts +0 -13
- package/lib/repo/priceSpecification.js +0 -219
- package/lib/repo/product.d.ts +0 -27
- package/lib/repo/product.js +0 -217
- package/lib/repo/programMembership.d.ts +0 -8
- package/lib/repo/programMembership.js +0 -13
- package/lib/repo/project.d.ts +0 -18
- package/lib/repo/project.js +0 -96
- package/lib/repo/rateLimit/offer.d.ts +0 -33
- package/lib/repo/report.d.ts +0 -14
- package/lib/repo/report.js +0 -37
- package/lib/repo/reservation.d.ts +0 -50
- package/lib/repo/reservation.js +0 -933
- package/lib/repo/role.d.ts +0 -23
- package/lib/repo/role.js +0 -114
- package/lib/repo/seller.d.ts +0 -35
- package/lib/repo/seller.js +0 -188
- package/lib/repo/serviceOutput.d.ts +0 -11
- package/lib/repo/serviceOutput.js +0 -135
- package/lib/repo/serviceOutputIdentifier.d.ts +0 -15
- package/lib/repo/task.d.ts +0 -43
- package/lib/repo/task.js +0 -253
- package/lib/repo/transaction.d.ts +0 -107
- package/lib/repo/transaction.js +0 -545
- package/lib/repo/transactionNumber.d.ts +0 -15
- package/lib/repo/transactionNumber.js +0 -89
- package/lib/repository.d.ts +0 -200
- package/lib/repository.js +0 -251
- package/lib/service/account.d.ts +0 -71
- package/lib/service/account.js +0 -147
- package/lib/service/accountTransaction/deposit.js +0 -73
- package/lib/service/accountTransaction/factory.js +0 -64
- package/lib/service/accountTransaction/transfer.d.ts +0 -13
- package/lib/service/accountTransaction/transfer.js +0 -104
- package/lib/service/accountTransaction/withdraw.d.ts +0 -13
- package/lib/service/accountTransaction/withdraw.js +0 -79
- package/lib/service/accountTransaction.d.ts +0 -44
- package/lib/service/accountTransaction.js +0 -125
- package/lib/service/aggregation/event.d.ts +0 -41
- package/lib/service/aggregation/event.js +0 -588
- package/lib/service/aggregation/project.js +0 -111
- package/lib/service/event.d.ts +0 -87
- package/lib/service/event.js +0 -683
- package/lib/service/moneyTransfer.d.ts +0 -62
- package/lib/service/moneyTransfer.js +0 -358
- package/lib/service/notification/factory.d.ts +0 -9
- package/lib/service/notification/factory.js +0 -32
- package/lib/service/notification.js +0 -203
- package/lib/service/offer/factory.d.ts +0 -18
- package/lib/service/offer/factory.js +0 -100
- package/lib/service/offer.d.ts +0 -98
- package/lib/service/offer.js +0 -444
- package/lib/service/payment/account.d.ts +0 -26
- package/lib/service/payment/account.js +0 -293
- package/lib/service/payment/any.d.ts +0 -26
- package/lib/service/payment/any.js +0 -119
- package/lib/service/payment/creditCard.d.ts +0 -81
- package/lib/service/payment/creditCard.js +0 -524
- package/lib/service/payment/faceToFace.d.ts +0 -28
- package/lib/service/payment/faceToFace.js +0 -67
- package/lib/service/payment/movieTicket/factory.d.ts +0 -14
- package/lib/service/payment/movieTicket/factory.js +0 -79
- package/lib/service/payment/movieTicket.d.ts +0 -76
- package/lib/service/payment/movieTicket.js +0 -533
- package/lib/service/payment.d.ts +0 -44
- package/lib/service/payment.js +0 -91
- package/lib/service/product.js +0 -104
- package/lib/service/project.d.ts +0 -41
- package/lib/service/project.js +0 -86
- package/lib/service/report/order.d.ts +0 -121
- package/lib/service/report/order.js +0 -458
- package/lib/service/report/ownershipInfo.d.ts +0 -36
- package/lib/service/report/ownershipInfo.js +0 -104
- package/lib/service/report/reservation.d.ts +0 -97
- package/lib/service/report/reservation.js +0 -366
- package/lib/service/report/salesReport.d.ts +0 -15
- package/lib/service/report/salesReport.js +0 -226
- package/lib/service/report/telemetry.d.ts +0 -319
- package/lib/service/report/telemetry.js +0 -477
- package/lib/service/report/transaction.d.ts +0 -71
- package/lib/service/report/transaction.js +0 -297
- package/lib/service/report.d.ts +0 -8
- package/lib/service/report.js +0 -14
- package/lib/service/reserve.d.ts +0 -41
- package/lib/service/reserve.js +0 -344
- package/lib/service/task/accountMoneyTransfer.js +0 -28
- package/lib/service/task/aggregateOnProject.d.ts +0 -7
- package/lib/service/task/aggregateOnProject.js +0 -32
- package/lib/service/task/aggregateScreeningEvent.js +0 -45
- package/lib/service/task/cancelAccountMoneyTransfer.js +0 -31
- package/lib/service/task/cancelMoneyTransfer.js +0 -26
- package/lib/service/task/cancelPendingReservation.js +0 -42
- package/lib/service/task/cancelReservation.js +0 -45
- package/lib/service/task/createOrderReport.d.ts +0 -6
- package/lib/service/task/createOrderReport.js +0 -32
- package/lib/service/task/createReservationReport.d.ts +0 -6
- package/lib/service/task/createReservationReport.js +0 -32
- package/lib/service/task/importEventsFromCOA.js +0 -32
- package/lib/service/task/importOffersFromCOA.js +0 -26
- package/lib/service/task/moneyTransfer.js +0 -39
- package/lib/service/task/pay.js +0 -41
- package/lib/service/task/refund.js +0 -51
- package/lib/service/task/voidPayment.js +0 -38
- package/lib/service/task.d.ts +0 -46
- package/lib/service/task.js +0 -114
- package/lib/service/transaction/cancelReservation/factory.d.ts +0 -14
- package/lib/service/transaction/cancelReservation/factory.js +0 -120
- package/lib/service/transaction/cancelReservation.d.ts +0 -37
- package/lib/service/transaction/cancelReservation.js +0 -207
- package/lib/service/transaction/moneyTransfer/potentialActions.js +0 -68
- package/lib/service/transaction/moneyTransfer.d.ts +0 -55
- package/lib/service/transaction/moneyTransfer.js +0 -420
- package/lib/service/transaction/pay/account/validation.d.ts +0 -12
- package/lib/service/transaction/pay/account/validation.js +0 -76
- package/lib/service/transaction/pay/factory.d.ts +0 -9
- package/lib/service/transaction/pay/factory.js +0 -83
- package/lib/service/transaction/pay/movieTicket/validation.d.ts +0 -14
- package/lib/service/transaction/pay/movieTicket/validation.js +0 -82
- package/lib/service/transaction/pay/potentialActions.d.ts +0 -8
- package/lib/service/transaction/pay/potentialActions.js +0 -135
- package/lib/service/transaction/pay.d.ts +0 -103
- package/lib/service/transaction/pay.js +0 -379
- package/lib/service/transaction/refund/factory.d.ts +0 -9
- package/lib/service/transaction/refund/factory.js +0 -45
- package/lib/service/transaction/refund/potentialActions.js +0 -62
- package/lib/service/transaction/refund.d.ts +0 -47
- package/lib/service/transaction/refund.js +0 -185
- package/lib/service/transaction/registerService/factory.d.ts +0 -19
- package/lib/service/transaction/registerService/factory.js +0 -142
- package/lib/service/transaction/registerService/potentialActions.js +0 -115
- package/lib/service/transaction/registerService.d.ts +0 -49
- package/lib/service/transaction/registerService.js +0 -292
- package/lib/service/transaction/reserve/factory.d.ts +0 -50
- package/lib/service/transaction/reserve/factory.js +0 -411
- package/lib/service/transaction/reserve.d.ts +0 -90
- package/lib/service/transaction/reserve.js +0 -665
- package/lib/service/transaction.d.ts +0 -36
- package/lib/service/transaction.js +0 -87
- package/lib/service/util.d.ts +0 -18
- package/lib/service/webhook/onPaid.d.ts +0 -9
- package/lib/service/webhook/onPaid.js +0 -119
- package/lib/service/webhook/onRefunded.d.ts +0 -9
- package/lib/service/webhook/onRefunded.js +0 -64
- package/lib/service/webhook.d.ts +0 -37
- package/lib/service/webhook.js +0 -192
- package/lib/service.d.ts +0 -29
- package/lib/service.js +0 -32
- package/lib/settings.d.ts +0 -5
- package/lib/settings.js +0 -38
|
@@ -0,0 +1,94 @@
|
|
|
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.onPaymentStatusChanged = void 0;
|
|
13
|
+
const factory = require("../../../factory");
|
|
14
|
+
const onPaid_1 = require("./onPaymentStatusChanged/onPaid");
|
|
15
|
+
const onRefunded_1 = require("./onPaymentStatusChanged/onRefunded");
|
|
16
|
+
/**
|
|
17
|
+
* 決済ステータス変更イベント
|
|
18
|
+
*/
|
|
19
|
+
function onPaymentStatusChanged(params) {
|
|
20
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
// アクションリポジトリから実アクションを参照する
|
|
22
|
+
// そうすることで、通知する情報は最低限で済む
|
|
23
|
+
const action = yield repos.action.findById({ id: params.id, typeOf: params.typeOf });
|
|
24
|
+
const optimizedAction = optimizeAction4report(action);
|
|
25
|
+
switch (optimizedAction.typeOf) {
|
|
26
|
+
case factory.actionType.PayAction:
|
|
27
|
+
yield (0, onPaid_1.onPaid)(optimizedAction)(repos);
|
|
28
|
+
break;
|
|
29
|
+
case factory.actionType.RefundAction:
|
|
30
|
+
yield (0, onRefunded_1.onRefunded)(optimizedAction)(repos);
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
// no op
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
exports.onPaymentStatusChanged = onPaymentStatusChanged;
|
|
38
|
+
/**
|
|
39
|
+
* 経理レポート連携対象としてのアクションを最適化
|
|
40
|
+
*/
|
|
41
|
+
function optimizeAction4report(action) {
|
|
42
|
+
let optimizedAction;
|
|
43
|
+
// 現時点で経理レポートで使用されているのは、typeOf,object,purpose,startDate
|
|
44
|
+
const actionTypeOf = action.typeOf;
|
|
45
|
+
switch (actionTypeOf) {
|
|
46
|
+
case factory.actionType.PayAction:
|
|
47
|
+
const optimizedPayActionObject = action.object.map((o) => {
|
|
48
|
+
return {
|
|
49
|
+
id: o.id,
|
|
50
|
+
paymentMethod: o.paymentMethod,
|
|
51
|
+
typeOf: o.typeOf
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const optimizedPayAction = {
|
|
55
|
+
actionStatus: action.actionStatus,
|
|
56
|
+
endDate: action.endDate,
|
|
57
|
+
id: action.id,
|
|
58
|
+
object: optimizedPayActionObject,
|
|
59
|
+
project: action.project,
|
|
60
|
+
purpose: action.purpose,
|
|
61
|
+
startDate: action.startDate,
|
|
62
|
+
typeOf: action.typeOf
|
|
63
|
+
// 不要なので廃止(2022-05-19~)
|
|
64
|
+
// ...(maskedRecipient !== undefined) ? { recipient: <factory.action.trade.pay.IRecipient>maskedRecipient } : undefined
|
|
65
|
+
};
|
|
66
|
+
optimizedAction = optimizedPayAction;
|
|
67
|
+
break;
|
|
68
|
+
case factory.actionType.RefundAction:
|
|
69
|
+
const optimizedRefundActionObject = action.object.map((o) => {
|
|
70
|
+
return {
|
|
71
|
+
id: o.id,
|
|
72
|
+
paymentMethod: o.paymentMethod,
|
|
73
|
+
typeOf: o.typeOf
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
const optimizedRefundAction = {
|
|
77
|
+
actionStatus: action.actionStatus,
|
|
78
|
+
endDate: action.endDate,
|
|
79
|
+
id: action.id,
|
|
80
|
+
object: optimizedRefundActionObject,
|
|
81
|
+
project: action.project,
|
|
82
|
+
purpose: action.purpose,
|
|
83
|
+
startDate: action.startDate,
|
|
84
|
+
typeOf: action.typeOf
|
|
85
|
+
// 不要なので廃止(2022-05-19~)
|
|
86
|
+
// ...(maskedRecipient !== undefined) ? { recipient: maskedRecipient } : undefined
|
|
87
|
+
};
|
|
88
|
+
optimizedAction = optimizedRefundAction;
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
throw new factory.errors.NotImplemented(`action type '${actionTypeOf}' not implemented`);
|
|
92
|
+
}
|
|
93
|
+
return optimizedAction;
|
|
94
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 汎用決済サービス
|
|
3
|
+
*/
|
|
4
|
+
import * as factory from '../../../factory';
|
|
5
|
+
import { MongoRepository as AccountingReportRepo } from '../../../repo/accountingReport';
|
|
6
|
+
import { MongoRepository as ActionRepo } from '../../../repo/action';
|
|
7
|
+
import { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
8
|
+
/**
|
|
9
|
+
* 返金後のアクション
|
|
10
|
+
*/
|
|
11
|
+
declare function onRefund(refundAction: factory.action.trade.refund.IAction): (repos: {
|
|
12
|
+
action: ActionRepo;
|
|
13
|
+
accountingReport: AccountingReportRepo;
|
|
14
|
+
task: TaskRepo;
|
|
15
|
+
}) => Promise<any[]>;
|
|
16
|
+
export { onRefund };
|
|
@@ -0,0 +1,98 @@
|
|
|
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.onRefund = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* 汎用決済サービス
|
|
15
|
+
*/
|
|
16
|
+
const factory = require("../../../factory");
|
|
17
|
+
const factory_1 = require("./factory");
|
|
18
|
+
const onPaymentStatusChanged_1 = require("./onPaymentStatusChanged");
|
|
19
|
+
/**
|
|
20
|
+
* 返金後のアクション
|
|
21
|
+
*/
|
|
22
|
+
function onRefund(refundAction) {
|
|
23
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
var _a;
|
|
25
|
+
const aciton4inform = (0, factory_1.optimizeAction4inform)(refundAction);
|
|
26
|
+
const potentialActions = refundAction.potentialActions;
|
|
27
|
+
const now = new Date();
|
|
28
|
+
const taskAttributes = [];
|
|
29
|
+
const add2report = potentialActions === null || potentialActions === void 0 ? void 0 : potentialActions.add2report;
|
|
30
|
+
if (add2report === true) {
|
|
31
|
+
// 同期的に経理レポート連携する(2022-08-27~)
|
|
32
|
+
yield (0, onPaymentStatusChanged_1.onPaymentStatusChanged)(aciton4inform)(repos);
|
|
33
|
+
}
|
|
34
|
+
const informPayment = potentialActions === null || potentialActions === void 0 ? void 0 : potentialActions.informPayment;
|
|
35
|
+
// 手数料決済があれば処理
|
|
36
|
+
const refundFee = (_a = refundAction.object[0]) === null || _a === void 0 ? void 0 : _a.refundFee;
|
|
37
|
+
if (typeof refundFee === 'number' && refundFee > 0) {
|
|
38
|
+
const payObject = refundAction.object.map((o) => {
|
|
39
|
+
return {
|
|
40
|
+
typeOf: o.typeOf,
|
|
41
|
+
id: o.id,
|
|
42
|
+
paymentMethod: {
|
|
43
|
+
accountId: o.paymentMethod.accountId,
|
|
44
|
+
additionalProperty: o.paymentMethod.additionalProperty,
|
|
45
|
+
name: o.paymentMethod.name,
|
|
46
|
+
paymentMethodId: o.paymentMethod.paymentMethodId,
|
|
47
|
+
totalPaymentDue: {
|
|
48
|
+
typeOf: 'MonetaryAmount',
|
|
49
|
+
currency: factory.priceCurrency.JPY,
|
|
50
|
+
value: refundFee
|
|
51
|
+
},
|
|
52
|
+
typeOf: o.paymentMethod.typeOf
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const payAction = {
|
|
57
|
+
project: refundAction.project,
|
|
58
|
+
typeOf: factory.actionType.PayAction,
|
|
59
|
+
object: payObject,
|
|
60
|
+
agent: refundAction.recipient,
|
|
61
|
+
recipient: refundAction.agent,
|
|
62
|
+
purpose: refundAction.purpose,
|
|
63
|
+
potentialActions: {
|
|
64
|
+
add2report: true,
|
|
65
|
+
informPayment: (Array.isArray(informPayment)) ? informPayment : []
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const payTask = {
|
|
69
|
+
project: refundAction.project,
|
|
70
|
+
name: factory.taskName.Pay,
|
|
71
|
+
status: factory.taskStatus.Ready,
|
|
72
|
+
runsAt: now,
|
|
73
|
+
remainingNumberOfTries: 10,
|
|
74
|
+
numberOfTried: 0,
|
|
75
|
+
executionResults: [],
|
|
76
|
+
data: payAction
|
|
77
|
+
};
|
|
78
|
+
taskAttributes.push(payTask);
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(informPayment)) {
|
|
81
|
+
taskAttributes.push(...informPayment.map((a) => {
|
|
82
|
+
return {
|
|
83
|
+
project: a.project,
|
|
84
|
+
name: factory.taskName.TriggerWebhook,
|
|
85
|
+
status: factory.taskStatus.Ready,
|
|
86
|
+
runsAt: now,
|
|
87
|
+
remainingNumberOfTries: 10,
|
|
88
|
+
numberOfTried: 0,
|
|
89
|
+
executionResults: [],
|
|
90
|
+
data: Object.assign(Object.assign({}, a), { object: aciton4inform })
|
|
91
|
+
};
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
// タスク保管
|
|
95
|
+
return repos.task.saveMany(taskAttributes);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
exports.onRefund = onRefund;
|
|
@@ -0,0 +1,52 @@
|
|
|
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.person2username = void 0;
|
|
13
|
+
const settings_1 = require("../../../settings");
|
|
14
|
+
const person_1 = require("../../../repo/person");
|
|
15
|
+
const USERPOOL_ID_OLD = settings_1.settings.userPoolIdOld;
|
|
16
|
+
const SSKTS_PROVIDER_NAME = 'SSKTS';
|
|
17
|
+
function person2username(person) {
|
|
18
|
+
var _a, _b, _c, _d;
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
let username = (_a = person.memberOf) === null || _a === void 0 ? void 0 : _a.membershipNumber;
|
|
21
|
+
// ユーザープールが本家の場合とsskstの場合に対応
|
|
22
|
+
// 本家にssktsをプロバイダーとしてログインしている場合、追加特性に以下のような値のidentitiesがあるはず
|
|
23
|
+
// [{"userId":"xxxx","providerName":"SSKTS","providerType":"OIDC"}]
|
|
24
|
+
const userIdentitiesStr = (_c = (_b = person.additionalProperty) === null || _b === void 0 ? void 0 : _b.find((p) => p.name === 'identities')) === null || _c === void 0 ? void 0 : _c.value;
|
|
25
|
+
if (typeof userIdentitiesStr === 'string' && userIdentitiesStr.length > 0) {
|
|
26
|
+
try {
|
|
27
|
+
const identities = JSON.parse(userIdentitiesStr);
|
|
28
|
+
if (Array.isArray(identities) && identities.length > 0) {
|
|
29
|
+
const providerName = identities[0].providerName;
|
|
30
|
+
const userIdByIdentities = identities[0].userId;
|
|
31
|
+
if (providerName === SSKTS_PROVIDER_NAME) {
|
|
32
|
+
if (typeof userIdByIdentities === 'string' && userIdByIdentities.length > 0) {
|
|
33
|
+
const personRepo = new person_1.CognitoRepository({
|
|
34
|
+
userPoolId: USERPOOL_ID_OLD
|
|
35
|
+
});
|
|
36
|
+
// oldUserは必ず存在するはず
|
|
37
|
+
const oldUser = yield personRepo.findById({ userId: userIdByIdentities });
|
|
38
|
+
username = String((_d = oldUser.memberOf) === null || _d === void 0 ? void 0 : _d.membershipNumber);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// tslint:disable-next-line:no-console
|
|
45
|
+
console.error('person2username throwed', error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return username;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
exports.person2username = person2username;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 汎用決済サービス
|
|
3
|
+
*/
|
|
4
|
+
import * as factory from '../../factory';
|
|
5
|
+
import { MongoRepository as AccountingReportRepo } from '../../repo/accountingReport';
|
|
6
|
+
import { MongoRepository as ActionRepo } from '../../repo/action';
|
|
7
|
+
import { MongoRepository as AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
8
|
+
import { MongoRepository as EventRepo } from '../../repo/event';
|
|
9
|
+
import { CognitoRepository as PersonRepo } from '../../repo/person';
|
|
10
|
+
import { MongoRepository as ProductRepo } from '../../repo/product';
|
|
11
|
+
import { MongoRepository as ProjectRepo } from '../../repo/project';
|
|
12
|
+
import { MongoRepository as SellerRepo } from '../../repo/seller';
|
|
13
|
+
import { MongoRepository as TaskRepo } from '../../repo/task';
|
|
14
|
+
import { MongoRepository as TransactionRepo } from '../../repo/transaction';
|
|
15
|
+
import { RedisRepository as TransactionNumberRepo } from '../../repo/transactionNumber';
|
|
16
|
+
import * as PayTransactionService from '../assetTransaction/pay';
|
|
17
|
+
import { onPaymentStatusChanged } from './any/onPaymentStatusChanged';
|
|
18
|
+
import { person2username } from './any/person2username';
|
|
19
|
+
declare type IAuthorizePaymentAction = factory.action.authorize.paymentMethod.any.IAction;
|
|
20
|
+
/**
|
|
21
|
+
* 決済承認中止
|
|
22
|
+
* タスクから決済承認を取り消す
|
|
23
|
+
*/
|
|
24
|
+
declare function voidPayTransaction(params: factory.task.IData<factory.taskName.VoidPayTransaction>): (repos: {
|
|
25
|
+
accountingReport: AccountingReportRepo;
|
|
26
|
+
action: ActionRepo;
|
|
27
|
+
assetTransaction: AssetTransactionRepo;
|
|
28
|
+
product: ProductRepo;
|
|
29
|
+
project: ProjectRepo;
|
|
30
|
+
seller: SellerRepo;
|
|
31
|
+
task: TaskRepo;
|
|
32
|
+
transaction: TransactionRepo;
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
declare function invalidatePaymentUrl(params: factory.task.IData<factory.taskName.VoidPayTransaction>): (repos: {
|
|
35
|
+
accountingReport: AccountingReportRepo;
|
|
36
|
+
action: ActionRepo;
|
|
37
|
+
assetTransaction: AssetTransactionRepo;
|
|
38
|
+
product: ProductRepo;
|
|
39
|
+
project: ProjectRepo;
|
|
40
|
+
seller: SellerRepo;
|
|
41
|
+
task: TaskRepo;
|
|
42
|
+
transaction: TransactionRepo;
|
|
43
|
+
}) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* 決済承認中止
|
|
46
|
+
* apiもしくはタスクから決済承認を取り消す
|
|
47
|
+
*/
|
|
48
|
+
declare function processVoidPayTransaction(params: factory.task.IData<factory.taskName.VoidPayTransaction>): (repos: {
|
|
49
|
+
action: ActionRepo;
|
|
50
|
+
assetTransaction: AssetTransactionRepo;
|
|
51
|
+
transaction: TransactionRepo;
|
|
52
|
+
}) => Promise<void>;
|
|
53
|
+
interface IAuthorizeRepos {
|
|
54
|
+
accountingReport: AccountingReportRepo;
|
|
55
|
+
action: ActionRepo;
|
|
56
|
+
assetTransaction: AssetTransactionRepo;
|
|
57
|
+
event: EventRepo;
|
|
58
|
+
person: PersonRepo;
|
|
59
|
+
product: ProductRepo;
|
|
60
|
+
project: ProjectRepo;
|
|
61
|
+
seller: SellerRepo;
|
|
62
|
+
task: TaskRepo;
|
|
63
|
+
transaction: TransactionRepo;
|
|
64
|
+
transactionNumber: TransactionNumberRepo;
|
|
65
|
+
}
|
|
66
|
+
declare type IAuthorizeOperation<T> = (repos: IAuthorizeRepos) => Promise<T>;
|
|
67
|
+
interface IPublishPaymentUrlRepos {
|
|
68
|
+
assetTransaction: AssetTransactionRepo;
|
|
69
|
+
person: PersonRepo;
|
|
70
|
+
product: ProductRepo;
|
|
71
|
+
project: ProjectRepo;
|
|
72
|
+
seller: SellerRepo;
|
|
73
|
+
transaction: TransactionRepo;
|
|
74
|
+
transactionNumber: TransactionNumberRepo;
|
|
75
|
+
}
|
|
76
|
+
declare type IPublishPaymentUrlOperation<T> = (repos: IPublishPaymentUrlRepos) => Promise<T>;
|
|
77
|
+
/**
|
|
78
|
+
* 外部決済ロケーションを発行する
|
|
79
|
+
*/
|
|
80
|
+
declare function publishPaymentUrl(params: {
|
|
81
|
+
project: {
|
|
82
|
+
id: string;
|
|
83
|
+
};
|
|
84
|
+
agent: {
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
object: factory.action.authorize.paymentMethod.any.IObject;
|
|
88
|
+
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
89
|
+
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
90
|
+
}): IPublishPaymentUrlOperation<PayTransactionService.IPublishPaymentUrlResult>;
|
|
91
|
+
/**
|
|
92
|
+
* 決済承認
|
|
93
|
+
*/
|
|
94
|
+
declare function authorize(params: {
|
|
95
|
+
project: {
|
|
96
|
+
id: string;
|
|
97
|
+
};
|
|
98
|
+
agent: {
|
|
99
|
+
id: string;
|
|
100
|
+
};
|
|
101
|
+
object: factory.action.authorize.paymentMethod.any.IObject;
|
|
102
|
+
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
103
|
+
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
104
|
+
}): IAuthorizeOperation<IAuthorizePaymentAction>;
|
|
105
|
+
export { onPaymentStatusChanged, authorize, invalidatePaymentUrl, voidPayTransaction, person2username, processVoidPayTransaction, publishPaymentUrl };
|
|
@@ -0,0 +1,293 @@
|
|
|
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.publishPaymentUrl = exports.processVoidPayTransaction = exports.person2username = exports.voidPayTransaction = exports.invalidatePaymentUrl = exports.authorize = exports.onPaymentStatusChanged = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* 汎用決済サービス
|
|
15
|
+
*/
|
|
16
|
+
const factory = require("../../factory");
|
|
17
|
+
const PayTransactionService = require("../assetTransaction/pay");
|
|
18
|
+
const code_1 = require("../code");
|
|
19
|
+
const factory_1 = require("./any/factory");
|
|
20
|
+
const onPaymentStatusChanged_1 = require("./any/onPaymentStatusChanged");
|
|
21
|
+
Object.defineProperty(exports, "onPaymentStatusChanged", { enumerable: true, get: function () { return onPaymentStatusChanged_1.onPaymentStatusChanged; } });
|
|
22
|
+
const person2username_1 = require("./any/person2username");
|
|
23
|
+
Object.defineProperty(exports, "person2username", { enumerable: true, get: function () { return person2username_1.person2username; } });
|
|
24
|
+
/**
|
|
25
|
+
* 決済承認中止
|
|
26
|
+
* タスクから決済承認を取り消す
|
|
27
|
+
*/
|
|
28
|
+
function voidPayTransaction(params) {
|
|
29
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
// 決済承認アクションを検索
|
|
31
|
+
let authorizeActions = yield repos.action.searchByPurpose({
|
|
32
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
33
|
+
purpose: {
|
|
34
|
+
typeOf: params.purpose.typeOf,
|
|
35
|
+
id: params.purpose.id
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
authorizeActions = authorizeActions.filter((a) => a.object.typeOf === factory.action.authorize.paymentMethod.any.ResultType.Payment);
|
|
39
|
+
// Chevreを使用した承認を取り消し
|
|
40
|
+
const authorizeActionsWithChevre = authorizeActions.filter((a) => {
|
|
41
|
+
var _a;
|
|
42
|
+
return ((_a = a.instrument) === null || _a === void 0 ? void 0 : _a.identifier) === factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre;
|
|
43
|
+
});
|
|
44
|
+
if (authorizeActionsWithChevre.length > 0) {
|
|
45
|
+
yield processVoidPayTransaction(params)(repos);
|
|
46
|
+
}
|
|
47
|
+
// 決済URL無効化もここで処理
|
|
48
|
+
yield invalidatePaymentUrl(params)(repos);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.voidPayTransaction = voidPayTransaction;
|
|
52
|
+
function invalidatePaymentUrl(params) {
|
|
53
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
var _a, _b, _c, _d, _e;
|
|
55
|
+
const transaction = yield repos.transaction.findById({
|
|
56
|
+
typeOf: params.purpose.typeOf,
|
|
57
|
+
id: params.purpose.id
|
|
58
|
+
});
|
|
59
|
+
const paymentMethodIdByPaymentUrl = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
60
|
+
const paymentMethodType = (_b = transaction.object.paymentMethods) === null || _b === void 0 ? void 0 : _b.typeOf;
|
|
61
|
+
if (typeof paymentMethodIdByPaymentUrl === 'string' && paymentMethodIdByPaymentUrl.length > 0
|
|
62
|
+
&& typeof paymentMethodType === 'string' && paymentMethodType.length > 0) {
|
|
63
|
+
// chevreで決済URL無効化
|
|
64
|
+
yield PayTransactionService.invalidatePaymentUrl({
|
|
65
|
+
project: transaction.project,
|
|
66
|
+
typeOf: factory.actionType.RefundAction,
|
|
67
|
+
agent: {
|
|
68
|
+
typeOf: transaction.seller.typeOf,
|
|
69
|
+
name: (typeof transaction.seller.name === 'string')
|
|
70
|
+
? transaction.seller.name
|
|
71
|
+
: String((_c = transaction.seller.name) === null || _c === void 0 ? void 0 : _c.ja),
|
|
72
|
+
id: transaction.seller.id
|
|
73
|
+
// project: transaction.seller.project
|
|
74
|
+
},
|
|
75
|
+
recipient: { typeOf: transaction.agent.typeOf, name: transaction.agent.name },
|
|
76
|
+
object: [{
|
|
77
|
+
typeOf: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
78
|
+
// tslint:disable-next-line:max-line-length
|
|
79
|
+
id: (_e = (_d = transaction.object.paymentMethods) === null || _d === void 0 ? void 0 : _d.issuedThrough) === null || _e === void 0 ? void 0 : _e.id,
|
|
80
|
+
paymentMethod: {
|
|
81
|
+
additionalProperty: [],
|
|
82
|
+
name: paymentMethodType,
|
|
83
|
+
typeOf: paymentMethodType,
|
|
84
|
+
paymentMethodId: paymentMethodIdByPaymentUrl
|
|
85
|
+
},
|
|
86
|
+
refundFee: 0
|
|
87
|
+
}],
|
|
88
|
+
purpose: { typeOf: transaction.typeOf, id: transaction.id }
|
|
89
|
+
})(repos);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
exports.invalidatePaymentUrl = invalidatePaymentUrl;
|
|
94
|
+
/**
|
|
95
|
+
* 決済承認中止
|
|
96
|
+
* apiもしくはタスクから決済承認を取り消す
|
|
97
|
+
*/
|
|
98
|
+
function processVoidPayTransaction(params) {
|
|
99
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const transaction = yield repos.transaction.findById({
|
|
101
|
+
typeOf: params.purpose.typeOf,
|
|
102
|
+
id: params.purpose.id
|
|
103
|
+
});
|
|
104
|
+
// 承認アクションを取得
|
|
105
|
+
let authorizeActions;
|
|
106
|
+
if (typeof params.id === 'string') {
|
|
107
|
+
const authorizeAction = yield repos.action.findById({ typeOf: factory.actionType.AuthorizeAction, id: params.id });
|
|
108
|
+
// 取引内のアクションかどうか確認
|
|
109
|
+
if (authorizeAction.purpose.typeOf !== transaction.typeOf || authorizeAction.purpose.id !== transaction.id) {
|
|
110
|
+
throw new factory.errors.Argument('Transaction', 'Action not found in the transaction');
|
|
111
|
+
}
|
|
112
|
+
authorizeActions = [authorizeAction];
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const authorizeActionsOnTransaction = yield repos.action.searchByPurpose({
|
|
116
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
117
|
+
purpose: {
|
|
118
|
+
typeOf: factory.transactionType.PlaceOrder,
|
|
119
|
+
id: transaction.id
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
authorizeActions = authorizeActionsOnTransaction.filter((a) => {
|
|
123
|
+
var _a, _b;
|
|
124
|
+
return ((_a = a.object) === null || _a === void 0 ? void 0 : _a.typeOf) === factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
125
|
+
&& ((_b = a.instrument) === null || _b === void 0 ? void 0 : _b.identifier) === factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const errors = [];
|
|
129
|
+
for (const action of authorizeActions) {
|
|
130
|
+
// 直列にゆっくり処理する場合↓
|
|
131
|
+
// tslint:disable-next-line:no-magic-numbers
|
|
132
|
+
// await new Promise((resolve) => setTimeout(() => { resolve(); }, 1000));
|
|
133
|
+
// 失敗するケースがあっても、残りが少なくとも処理されるようにエラーハンドリング
|
|
134
|
+
try {
|
|
135
|
+
// 取引が存在すれば中止
|
|
136
|
+
const transactionNumber = action.object.paymentMethodId;
|
|
137
|
+
if (typeof transactionNumber === 'string' && transactionNumber.length > 0) {
|
|
138
|
+
const payTransactions = yield repos.assetTransaction.search({
|
|
139
|
+
limit: 1,
|
|
140
|
+
page: 1,
|
|
141
|
+
project: { id: { $eq: action.project.id } },
|
|
142
|
+
typeOf: factory.assetTransactionType.Pay,
|
|
143
|
+
transactionNumber: { $eq: transactionNumber }
|
|
144
|
+
});
|
|
145
|
+
if (payTransactions.length > 0) {
|
|
146
|
+
yield PayTransactionService.cancel({ transactionNumber })(repos);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
yield repos.action.cancel({ typeOf: action.typeOf, id: action.id });
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
errors.push(error);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (errors.length > 0) {
|
|
156
|
+
throw errors[0];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
exports.processVoidPayTransaction = processVoidPayTransaction;
|
|
161
|
+
/**
|
|
162
|
+
* 外部決済ロケーションを発行する
|
|
163
|
+
*/
|
|
164
|
+
function publishPaymentUrl(params) {
|
|
165
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
const transaction = yield repos.transaction.findInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id });
|
|
167
|
+
const paymentServiceType = params.paymentServiceType;
|
|
168
|
+
// 取引番号生成
|
|
169
|
+
const { transactionNumber } = yield repos.transactionNumber.publishByTimestamp({
|
|
170
|
+
startDate: new Date()
|
|
171
|
+
});
|
|
172
|
+
let result;
|
|
173
|
+
// URL発行
|
|
174
|
+
const startParams = (0, factory_1.creatPayTransactionStartParams)({
|
|
175
|
+
object: params.object,
|
|
176
|
+
paymentServiceType,
|
|
177
|
+
transaction: transaction,
|
|
178
|
+
transactionNumber: transactionNumber
|
|
179
|
+
});
|
|
180
|
+
// result = await repos.payTransaction.publishPaymentUrl({ ...startParams, iss: params.iss });
|
|
181
|
+
result = yield PayTransactionService.publishPaymentUrl(startParams)(repos);
|
|
182
|
+
// 取引に保管
|
|
183
|
+
const paymentMethodByPaymentUrl = {
|
|
184
|
+
typeOf: params.object.paymentMethod,
|
|
185
|
+
paymentMethodId: result.paymentMethodId,
|
|
186
|
+
paymentUrl: result.paymentUrl,
|
|
187
|
+
issuedThrough: { id: (typeof startParams.object.id === 'string') ? startParams.object.id : '' }
|
|
188
|
+
};
|
|
189
|
+
yield repos.transaction.findByIdAndUpdate({
|
|
190
|
+
id: transaction.id,
|
|
191
|
+
update: { 'object.paymentMethods': paymentMethodByPaymentUrl }
|
|
192
|
+
});
|
|
193
|
+
return result;
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
exports.publishPaymentUrl = publishPaymentUrl;
|
|
197
|
+
/**
|
|
198
|
+
* 決済承認
|
|
199
|
+
*/
|
|
200
|
+
function authorize(params) {
|
|
201
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
var _a, _b;
|
|
203
|
+
const transaction = yield repos.transaction.findInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id });
|
|
204
|
+
const paymentServiceType = params.paymentServiceType;
|
|
205
|
+
// 取引番号生成
|
|
206
|
+
let transactionNumber;
|
|
207
|
+
// リクエストでpaymentMethodIdを指定された場合、取引に保管されたpaymentMethodIdに一致すればそちらを適用(外部サイト決済対応)
|
|
208
|
+
if (typeof params.object.paymentMethodId === 'string' && params.object.paymentMethodId.length > 0) {
|
|
209
|
+
const paymentMethodIdByTransaction = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
210
|
+
if (params.object.paymentMethodId === paymentMethodIdByTransaction) {
|
|
211
|
+
transactionNumber = params.object.paymentMethodId;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// 取引にないpaymentMethodIdの指定はクライアントエラー
|
|
215
|
+
throw new factory.errors.Argument('paymentMethodId', 'invalid paymentMethodId for the transaction');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (typeof transactionNumber !== 'string') {
|
|
219
|
+
const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
220
|
+
transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
221
|
+
}
|
|
222
|
+
// 承認アクションを開始する
|
|
223
|
+
const actionAttributes = {
|
|
224
|
+
project: transaction.project,
|
|
225
|
+
typeOf: factory.actionType.AuthorizeAction,
|
|
226
|
+
object: Object.assign(Object.assign({}, params.object), { paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment }),
|
|
227
|
+
agent: {
|
|
228
|
+
typeOf: transaction.agent.typeOf,
|
|
229
|
+
id: transaction.agent.id
|
|
230
|
+
},
|
|
231
|
+
instrument: {
|
|
232
|
+
typeOf: 'WebAPI',
|
|
233
|
+
identifier: factory.action.authorize.paymentMethod.any.ServiceIdentifier.Chevre
|
|
234
|
+
},
|
|
235
|
+
recipient: {
|
|
236
|
+
typeOf: transaction.seller.typeOf,
|
|
237
|
+
id: transaction.seller.id,
|
|
238
|
+
name: (typeof transaction.seller.name === 'string')
|
|
239
|
+
? transaction.seller.name
|
|
240
|
+
: String((_b = transaction.seller.name) === null || _b === void 0 ? void 0 : _b.ja)
|
|
241
|
+
},
|
|
242
|
+
purpose: { typeOf: transaction.typeOf, id: transaction.id }
|
|
243
|
+
};
|
|
244
|
+
const action = yield repos.action.start(actionAttributes);
|
|
245
|
+
let payTransaction;
|
|
246
|
+
try {
|
|
247
|
+
const { accountId } = yield validateFromLocation({
|
|
248
|
+
object: params.object,
|
|
249
|
+
project: { id: transaction.project.id }
|
|
250
|
+
})({ action: repos.action });
|
|
251
|
+
const startParams = (0, factory_1.creatPayTransactionStartParams)({
|
|
252
|
+
accountId,
|
|
253
|
+
object: params.object,
|
|
254
|
+
paymentServiceType,
|
|
255
|
+
transaction: transaction,
|
|
256
|
+
transactionNumber: transactionNumber
|
|
257
|
+
});
|
|
258
|
+
// payTransaction = await repos.payTransaction.start({ ...startParams, iss: params.iss });
|
|
259
|
+
payTransaction = yield PayTransactionService.start(startParams)(repos);
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
try {
|
|
263
|
+
const actionError = Object.assign(Object.assign({}, error), { message: error.message, name: error.name });
|
|
264
|
+
yield repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error: actionError });
|
|
265
|
+
}
|
|
266
|
+
catch (__) {
|
|
267
|
+
// no op
|
|
268
|
+
}
|
|
269
|
+
throw error;
|
|
270
|
+
}
|
|
271
|
+
// アクションを完了
|
|
272
|
+
const result = (0, factory_1.createAuthorizeResult)({ payTransaction, object: params.object });
|
|
273
|
+
return yield repos.action.complete({ typeOf: action.typeOf, id: action.id, result: result });
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
exports.authorize = authorize;
|
|
277
|
+
function validateFromLocation(params) {
|
|
278
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
279
|
+
var _a, _b;
|
|
280
|
+
let accountId = (_a = params.object) === null || _a === void 0 ? void 0 : _a.accountId;
|
|
281
|
+
const fromLocation = (_b = params.object) === null || _b === void 0 ? void 0 : _b.fromLocation;
|
|
282
|
+
// トークン化されたペイメントカード情報でリクエストされた場合、実ペイメントカード情報へ変換する
|
|
283
|
+
if (typeof fromLocation === 'string') {
|
|
284
|
+
const paymentCardOwnershipInfo = yield (0, code_1.verifyToken)({
|
|
285
|
+
project: { id: params.project.id },
|
|
286
|
+
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
287
|
+
token: fromLocation
|
|
288
|
+
})(repos);
|
|
289
|
+
accountId = paymentCardOwnershipInfo.typeOfGood.identifier;
|
|
290
|
+
}
|
|
291
|
+
return { accountId };
|
|
292
|
+
});
|
|
293
|
+
}
|