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) {