payment method
This commit is contained in:
@@ -318,7 +318,7 @@ export class CartService {
|
||||
}
|
||||
|
||||
cart.paymentMethodId = setPaymentMethodDto.paymentMethodId;
|
||||
cart.paymentMethodFee = Number(restaurantPaymentMethod.price) || 0;
|
||||
// cart.paymentMethodFee = Number(restaurantPaymentMethod.price) || 0;
|
||||
|
||||
// Recalculate cart totals to include payment method fee
|
||||
await this.recalculateCartTotals(cart);
|
||||
@@ -374,15 +374,16 @@ export class CartService {
|
||||
|
||||
// Get payment method fee if payment method is set
|
||||
let paymentMethodFee = 0;
|
||||
if (cart.paymentMethodId) {
|
||||
const restaurantPaymentMethod = await this.em.findOne(RestaurantPaymentMethod, {
|
||||
restaurant: { id: cart.restaurantId },
|
||||
paymentMethod: { id: cart.paymentMethodId },
|
||||
});
|
||||
if (restaurantPaymentMethod) {
|
||||
paymentMethodFee = Number(restaurantPaymentMethod.price) || 0;
|
||||
}
|
||||
}
|
||||
// if (cart.paymentMethodId) {
|
||||
// const restaurantPaymentMethod = await this.em.findOne(RestaurantPaymentMethod, {
|
||||
// restaurant: { id: cart.restaurantId },
|
||||
// paymentMethod: { id: cart.paymentMethodId },
|
||||
// });
|
||||
// if (restaurantPaymentMethod) {
|
||||
// paymentMethodFee = Number(restaurantPaymentMethod.price) || 0;
|
||||
// paymentMethodFee = 1;
|
||||
// }
|
||||
// }
|
||||
cart.paymentMethodFee = paymentMethodFee;
|
||||
|
||||
// Final price includes items, discounts, VAT, and payment method fee
|
||||
|
||||
Reference in New Issue
Block a user