update : add log
This commit is contained in:
@@ -136,15 +136,19 @@ class PaymentService {
|
||||
if (!paymentMethod) throw new BadRequestError(PaymentMessage.PaymentMethodNotFound);
|
||||
|
||||
const { price, description } = this.calculateTotalPrice(cart, cartShipmentItems);
|
||||
|
||||
console.log("start handle payment");
|
||||
// extracted to handle payment creation
|
||||
const { payment, paymentData } = await this.handlePaymentCreation(paymentMethod, price, user, description, session);
|
||||
console.log("handle payment done");
|
||||
|
||||
console.log("start create order");
|
||||
// create order and order items
|
||||
const { order, orderItems } = await this.orderService.createOrder(user, payment, cartShipmentItems, session);
|
||||
|
||||
console.log("create order done");
|
||||
// clear cart and adjust stock
|
||||
console.log("start finalize order");
|
||||
await this.finalizeOrder(user, cartShipmentItems, session);
|
||||
console.log("Done");
|
||||
|
||||
await session.commitTransaction();
|
||||
await session.endSession();
|
||||
|
||||
Reference in New Issue
Block a user