Class GiftCard
- Namespace
- Dynamicweb.Ecommerce.GiftCards
- Assembly
- Dynamicweb.Ecommerce.dll
Represents a gift card: a prepaid balance, identified by a code, that can be redeemed against orders until it expires or is spent.
[Serializable]
public class GiftCard
- Inheritance
-
GiftCard
- Inherited Members
Constructors
GiftCard(bool)
Initializes a new instance of GiftCard.
public GiftCard(bool generateNewCode)
Parameters
generateNewCodeboolWhen
true, assigns a freshly generated Code and an ExpiryDate derived from the configured expiration period. Whenfalse, both are left unset for the caller or the repository to populate.
Properties
Code
Gets the redemption code. Stored encrypted; see DecryptCode(string).
public string Code { get; }
Property Value
CreationDate
Gets or sets the date the gift card was created.
public DateTime CreationDate { get; set; }
Property Value
CurrencyCode
Gets or sets the code of the Currency the balance is held in. A gift card is only applied to an order in the same currency.
public required string CurrencyCode { get; set; }
Property Value
ExpiryDate
Gets the date the gift card expires, after which it can no longer be applied to an order.
public DateTime ExpiryDate { get; }
Property Value
GiftCardId
Gets or sets the gift card identifier used to look the gift card up and to relate its transactions.
public string GiftCardId { get; set; }
Property Value
ID
Gets or sets the database identity of the gift card. Zero until the gift card has been saved.
public int ID { get; set; }
Property Value
InitialAmount
Gets or sets the amount the gift card was issued with, before any redemptions.
public double InitialAmount { get; set; }
Property Value
IsNew
Gets a value indicating whether the gift card has not been persisted yet.
public bool IsNew { get; }
Property Value
Name
Gets or sets the gift card name, shown on the discount order line when the card is applied.
public required string Name { get; set; }
Property Value
VATPercent
Gets or sets the VAT percent applied to the gift card amount, or null when none is recorded.
public double? VATPercent { get; set; }