From 1314353806d716e9334a697e363cd6e47006ac89 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Tue, 4 Jan 2022 12:39:51 +0300 Subject: [PATCH] Updated payment types Only paypal and demo --- .../src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs | 2 +- .../EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs index 6ab142e4..451eccfd 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs @@ -21,7 +21,7 @@ public class Buyer : AggregateRoot [NotNull] string email, PaymentType paymentType) : base(id) { - _paymentTypeId = PaymentType.FromName(paymentType.Name).Id; + _paymentTypeId = paymentType.Id; Name = Check.NotNullOrEmpty(name, nameof(name)); Email = Check.NotNullOrEmpty(email, nameof(email)); } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs index afd15501..5ee66b7b 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs @@ -8,15 +8,14 @@ namespace EShopOnAbp.OrderingService.Buyers; public class PaymentType : Enumeration { public static PaymentType Paypal = new PaymentType(1, nameof(Paypal).ToLowerInvariant()); - public static PaymentType Visa = new PaymentType(1, nameof(Visa).ToLowerInvariant()); - public static PaymentType MasterCard = new PaymentType(1, nameof(MasterCard).ToLowerInvariant()); + public static PaymentType Demo = new PaymentType(2, nameof(Paypal).ToLowerInvariant()); public PaymentType(int id, string name) : base(id, name) { } public static IEnumerable List() => - new[] {Paypal, Visa, Visa, MasterCard}; + new[] {Paypal, Demo}; public static PaymentType FromName(string name) {