paymnet methods cards new table

This commit is contained in:
2026-06-28 22:41:50 +03:30
parent a565f93044
commit 604447d3e8
10 changed files with 262 additions and 111 deletions
@@ -57,7 +57,7 @@ export class PaymentsService {
const order = await this.em.findOne(
Order,
{ id: orderId },
{ populate: ['user', 'restaurant', 'paymentMethod', 'paymentMethod.restaurant'] },
{ populate: ['user', 'restaurant', 'paymentMethod', 'paymentMethod.restaurant', 'paymentMethod.cards'] },
);
if (!order) {
@@ -79,13 +79,6 @@ export class PaymentsService {
if (!pm.restaurant?.domain) throw new BadRequestException(PaymentMessage.RESTAURANT_DOMAIN_REQUIRED);
}
if (pm.method === PaymentMethodEnum.CreditCard && !pm.cardNumber) {
throw new BadRequestException(PaymentMessage.CARD_NUMBER_REQUIRED);
}
if (pm.method === PaymentMethodEnum.CreditCard && !pm.cardOwner?.trim()) {
throw new BadRequestException(PaymentMessage.CARD_OWNER_REQUIRED);
}
return {
order,