private static void ValidateCardManagerParams(CardManagerParams @params) { if (@params.CardCrypto == null) { throw new ArgumentException($"{nameof(@params.CardCrypto)} property is mandatory"); } if (@params.AccessTokenProvider == null) { throw new ArgumentException($"{nameof(@params.AccessTokenProvider)} property is mandatory"); } }
/// <summary> /// Initializes a new instance of the <see cref="CardManager"/> class by /// a specified set of parameters. /// </summary> /// <param name="params">the instance of <see cref="CardManagerParams"/>. </param> public CardManager(CardManagerParams @params) { ValidateCardManagerParams(@params); this.CardCrypto = @params.CardCrypto; this.AccessTokenProvider = @params.AccessTokenProvider; this.Client = string.IsNullOrWhiteSpace(@params.ApiUrl) ? new CardClient() : new CardClient(@params.ApiUrl); this.CardVerifier = @params.Verifier; this.ModelSigner = new ModelSigner(CardCrypto); this.SignCallBack = @params.SignCallBack; this.RetryOnUnauthorized = @params.RetryOnUnauthorized; }