confirm payment

This commit is contained in:
2026-01-19 11:23:11 +03:30
parent 87da6a8c10
commit 26d2d0e053
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ export class OrderService {
orderItem.status = OrderItemStatus.CONFIRMED
this.em.persistAndFlush(OrderItem)
await this.em.persistAndFlush(OrderItem)
return orderItem
}
@@ -71,11 +71,13 @@ export class PaymentService {
throw new BadRequestException("you can not pay beause Balance is zero")
}
if (amount <= 0) {
throw new BadRequestException(PaymentMessage.AMOUNT_MUST_BE_GREATER_THAN_ZERO);
}
if (amount > order.balance) {
throw new BadRequestException(`You cant pay more than ${order.balance}`);
}
return {
user: order.user,