@chevre/domain 22.2.0-alpha.3 → 22.2.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/src/chevre/createProject.ts +19 -0
- package/example/src/chevre/findValidAuthorization.ts +1 -2
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
- package/example/src/chevre/{migrateMovieTheaterAdditionalProperties.ts → migrateRoomAdditionalProperties.ts} +17 -17
- package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +119 -0
- package/example/src/chevre/playAroundTicket.ts +3 -2
- package/example/src/chevre/processAction.ts +3 -1
- package/example/src/chevre/projectFields.ts +42 -0
- package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +7 -12
- package/example/src/chevre/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts} +4 -4
- package/example/src/chevre/searchActionsByPurpose.ts +38 -0
- package/example/src/chevre/searchProjects.ts +9 -4
- package/example/src/chevre/searchSellersByAggregate.ts +3 -3
- package/example/src/chevre/searchTransactions.ts +1 -1
- package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
- package/lib/chevre/repo/accountTitle.d.ts +9 -3
- package/lib/chevre/repo/accountingReport.d.ts +2 -15
- package/lib/chevre/repo/action.d.ts +64 -47
- package/lib/chevre/repo/action.js +170 -133
- package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
- package/lib/chevre/repo/assetTransaction.d.ts +134 -7
- package/lib/chevre/repo/assetTransaction.js +2 -2
- package/lib/chevre/repo/authorization.d.ts +3 -1
- package/lib/chevre/repo/authorization.js +21 -10
- package/lib/chevre/repo/categoryCode.d.ts +18 -2
- package/lib/chevre/repo/categoryCode.js +47 -19
- package/lib/chevre/repo/comment.d.ts +5 -1
- package/lib/chevre/repo/creativeWork.d.ts +14 -2
- package/lib/chevre/repo/customer.d.ts +5 -1
- package/lib/chevre/repo/customerType.d.ts +1 -1
- package/lib/chevre/repo/event.d.ts +49 -2
- package/lib/chevre/repo/member.d.ts +5 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
- package/lib/chevre/repo/message.d.ts +1 -15
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
- package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
- package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
- package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
- package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
- package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
- package/lib/chevre/repo/offer.d.ts +13 -4
- package/lib/chevre/repo/offerCatalog.d.ts +15 -2
- package/lib/chevre/repo/order.d.ts +13 -1
- package/lib/chevre/repo/ownershipInfo.d.ts +23 -7
- package/lib/chevre/repo/ownershipInfo.js +75 -19
- package/lib/chevre/repo/paymentService.d.ts +2 -2
- package/lib/chevre/repo/paymentService.js +108 -58
- package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
- package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
- package/lib/chevre/repo/priceSpecification.d.ts +42 -1
- package/lib/chevre/repo/product.d.ts +8 -3
- package/lib/chevre/repo/product.js +67 -33
- package/lib/chevre/repo/productModel.d.ts +1 -22
- package/lib/chevre/repo/project.d.ts +25 -5
- package/lib/chevre/repo/project.js +69 -28
- package/lib/chevre/repo/reservation.d.ts +35 -3
- package/lib/chevre/repo/reservation.js +1 -1
- package/lib/chevre/repo/role.d.ts +2 -9
- package/lib/chevre/repo/role.js +20 -10
- package/lib/chevre/repo/seller.d.ts +64 -14
- package/lib/chevre/repo/seller.js +61 -27
- package/lib/chevre/repo/task.d.ts +64 -3
- package/lib/chevre/repo/telemetry.d.ts +3 -2
- package/lib/chevre/repo/ticket.d.ts +4 -20
- package/lib/chevre/repo/ticket.js +23 -10
- package/lib/chevre/repo/transaction.d.ts +30 -14
- package/lib/chevre/repo/transaction.js +106 -77
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
- package/lib/chevre/service/aggregation/project.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.js +1 -1
- package/lib/chevre/service/assetTransaction/pay.js +3 -3
- package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund/factory.js +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +3 -3
- package/lib/chevre/service/assetTransaction/registerService.js +4 -6
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +26 -23
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +4 -1
- package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
- package/lib/chevre/service/code.d.ts +0 -4
- package/lib/chevre/service/code.js +22 -18
- package/lib/chevre/service/event.js +4 -4
- package/lib/chevre/service/moneyTransfer.js +3 -5
- package/lib/chevre/service/notification.js +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +34 -6
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +22 -22
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -4
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -4
- package/lib/chevre/service/offer/event/authorize.js +3 -2
- package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +3 -1
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +41 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
- package/lib/chevre/service/offer/product.d.ts +4 -2
- package/lib/chevre/service/offer/product.js +12 -12
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
- package/lib/chevre/service/order/placeOrder.js +1 -1
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/order/sendOrder.js +9 -5
- package/lib/chevre/service/payment/any/factory.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
- package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -6
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +26 -34
- package/lib/chevre/service/payment/any.d.ts +3 -3
- package/lib/chevre/service/payment/any.js +21 -13
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
- package/lib/chevre/service/payment/faceToFace.js +28 -10
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
- package/lib/chevre/service/payment/paymentCard.js +29 -16
- package/lib/chevre/service/payment.d.ts +1 -1
- package/lib/chevre/service/report/ownershipInfo.d.ts +3 -1
- package/lib/chevre/service/report/telemetry.js +2 -2
- package/lib/chevre/service/reserve/cancelReservation.js +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/task/authorizePayment.js +0 -2
- package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +16 -4
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +36 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +2 -2
- package/lib/chevre/service/transaction.js +1 -1
- package/package.json +4 -4
- package/example/src/chevre/findTransactionById.ts +0 -23
- package/example/src/chevre/findTransactionInProgressById.ts +0 -23
- package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
- package/example/src/chevre/projectReservationFields.ts +0 -31
- package/example/src/chevre/searchActions.ts +0 -40
- package/example/src/chevre/searchProducts.ts +0 -28
|
@@ -8,5 +8,5 @@ declare function createInformTasks(order: IReturnedOrder, settings: Settings): f
|
|
|
8
8
|
declare function createOnOrderReturnedTasksByTransaction(params: {
|
|
9
9
|
order: Pick<factory.order.IOrder, 'project' | 'typeOf' | 'orderNumber' | 'customer' | 'price' | 'priceCurrency' | 'orderDate'>;
|
|
10
10
|
potentialActions?: factory.action.transfer.returnAction.order.IPotentialActions;
|
|
11
|
-
}): (import("@chevre/factory/lib/task
|
|
11
|
+
}): (import("@chevre/factory/lib/task").IAttributes | import("@chevre/factory/lib/task/confirmMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/confirmRegisterService").IAttributes | import("@chevre/factory/lib/task/confirmPayTransaction").IAttributes | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/confirmReserveTransaction").IAttributes | import("@chevre/factory/lib/task/createAccountingReport").IAttributes | import("@chevre/factory/lib/task/createEvent").IAttributes | import("@chevre/factory/lib/task/deleteTransaction").IAttributes | import("@chevre/factory/lib/task/givePointAward").IAttributes | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").IAttributes | import("@chevre/factory/lib/task/onAuthorizationCreated").IAttributes | import("@chevre/factory/lib/task/onEventChanged").IAttributes | import("@chevre/factory/lib/task/onResourceUpdated").IAttributes | import("@chevre/factory/lib/task/onOrderPaymentCompleted").IAttributes | import("@chevre/factory/lib/task/placeOrder").IAttributes | import("@chevre/factory/lib/task/returnOrder").IAttributes | import("@chevre/factory/lib/task/returnMoneyTransfer").IAttributes | import("@chevre/factory/lib/task/returnPayTransaction").IAttributes | import("@chevre/factory/lib/task/returnPointAward").IAttributes | import("@chevre/factory/lib/task/returnReserveTransaction").IAttributes | import("@chevre/factory/lib/task/sendEmailMessage").IAttributes | import("@chevre/factory/lib/task/sendOrder").IAttributes | import("@chevre/factory/lib/task/triggerWebhook").IAttributes | import("@chevre/factory/lib/task/useReservation").IAttributes | import("@chevre/factory/lib/task/voidMoneyTransferTransaction").IAttributes | import("@chevre/factory/lib/task/voidPayTransaction").IAttributes | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").IAttributes | import("@chevre/factory/lib/task/voidReserveTransaction").IAttributes)[];
|
|
12
12
|
export { createInformTasks, createOnOrderReturnedTasksByTransaction };
|
|
@@ -19,7 +19,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
19
19
|
const confirmationNumber = String(params.confirmationNumber);
|
|
20
20
|
const orderNumber = params.orderNumber;
|
|
21
21
|
let order;
|
|
22
|
-
const placeOrderTransactions = yield repos.transaction.
|
|
22
|
+
const placeOrderTransactions = yield repos.transaction.projectFields({
|
|
23
23
|
limit: 1,
|
|
24
24
|
page: 1,
|
|
25
25
|
project: { id: { $eq: params.project.id } },
|
|
@@ -43,7 +43,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
43
43
|
if (Array.isArray(authorizeActionsAsResult) && authorizeActionsAsResult.length > 0) {
|
|
44
44
|
const completedAuthorizeActionIds = authorizeActionsAsResult.map(({ id }) => id);
|
|
45
45
|
if (completedAuthorizeActionIds.length > 0) {
|
|
46
|
-
authorizePaymentActions = yield repos.action.search({
|
|
46
|
+
authorizePaymentActions = (yield repos.action.search({
|
|
47
47
|
typeOf: factory.actionType.AuthorizeAction,
|
|
48
48
|
purpose: {
|
|
49
49
|
typeOf: { $in: [factory.transactionType.PlaceOrder] },
|
|
@@ -51,7 +51,7 @@ function createPlacingOrderFromExistingTransaction(params) {
|
|
|
51
51
|
},
|
|
52
52
|
object: { typeOf: { $eq: factory.action.authorize.paymentMethod.any.ResultType.Payment } },
|
|
53
53
|
id: { $in: completedAuthorizeActionIds }
|
|
54
|
-
}, ['result'], []);
|
|
54
|
+
}, ['result'], []));
|
|
55
55
|
authorizeOfferActionsWithInstrument = (yield repos.action.search({
|
|
56
56
|
typeOf: factory.actionType.AuthorizeAction,
|
|
57
57
|
purpose: {
|
|
@@ -70,7 +70,7 @@ function placeOrder(params) {
|
|
|
70
70
|
id: { $in: [orderActionPurpose.id] },
|
|
71
71
|
typeOf: { $in: [orderActionPurpose.typeOf] }
|
|
72
72
|
}
|
|
73
|
-
}, ['
|
|
73
|
+
}, ['id'], []);
|
|
74
74
|
if (completedActions.length === 0) {
|
|
75
75
|
const action = yield repos.action.start(orderActionAttributes);
|
|
76
76
|
try {
|
|
@@ -44,7 +44,7 @@ function returnOrder(params) {
|
|
|
44
44
|
throw new factory.errors.Argument('object.orderNumber', `orderStatus not returnable: ${order.orderStatus}`);
|
|
45
45
|
}
|
|
46
46
|
// 返品取引検索
|
|
47
|
-
const returnOrderTransactions = yield repos.transaction.
|
|
47
|
+
const returnOrderTransactions = yield repos.transaction.projectFields({
|
|
48
48
|
limit: 1,
|
|
49
49
|
page: 1,
|
|
50
50
|
project: { id: { $eq: order.project.id } },
|
|
@@ -86,7 +86,8 @@ function sendOrder(params) {
|
|
|
86
86
|
typeOf: factory.actionType.SendAction
|
|
87
87
|
};
|
|
88
88
|
const action = yield repos.action.start(sendOrderActionAttributes);
|
|
89
|
-
let
|
|
89
|
+
let creatingOwnershipInfos = [];
|
|
90
|
+
let createdOwnershipInfos = [];
|
|
90
91
|
let allOffersDelivered = false;
|
|
91
92
|
let acceptedOffers;
|
|
92
93
|
// 所有権生成を最小化(2024-03-01~)
|
|
@@ -111,12 +112,15 @@ function sendOrder(params) {
|
|
|
111
112
|
debug('delivering...', order.orderNumber, acceptedOffers.map((offer) => `${offer.itemOffered.id}`), params.object.acceptedOffers, 'offerIndexBase:', offerIndexBase);
|
|
112
113
|
// 所有権作成
|
|
113
114
|
if (createOwnerships) {
|
|
114
|
-
|
|
115
|
+
creatingOwnershipInfos = (0, factory_1.createOwnershipInfosFromOrder)({
|
|
115
116
|
order: Object.assign(Object.assign({}, order), { acceptedOffers }),
|
|
116
117
|
offerIndexBase
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
createdOwnershipInfos = yield Promise.all(creatingOwnershipInfos.map((creatingOwnershipInfo) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const { id } = yield repos.ownershipInfo.createIfNotExistByIdentifier(creatingOwnershipInfo);
|
|
121
|
+
return Object.assign({ id }, (typeof creatingOwnershipInfo.identifier === 'string')
|
|
122
|
+
? { identifier: creatingOwnershipInfo.identifier }
|
|
123
|
+
: undefined);
|
|
120
124
|
})));
|
|
121
125
|
}
|
|
122
126
|
// const deliveredCount = limit * page;
|
|
@@ -140,7 +144,7 @@ function sendOrder(params) {
|
|
|
140
144
|
}
|
|
141
145
|
throw error;
|
|
142
146
|
}
|
|
143
|
-
const result =
|
|
147
|
+
const result = createdOwnershipInfos;
|
|
144
148
|
yield repos.action.completeWithVoid({ typeOf: sendOrderActionAttributes.typeOf, id: action.id, result: result });
|
|
145
149
|
debug('allOffersDelivered?:', allOffersDelivered, order.orderNumber);
|
|
146
150
|
if (params.useOnOrderStatusChanged) {
|
|
@@ -33,4 +33,4 @@ export declare function createAuthorizeResult(params: {
|
|
|
33
33
|
/**
|
|
34
34
|
* 通知対象としてのアクションを最適化
|
|
35
35
|
*/
|
|
36
|
-
export declare function optimizeAction4inform(action: factory.action.trade.pay.IAction | factory.action.trade.refund.IAction): IOnPaymentStatusChangedParams;
|
|
36
|
+
export declare function optimizeAction4inform(action: Pick<factory.action.trade.pay.IAction, 'id' | 'object' | 'project' | 'typeOf'> | Pick<factory.action.trade.refund.IAction, 'id' | 'object' | 'project' | 'typeOf'>): IOnPaymentStatusChangedParams;
|
|
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
8
8
|
/**
|
|
9
9
|
* 決済後のアクション
|
|
10
10
|
*/
|
|
11
|
-
declare function onPaid(payAction: factory.action.trade.pay.IAction): (repos: {
|
|
11
|
+
declare function onPaid(payAction: Pick<factory.action.trade.pay.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
|
|
12
12
|
action: ActionRepo;
|
|
13
13
|
accountingReport: AccountingReportRepo;
|
|
14
14
|
task: TaskRepo;
|
|
@@ -8,7 +8,7 @@ import type { TaskRepo } from '../../../repo/task';
|
|
|
8
8
|
/**
|
|
9
9
|
* 返金後のアクション
|
|
10
10
|
*/
|
|
11
|
-
declare function onRefund(refundAction: factory.action.trade.refund.IAction): (repos: {
|
|
11
|
+
declare function onRefund(refundAction: Pick<factory.action.trade.refund.IAction, 'actionStatus' | 'id' | 'object' | 'potentialActions' | 'project' | 'purpose' | 'typeOf'>): (repos: {
|
|
12
12
|
action: ActionRepo;
|
|
13
13
|
accountingReport: AccountingReportRepo;
|
|
14
14
|
task: TaskRepo;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import * as factory from '../../../factory';
|
|
2
2
|
import type { AuthorizationRepo } from '../../../repo/authorization';
|
|
3
|
-
import type { OwnershipInfoRepo } from '../../../repo/ownershipInfo';
|
|
4
3
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
5
|
-
type IObjectWithoutDetail = factory.action.authorize.paymentMethod.any.IObjectWithoutDetail & {
|
|
6
|
-
ticketToken?: string;
|
|
7
|
-
};
|
|
8
4
|
declare function verifyTicketTokenAsNeeded(params: {
|
|
9
5
|
project: {
|
|
10
6
|
id: string;
|
|
11
7
|
};
|
|
12
|
-
object: IObjectWithoutDetail
|
|
8
|
+
object: Pick<factory.action.authorize.paymentMethod.any.IObjectWithoutDetail, 'issuedThrough' | 'ticketToken'>;
|
|
13
9
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
14
10
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
15
11
|
}): (repos: {
|
|
16
12
|
authorization: AuthorizationRepo;
|
|
17
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
18
13
|
ticket: TicketRepo;
|
|
19
14
|
}) => Promise<{
|
|
20
15
|
permit: Pick<factory.ownershipInfo.IPermitAsGood, 'identifier'> | undefined;
|
|
@@ -13,22 +13,21 @@ exports.verifyTicketTokenAsNeeded = void 0;
|
|
|
13
13
|
const factory = require("../../../factory");
|
|
14
14
|
function verifyTicketTokenAsNeeded(params) {
|
|
15
15
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
var _a;
|
|
16
|
+
var _a, _b;
|
|
17
17
|
const { paymentServiceType, object, project } = params;
|
|
18
|
-
const { ticketToken } = object;
|
|
18
|
+
const { issuedThrough, ticketToken } = object;
|
|
19
19
|
let permit;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const ticket = (yield repos.ticket.search({
|
|
20
|
+
// メンバーシップチケットが指定された場合、メンバーシップコードへ変換する
|
|
21
|
+
if (typeof ticketToken === 'string' && ticketToken !== '') {
|
|
22
|
+
switch (paymentServiceType) {
|
|
23
|
+
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
24
|
+
case factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
25
|
+
const ticket = (yield repos.ticket.projectFields({
|
|
27
26
|
limit: 1,
|
|
28
27
|
page: 1,
|
|
29
28
|
project: { id: { $eq: project.id } },
|
|
30
29
|
ticketToken: { $eq: ticketToken }
|
|
31
|
-
})).shift();
|
|
30
|
+
}, ['ticketToken'])).shift();
|
|
32
31
|
if (ticket === undefined) {
|
|
33
32
|
throw new factory.errors.NotFound('Ticket');
|
|
34
33
|
}
|
|
@@ -37,41 +36,34 @@ function verifyTicketTokenAsNeeded(params) {
|
|
|
37
36
|
project: { id: params.project.id },
|
|
38
37
|
code: ticket.ticketToken
|
|
39
38
|
});
|
|
40
|
-
authorizedObject = validAuthorization.object;
|
|
39
|
+
const authorizedObject = validAuthorization.object;
|
|
41
40
|
if (authorizedObject.typeOf !== 'OwnershipInfo') {
|
|
42
41
|
throw new factory.errors.Argument('ticketToken', 'must be OwnershipInfo');
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
project: { id: { $eq: params.project.id } },
|
|
49
|
-
ids: [ownershipInfoId]
|
|
50
|
-
})).shift();
|
|
51
|
-
if (permitOwnershipInfo === undefined) {
|
|
52
|
-
throw new factory.errors.NotFound('OwnershipInfo');
|
|
43
|
+
// audience検証
|
|
44
|
+
if (((_a = validAuthorization.audience) === null || _a === void 0 ? void 0 : _a.typeOf) !== factory.transactionType.PlaceOrder
|
|
45
|
+
|| validAuthorization.audience.id !== params.purpose.id) {
|
|
46
|
+
throw new factory.errors.Argument('ticketToken', 'audience not matched with placeOrder');
|
|
53
47
|
}
|
|
54
|
-
const {
|
|
48
|
+
const { typeOfGood } = authorizedObject;
|
|
55
49
|
if (typeOfGood.typeOf !== factory.permit.PermitType.Permit) {
|
|
56
50
|
throw new factory.errors.Argument('ticketToken', 'must be Permit');
|
|
57
51
|
}
|
|
58
|
-
if (((
|
|
52
|
+
if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
|
|
59
53
|
throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
|
|
60
54
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if (ownedBy[0].id !== params.purpose.id) {
|
|
68
|
-
throw new factory.errors.Argument('ticketToken', 'ownershipInfo.ownedBy.id not matched');
|
|
55
|
+
// CreditCardの場合、発行サービスIDを検証
|
|
56
|
+
if (typeOfGood.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
57
|
+
if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
|
|
58
|
+
throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
|
|
59
|
+
}
|
|
69
60
|
}
|
|
70
61
|
permit = { identifier: typeOfGood.identifier };
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
// no op
|
|
65
|
+
throw new factory.errors.NotImplemented(`ticketToken issued through ${paymentServiceType} not implemented`);
|
|
66
|
+
}
|
|
75
67
|
}
|
|
76
68
|
return { permit };
|
|
77
69
|
});
|
|
@@ -10,7 +10,6 @@ import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
|
10
10
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
11
11
|
import type { ConfirmationNumberRepo } from '../../repo/confirmationNumber';
|
|
12
12
|
import type { EventRepo } from '../../repo/event';
|
|
13
|
-
import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
|
|
14
13
|
import type { PaymentServiceRepo } from '../../repo/paymentService';
|
|
15
14
|
import type { PaymentServiceProviderRepo } from '../../repo/paymentServiceProvider';
|
|
16
15
|
import type { ProductRepo } from '../../repo/product';
|
|
@@ -80,7 +79,6 @@ interface IAuthorizeRepos {
|
|
|
80
79
|
authorization: AuthorizationRepo;
|
|
81
80
|
confirmationNumber: ConfirmationNumberRepo;
|
|
82
81
|
event: EventRepo;
|
|
83
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
84
82
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
85
83
|
paymentService: PaymentServiceRepo;
|
|
86
84
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
@@ -97,9 +95,11 @@ type IAuthorizeOperation<T> = (repos: IAuthorizeRepos, settings: Settings, crede
|
|
|
97
95
|
interface IPublishPaymentUrlRepos {
|
|
98
96
|
action: ActionRepo;
|
|
99
97
|
assetTransaction: AssetTransactionRepo;
|
|
98
|
+
authorization: AuthorizationRepo;
|
|
100
99
|
paymentAccepted: SellerPaymentAcceptedRepo;
|
|
101
100
|
paymentService: PaymentServiceRepo;
|
|
102
101
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
102
|
+
ticket: TicketRepo;
|
|
103
103
|
transaction: TransactionRepo;
|
|
104
104
|
transactionNumber: TransactionNumberRepo;
|
|
105
105
|
}
|
|
@@ -117,7 +117,7 @@ declare function publishPaymentUrl(params: {
|
|
|
117
117
|
agent: {
|
|
118
118
|
id: string;
|
|
119
119
|
};
|
|
120
|
-
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod'>;
|
|
120
|
+
object: Pick<IObjectWithoutDetail, 'amount' | 'creditCard' | 'issuedThrough' | 'method' | 'paymentMethod' | 'ticketToken'>;
|
|
121
121
|
purpose: factory.action.authorize.paymentMethod.any.IPurpose;
|
|
122
122
|
paymentServiceType: factory.service.paymentService.PaymentServiceType;
|
|
123
123
|
location: factory.action.trade.pay.ILocation;
|
|
@@ -62,7 +62,7 @@ function invalidatePaymentUrl(params) {
|
|
|
62
62
|
if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
63
63
|
throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
64
64
|
}
|
|
65
|
-
const transaction = yield repos.transaction.
|
|
65
|
+
const transaction = yield repos.transaction.projectFieldsById({
|
|
66
66
|
typeOf: params.purpose.typeOf,
|
|
67
67
|
id: params.purpose.id
|
|
68
68
|
}, ['typeOf', 'status', 'object', 'project', 'seller', 'agent']);
|
|
@@ -129,10 +129,10 @@ function processVoidPayTransaction(params) {
|
|
|
129
129
|
let transaction;
|
|
130
130
|
// アクションID指定の場合、進行中取引検証(2023-02-24~)
|
|
131
131
|
if (typeof params.id === 'string') {
|
|
132
|
-
transaction = (yield repos.transaction.
|
|
132
|
+
transaction = (yield repos.transaction.projectFieldsInProgressById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status']));
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
|
-
transaction = (yield repos.transaction.
|
|
135
|
+
transaction = (yield repos.transaction.projectFieldsById({ typeOf: params.purpose.typeOf, id: params.purpose.id }, ['typeOf', 'status', 'result']));
|
|
136
136
|
}
|
|
137
137
|
// 承認アクションを取得
|
|
138
138
|
let authorizeActions;
|
|
@@ -228,16 +228,24 @@ exports.processVoidPayTransaction = processVoidPayTransaction;
|
|
|
228
228
|
function publishPaymentUrl(params) {
|
|
229
229
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
230
230
|
var _a;
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
const { paymentServiceType, purpose, project } = params;
|
|
232
|
+
if (purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
233
|
+
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
233
234
|
}
|
|
234
235
|
try {
|
|
235
|
-
const transaction = yield repos.transaction.
|
|
236
|
-
const paymentServiceType = params.paymentServiceType;
|
|
236
|
+
const transaction = yield repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['expires', 'seller', 'project']);
|
|
237
237
|
// 取引番号生成
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
});
|
|
238
|
+
let transactionNumber;
|
|
239
|
+
// support ticketToken(2024-08-21~)
|
|
240
|
+
const { permit } = yield (0, verifyTicketTokenAsNeeded_1.verifyTicketTokenAsNeeded)({ project, object: params.object, paymentServiceType, purpose })(repos);
|
|
241
|
+
const paymentMethodIdByPermit = permit === null || permit === void 0 ? void 0 : permit.identifier;
|
|
242
|
+
if (typeof paymentMethodIdByPermit === 'string') {
|
|
243
|
+
transactionNumber = paymentMethodIdByPermit;
|
|
244
|
+
}
|
|
245
|
+
if (typeof transactionNumber !== 'string') {
|
|
246
|
+
const publishTransactionNumberResult = yield repos.transactionNumber.publishByTimestamp({ startDate: new Date() });
|
|
247
|
+
transactionNumber = publishTransactionNumberResult.transactionNumber;
|
|
248
|
+
}
|
|
241
249
|
let result;
|
|
242
250
|
// URL発行
|
|
243
251
|
const authorizeObject = Object.assign(Object.assign({}, params.object), { accountId: '', paymentMethodId: transactionNumber, typeOf: factory.action.authorize.paymentMethod.any.ResultType.Payment });
|
|
@@ -310,7 +318,7 @@ function authorize(params) {
|
|
|
310
318
|
throw new factory.errors.NotImplemented(`purpose.typeOf '${purpose.typeOf} not implemented'`);
|
|
311
319
|
}
|
|
312
320
|
const confirmationNumber = yield (0, fixConfirmationNumberAsNeeded_1.fixConfirmationNumberAsNeeded)({ purpose, paymentServiceType })(repos);
|
|
313
|
-
const transaction = yield repos.transaction.
|
|
321
|
+
const transaction = yield repos.transaction.projectFieldsInProgressById({ typeOf: purpose.typeOf, id: purpose.id }, ['agent', 'expires', 'typeOf', 'project', 'seller']);
|
|
314
322
|
// 取引番号生成
|
|
315
323
|
let transactionNumber;
|
|
316
324
|
let pendingPaymentAgencyTransaction;
|
|
@@ -407,9 +415,9 @@ function authorize(params) {
|
|
|
407
415
|
const rawError = Array.isArray(error) ? error[1] : undefined;
|
|
408
416
|
if (rawError !== undefined && rawError.name !== 'AbortError') {
|
|
409
417
|
yield processVoidPayTransaction({
|
|
410
|
-
project:
|
|
418
|
+
project: actionAttributes.project,
|
|
411
419
|
id: action.id,
|
|
412
|
-
purpose:
|
|
420
|
+
purpose: actionAttributes.purpose
|
|
413
421
|
})(repos);
|
|
414
422
|
}
|
|
415
423
|
}
|
|
@@ -85,7 +85,7 @@ function processAuthorizeCreditCard(params) {
|
|
|
85
85
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
86
86
|
};
|
|
87
87
|
// add action(2024-06-12~)
|
|
88
|
-
action =
|
|
88
|
+
action = yield repos.action.start(actionAttributes, { recipe });
|
|
89
89
|
try {
|
|
90
90
|
entryTranResult = yield repos.creditCardService.entryTran(entryTranArgs);
|
|
91
91
|
execTranArgs = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ accessId: entryTranResult.accessId, accessPass: entryTranResult.accessPass, orderId, method: params.object.method, siteId: (_e = params.availableChannel.credentials) === null || _e === void 0 ? void 0 : _e.siteId, sitePass: (_f = params.availableChannel.credentials) === null || _f === void 0 ? void 0 : _f.sitePass, seqMode: GMO.utils.util.SeqMode.Physics }, (typeof cardNo === 'string') ? { cardNo } : undefined), (typeof cardPass === 'string') ? { cardPass } : undefined), (typeof expire === 'string') ? { expire } : undefined), (typeof token === 'string') ? { token } : undefined), (typeof memberId === 'string') ? { memberId } : undefined), (typeof cardSeq === 'number') ? { cardSeq } : undefined);
|
|
@@ -34,7 +34,7 @@ function processAuthorizeCreditCard3ds(params) {
|
|
|
34
34
|
sameAs: { id: params.payTransaction.id, typeOf: factory.assetTransactionType.Pay }
|
|
35
35
|
};
|
|
36
36
|
// add action(2024-06-12~)
|
|
37
|
-
action =
|
|
37
|
+
action = yield repos.action.start(actionAttributes, { recipe });
|
|
38
38
|
try {
|
|
39
39
|
secureTran2Result = yield repos.creditCardService.secureTran2(secureTran2Args);
|
|
40
40
|
}
|
|
@@ -6,7 +6,6 @@ import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccep
|
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
7
|
import * as factory from '../../../factory';
|
|
8
8
|
import { Settings } from '../../../settings';
|
|
9
|
-
type IPayAction = factory.action.trade.pay.IAction;
|
|
10
9
|
/**
|
|
11
10
|
* クレジットカード決済
|
|
12
11
|
*/
|
|
@@ -17,5 +16,5 @@ declare function payCreditCard(params: factory.action.trade.pay.IAttributes): (r
|
|
|
17
16
|
paymentService: PaymentServiceRepo;
|
|
18
17
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
19
18
|
task: TaskRepo;
|
|
20
|
-
}, settings: Settings) => Promise<
|
|
19
|
+
}, settings: Settings) => Promise<void>;
|
|
21
20
|
export { payCreditCard };
|
|
@@ -38,8 +38,7 @@ function payCreditCard(params) {
|
|
|
38
38
|
throw new factory.errors.ArgumentNull('recipient.id');
|
|
39
39
|
}
|
|
40
40
|
const { shopId, shopPass } = yield (0, getGMOInfoFromSeller_1.getGMOInfoFromSeller)({ paymentMethodType, seller: { id: sellerId }, paymentServiceId })(repos);
|
|
41
|
-
|
|
42
|
-
let action = yield repos.action.start(params);
|
|
41
|
+
const action = yield repos.action.start(params);
|
|
43
42
|
const alterTranResults = [];
|
|
44
43
|
const processAlterTranResults = [];
|
|
45
44
|
let recipe;
|
|
@@ -80,9 +79,17 @@ function payCreditCard(params) {
|
|
|
80
79
|
const actionResult = {
|
|
81
80
|
// creditCardSales: alterTranResults // discontinue(2024-06-10~)
|
|
82
81
|
};
|
|
83
|
-
|
|
84
|
-
yield (0, onPaid_1.onPaid)(
|
|
85
|
-
|
|
82
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
|
|
83
|
+
yield (0, onPaid_1.onPaid)({
|
|
84
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
85
|
+
id: action.id,
|
|
86
|
+
object: params.object,
|
|
87
|
+
potentialActions: params.potentialActions,
|
|
88
|
+
project: params.project,
|
|
89
|
+
purpose: params.purpose,
|
|
90
|
+
typeOf: action.typeOf
|
|
91
|
+
})(repos);
|
|
92
|
+
// return action;
|
|
86
93
|
});
|
|
87
94
|
}
|
|
88
95
|
exports.payCreditCard = payCreditCard;
|
|
@@ -29,6 +29,7 @@ const getGMOInfoFromSeller_1 = require("./getGMOInfoFromSeller");
|
|
|
29
29
|
/**
|
|
30
30
|
* クレジットカード返金
|
|
31
31
|
*/
|
|
32
|
+
// tslint:disable-next-line:max-func-body-length
|
|
32
33
|
function refundCreditCard(params, options) {
|
|
33
34
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
34
35
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -59,7 +60,7 @@ function refundCreditCard(params, options) {
|
|
|
59
60
|
id: paymentServiceId
|
|
60
61
|
});
|
|
61
62
|
const { sameAs } = params, startingActionParams = __rest(params, ["sameAs"]);
|
|
62
|
-
|
|
63
|
+
const action = yield repos.action.start(Object.assign(Object.assign({}, startingActionParams), (typeof ((_g = params.sameAs) === null || _g === void 0 ? void 0 : _g.id) === 'string') ? { sameAs: { id: params.sameAs.id, typeOf: 'Task' } } : undefined));
|
|
63
64
|
const alterTranResult = [];
|
|
64
65
|
let processAlterTranResult;
|
|
65
66
|
let recipe;
|
|
@@ -97,8 +98,17 @@ function refundCreditCard(params, options) {
|
|
|
97
98
|
throw error;
|
|
98
99
|
}
|
|
99
100
|
const actionResult = {}; // optimize(2024-06-10~)
|
|
100
|
-
|
|
101
|
-
yield (
|
|
101
|
+
// add recipe(2024-06-04~)
|
|
102
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult, recipe });
|
|
103
|
+
yield (0, onRefund_1.onRefund)({
|
|
104
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
105
|
+
id: action.id,
|
|
106
|
+
object: startingActionParams.object,
|
|
107
|
+
potentialActions: startingActionParams.potentialActions,
|
|
108
|
+
project: startingActionParams.project,
|
|
109
|
+
purpose: startingActionParams.purpose,
|
|
110
|
+
typeOf: action.typeOf
|
|
111
|
+
})(repos);
|
|
102
112
|
// return action;
|
|
103
113
|
});
|
|
104
114
|
}
|
|
@@ -49,7 +49,7 @@ function voidTransaction(params) {
|
|
|
49
49
|
typeOf: { $eq: factory.actionType.AuthorizeAction },
|
|
50
50
|
object: { paymentMethodId: { $eq: paymentMethodId } },
|
|
51
51
|
sameAs: { id: { $eq: transaction.id } }
|
|
52
|
-
}, ['
|
|
52
|
+
}, ['id', 'typeOf', 'project'], [])).shift();
|
|
53
53
|
if (authorizeInvoiceAction !== undefined) {
|
|
54
54
|
const cancelAction = {
|
|
55
55
|
startTime: new Date(),
|
|
@@ -14,11 +14,11 @@ declare function payFaceToFace(params: factory.action.trade.pay.IAttributes): (r
|
|
|
14
14
|
accountingReport: AccountingReportRepo;
|
|
15
15
|
product: ProductRepo;
|
|
16
16
|
task: TaskRepo;
|
|
17
|
-
}) => Promise<
|
|
17
|
+
}) => Promise<void>;
|
|
18
18
|
declare function refundFaceToFace(params: factory.task.refund.IData): (repos: {
|
|
19
19
|
action: ActionRepo;
|
|
20
20
|
accountingReport: AccountingReportRepo;
|
|
21
21
|
product: ProductRepo;
|
|
22
22
|
task: TaskRepo;
|
|
23
|
-
}) => Promise<
|
|
23
|
+
}) => Promise<void>;
|
|
24
24
|
export { payFaceToFace, refundFaceToFace, voidTransaction };
|
|
@@ -10,6 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.voidTransaction = exports.refundFaceToFace = exports.payFaceToFace = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* 対面決済サービス
|
|
15
|
+
*/
|
|
16
|
+
const factory = require("../../factory");
|
|
13
17
|
const onPaid_1 = require("./any/onPaid");
|
|
14
18
|
const onRefund_1 = require("./any/onRefund");
|
|
15
19
|
function voidTransaction(__) {
|
|
@@ -20,8 +24,7 @@ function voidTransaction(__) {
|
|
|
20
24
|
exports.voidTransaction = voidTransaction;
|
|
21
25
|
function payFaceToFace(params) {
|
|
22
26
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
|
|
24
|
-
let action = yield repos.action.start(params);
|
|
27
|
+
const action = yield repos.action.start(params);
|
|
25
28
|
try {
|
|
26
29
|
// no op
|
|
27
30
|
}
|
|
@@ -34,17 +37,24 @@ function payFaceToFace(params) {
|
|
|
34
37
|
}
|
|
35
38
|
throw error;
|
|
36
39
|
}
|
|
37
|
-
// アクション完了
|
|
38
40
|
const actionResult = {};
|
|
39
|
-
|
|
40
|
-
yield (0, onPaid_1.onPaid)(
|
|
41
|
-
|
|
41
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
42
|
+
yield (0, onPaid_1.onPaid)({
|
|
43
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
44
|
+
id: action.id,
|
|
45
|
+
object: params.object,
|
|
46
|
+
potentialActions: params.potentialActions,
|
|
47
|
+
project: params.project,
|
|
48
|
+
purpose: params.purpose,
|
|
49
|
+
typeOf: action.typeOf
|
|
50
|
+
})(repos);
|
|
51
|
+
// return action;
|
|
42
52
|
});
|
|
43
53
|
}
|
|
44
54
|
exports.payFaceToFace = payFaceToFace;
|
|
45
55
|
function refundFaceToFace(params) {
|
|
46
56
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
|
|
57
|
+
const action = yield repos.action.start(params);
|
|
48
58
|
try {
|
|
49
59
|
// no op
|
|
50
60
|
}
|
|
@@ -58,9 +68,17 @@ function refundFaceToFace(params) {
|
|
|
58
68
|
throw error;
|
|
59
69
|
}
|
|
60
70
|
const actionResult = {};
|
|
61
|
-
|
|
62
|
-
yield (0, onRefund_1.onRefund)(
|
|
63
|
-
|
|
71
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
|
|
72
|
+
yield (0, onRefund_1.onRefund)({
|
|
73
|
+
actionStatus: factory.actionStatusType.CompletedActionStatus,
|
|
74
|
+
id: action.id,
|
|
75
|
+
object: params.object,
|
|
76
|
+
potentialActions: params.potentialActions,
|
|
77
|
+
project: params.project,
|
|
78
|
+
purpose: params.purpose,
|
|
79
|
+
typeOf: action.typeOf
|
|
80
|
+
})(repos);
|
|
81
|
+
// return action;
|
|
64
82
|
});
|
|
65
83
|
}
|
|
66
84
|
exports.refundFaceToFace = refundFaceToFace;
|
|
@@ -10,7 +10,6 @@ import { Settings } from '../../../settings';
|
|
|
10
10
|
interface IAuthorizeResult {
|
|
11
11
|
accountId: string;
|
|
12
12
|
accountsReceivablesByServiceType: factory.assetTransaction.pay.IAccountsReceivableByServiceType[];
|
|
13
|
-
payAction: factory.action.trade.pay.IAction;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
15
|
* 決済カード承認
|
|
@@ -22,7 +22,7 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
22
22
|
return (repos, settings) => __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
let accountId;
|
|
25
|
-
let payAction;
|
|
25
|
+
// let payAction: factory.action.trade.pay.IAction;
|
|
26
26
|
let accountsReceivablesByServiceType = [];
|
|
27
27
|
try {
|
|
28
28
|
// MovieTicket決済の場合、認証
|
|
@@ -64,7 +64,8 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
64
64
|
? { sameAs: { id: options.executor.id, typeOf: 'Task' } } // link sameAs(2024-06-04~)
|
|
65
65
|
: undefined);
|
|
66
66
|
// 着券させざるをえないが、informPaymentはしない(注文がまだ存在しないため)
|
|
67
|
-
payAction =
|
|
67
|
+
// payAction = await payMovieTicket(payActionAttributes)(repos, settings);
|
|
68
|
+
yield (0, payMovieTicket_1.payMovieTicket)(payActionAttributes)(repos, settings);
|
|
68
69
|
}
|
|
69
70
|
catch (error) {
|
|
70
71
|
// アクション保管用のエラーと両方throw(2024-05-22~)
|
|
@@ -76,7 +77,11 @@ function authorize(params, transaction, paymentServiceId, useCheckByIdentifierIf
|
|
|
76
77
|
}
|
|
77
78
|
// throw handleMvtkReserveError(error);
|
|
78
79
|
}
|
|
79
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
accountId,
|
|
82
|
+
// payAction, // discontinue(2024-08-28~)
|
|
83
|
+
accountsReceivablesByServiceType
|
|
84
|
+
};
|
|
80
85
|
});
|
|
81
86
|
}
|
|
82
87
|
exports.authorize = authorize;
|
|
@@ -17,9 +17,8 @@ interface IPayOperationRepos {
|
|
|
17
17
|
task: TaskRepo;
|
|
18
18
|
}
|
|
19
19
|
type IPayOperation<T> = (repos: IPayOperationRepos, settings: Settings) => Promise<T>;
|
|
20
|
-
type IPayAction = factory.action.trade.pay.IAction;
|
|
21
20
|
/**
|
|
22
21
|
* 決済カード決済
|
|
23
22
|
*/
|
|
24
|
-
declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<
|
|
23
|
+
declare function payMovieTicket(params: factory.action.trade.pay.IAttributes): IPayOperation<void>;
|
|
25
24
|
export { payMovieTicket };
|