SubscriptionInfo CreateSubscription(string userId, Voucher voucher)
 {
     return(new SubscriptionInfo
     {
         UserId = userId.Or(voucher.UserId),
         TransactionId = voucher.Id,
         SubscriptionDate = voucher.ActivationDate,
         ExpirationDate = voucher.ExpirationDate()
     });
 }
Esempio n. 2
0
 SubscriptionInfo CreateSubscription(Voucher voucher)
 {
     return(new SubscriptionInfo
     {
         UserId = voucher.UserId,
         TransactionId = voucher.Id,
         SubscriptionDate = voucher.ActivationDate,
         ExpirationDate = voucher.ExpirationDate(),
         CancellationDate = null,
         AutoRenews = false
     });
 }
 public static bool IsExpired(this Voucher @this) => @this.ExpirationDate()?.IsInThePast() == true;