Inheritance: DefaultsViewModelBase
示例#1
0
		public TokenPaymentPage(Judo judo, TokenPaymentDefaultsViewModel model) : base(judo, model)
		{
			tokenViewModel.Amount = Judo.Amount;
			tokenViewModel.JudoID = Judo.JudoId;
			tokenViewModel.Currency = Judo.Currency;
			tokenViewModel.ConsumerReference = Judo.ConsumerReference;
			tokenViewModel.Token = model.CardToken;
			tokenViewModel.ConsumerToken = model.ConsumerToken;
		}
		public CardEntryPage(Judo judo, TokenPaymentDefaultsViewModel defaults) : this(judo)
		{
			_isTokenPayment = true;
			SetUpDefaults(defaults);
		}
		void SetUpDefaults(TokenPaymentDefaultsViewModel defaults)
		{
			cardNumberEntry.Format = "";
			cardNumberEntry.Text = defaults.MaskedCardNumber;
			cardImage.Opacity = !string.IsNullOrWhiteSpace(defaults.MaskedCardNumber) ? 1 : 0.5;
			expiryDateEntry.Text = defaults.ExpiryDate;
			expiryDateEntry.Format = "";
			cardNumberEntry.IsEnabled = false;
			expiryDateEntry.IsEnabled = false;
			startDateEntry.IsEnabled = false;
			issueNumberEntry.IsEnabled = false;
			_currentDiscoveredNetwork = defaults.CardNetork;
			UpdateCardIcons();
			UpdateCvvMaxLength();
			_currentDiscoveredNetwork.SetAvsEnabled(Judo.AvsEnabled);
		}