Owneat Technical Guide main Help

Class Payment

Namespace: Payment.Domain.Aggregates.Payment
Assembly: Payment.Domain.dll

[Table("Payments")] public sealed class Payment : Entity, IAuditable

Inheritance

object ← Entity ← Payment

Implements

IAuditable

Inherited Members

Entity.Id, Entity.CreatedAt, Entity.UpdatedAt, Entity.DomainEvents, object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)

Constructors

Payment\(\)

public Payment()

Properties

Amount

The amount of the Payment.Domain.Aggregates.Payment.Payment.

public double Amount { get; init; }

Property Value

double

Currency

The currency of the Payment.Domain.Aggregates.Payment.Payment.

public Currency Currency { get; init; }

Property Value

Currency

CustomerId

The id of the billed customer.

public Guid CustomerId { get; init; }

Property Value

Guid

IsRestaurantCredit

Bool that indicate if the Payment.Domain.Aggregates.Payment.Payment is initiated by the restaurant for any reason.

public bool IsRestaurantCredit { get; init; }

Property Value

bool

OrdersIds

List of order ids contained in a Payment.Domain.Aggregates.Payment.Payment.

public IEnumerable<Guid> OrdersIds { get; }

Property Value

IEnumerable < Guid \>

Link to make the Payment.Domain.Aggregates.Payment.Payment.

[MaxLength(500)] public string? PaymentLink { get; }

Property Value

string?

PaymentMode

The Payment.Domain.Aggregates.Payment.PaymentPayment.Domain.Aggregates.Payment.Payment.PaymentMode.

public PaymentMode PaymentMode { get; init; }

Property Value

PaymentMode

PaymentSessionId

Id of the stripe session that permits the Payment.Domain.Aggregates.Payment.Payment.

[MaxLength(200)] public string? PaymentSessionId { get; }

Property Value

string?

ProductsIds

List of product ids contained in a Payment.Domain.Aggregates.Payment.Payment.

public IEnumerable<Guid> ProductsIds { get; }

Property Value

IEnumerable < Guid \>

Status

The current status of the Payment.Domain.Aggregates.Payment.Payment.

public PaymentStatus Status { get; }

Property Value

PaymentStatus

TableId

The id of the table.

public Guid? TableId { get; set; }

Property Value

Guid?

TipAmount

The Payment.Domain.Aggregates.Payment.Payment tip amount.

public double TipAmount { get; set; }

Property Value

double

Methods

Create\(double, double, bool, Guid, Guid, string, string\)

Method that create a Payment.Domain.Aggregates.Payment.Payment.

public static Payment Create(double amount, double tipAmount, bool isRestaurantCredit, Guid customerId, Guid tableId, string paymentLink, string paymentSessionId)

Parameters

amount double

Payment.Domain.Aggregates.Payment.Payment.Amount of the Payment.Domain.Aggregates.Payment.Payment.

tipAmount double

Payment.Domain.Aggregates.Payment.Payment.TipAmount of the Payment.Domain.Aggregates.Payment.Payment.

isRestaurantCredit bool

isRestaurantCredit of the Payment.Domain.Aggregates.Payment.Payment.

customerId Guid

Payment.Domain.Aggregates.Payment.Payment.CustomerId of the Payment.Domain.Aggregates.Payment.Payment.

tableId Guid

Payment.Domain.Aggregates.Payment.Payment.TableId of the Payment.Domain.Aggregates.Payment.Payment.

paymentLink string

Payment.Domain.Aggregates.Payment.Payment.PaymentLink of the Payment.Domain.Aggregates.Payment.Payment.

paymentSessionId string

Payment.Domain.Aggregates.Payment.Payment.PaymentSessionId of the Payment.Domain.Aggregates.Payment.Payment

Returns

Payment

The created Payment.Domain.Aggregates.Payment.Payment.

Expire\(\)

Method that sets the Payment.Domain.Aggregates.Payment.Payment to expired.

public void Expire()

RemoveFromTable\(\)

Method that remove a payment from a table.

public void RemoveFromTable()

ValidateSuccess\(\)

Method that sets the Payment.Domain.Aggregates.Payment.Payment to successful.

public void ValidateSuccess()
Last modified: 21 May 2024