|
|
@ -8,22 +8,24 @@ namespace Payment.PaymentRequests |
|
|
public class PaymentRequest : CreationAuditedAggregateRoot<Guid>, ISoftDelete |
|
|
public class PaymentRequest : CreationAuditedAggregateRoot<Guid>, ISoftDelete |
|
|
{ |
|
|
{ |
|
|
[CanBeNull] |
|
|
[CanBeNull] |
|
|
public string CustomerId { get; private set; } |
|
|
public string CustomerId { get; protected set; } |
|
|
|
|
|
|
|
|
[CanBeNull] |
|
|
[CanBeNull] |
|
|
public string ProductId { get; private set; } |
|
|
public string ProductId { get; protected set; } |
|
|
|
|
|
|
|
|
[NotNull] |
|
|
[NotNull] |
|
|
public string ProductName { get; private set; } |
|
|
public string ProductName { get; protected set; } |
|
|
|
|
|
|
|
|
public decimal Price { get; private set; } |
|
|
public decimal Price { get; protected set; } |
|
|
|
|
|
|
|
|
public string Currency { get; private set; } |
|
|
public string Currency { get; protected set; } |
|
|
|
|
|
|
|
|
public PaymentRequestState State { get; set; } |
|
|
public PaymentRequestState State { get; protected set; } |
|
|
|
|
|
|
|
|
public bool IsDeleted { get; set; } |
|
|
public bool IsDeleted { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public string FailReason { get; protected set; } |
|
|
|
|
|
|
|
|
private PaymentRequest() |
|
|
private PaymentRequest() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
@ -44,5 +46,17 @@ namespace Payment.PaymentRequests |
|
|
Price = price; |
|
|
Price = price; |
|
|
Currency = currency; |
|
|
Currency = currency; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual void SetAsCompleted() |
|
|
|
|
|
{ |
|
|
|
|
|
State = PaymentRequestState.Completed; |
|
|
|
|
|
FailReason = null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual void SetAsFailed(string failReason) |
|
|
|
|
|
{ |
|
|
|
|
|
State = PaymentRequestState.Failed; |
|
|
|
|
|
FailReason = failReason; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |