Esempio n. 1
0
 SubscriptionInfo CreateSubscription(string userId, CafeBazaarValidatePurchaseResult purchase, CafeBazaarValidateSubscriptionResult subscription)
 {
     return(new SubscriptionInfo
     {
         UserId = userId.Or(purchase.DeveloperPayload),
         TransactionId = Guid.NewGuid().ToString(),
         SubscriptionDate = subscription.InitiationTime.DateTime,
         ExpirationDate = subscription.ValidUntil.DateTime,
         CancellationDate = purchase.PurchaseState == CafeBazaarPurchaseState.Refunded ? LocalTime.UtcNow : null,
         AutoRenews = subscription.AutoRenewing
     });
 }
 SubscriptionInfo CreateSubscription(CafeBazaarValidatePurchaseResult purchase, CafeBazaarValidateSubscriptionResult subscription)
 {
     return(new SubscriptionInfo
     {
         UserId = purchase.DeveloperPayload,
         TransactionId = null,
         SubscriptionDate = subscription.InitiationTime.DateTime,
         ExpirationDate = subscription.ValidUntil.DateTime,
         CancellationDate = purchase.PurchaseState == CafeBazaarPurchaseState.Refunded ? (DateTime?)LocalTime.UtcNow : null,
         AutoRenews = subscription.AutoRenewing
     });
 }