Browse Source

Updated payment types

Only paypal and demo
pull/53/head
Galip Tolga Erdem 5 years ago
parent
commit
1314353806
  1. 2
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs
  2. 5
      services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/PaymentType.cs

2
services/ordering/src/EShopOnAbp.OrderingService.Domain/Buyers/Buyer.cs

@ -21,7 +21,7 @@ public class Buyer : AggregateRoot<Guid>
[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));
}

5
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<PaymentType> List() =>
new[] {Paypal, Visa, Visa, MasterCard};
new[] {Paypal, Demo};
public static PaymentType FromName(string name)
{

Loading…
Cancel
Save