Exemple #1
0
        private static DebitCardView create(DebitCard card)
        {
            var view = new DebitCardView
            {
                CardNumber       = card?.Data?.Number,
                DailyLimit       = card?.DailyLimit?.Amount ?? 0,
                CurrencyID       = card?.Data?.CurrencyID,
                BillingAddress   = card?.Data?.Address,
                CardName         = card?.Data?.Organization,
                NameOnCard       = card?.Data?.Name,
                VerificationCode = card?.Data?.Code,
                IssueNumber      = card?.Data?.Issue,
                ID         = card?.Data?.ID,
                ValidFrom  = card?.Data?.ValidFrom,
                ExpireDate = card?.Data?.ValidTo
            };

            return(view);
        }
Exemple #2
0
        public static DebitCard Create(DebitCardView view)
        {
            var card = new DebitCardData
            {
                Number       = view?.CardNumber,
                DailyLimit   = view?.DailyLimit ?? 0,
                CurrencyID   = view?.CurrencyID,
                Address      = view?.BillingAddress,
                Organization = view?.CardName,
                Name         = view?.NameOnCard,
                Code         = view?.VerificationCode,
                Issue        = view?.IssueNumber,
                ID           = view?.ID,
                ValidFrom    = view?.ValidFrom ?? DateTime.MinValue,
                ValidTo      = view?.ExpireDate ?? DateTime.MaxValue
            };

            card.Currency = new CurrencyData {
                ID = card.CurrencyID
            };
            return(new DebitCard(card));
        }