Пример #1
0
        protected override async Task RefreshAccessToken(CancellationToken cancellationToken)
        {
            var mark = Mark.CreateNew();

            var response = await this.ThrottleRequest(SquareEndPoint.ObtainOAuth2TokenUrl, this.Credentials.AccessToken, mark, (token) =>
            {
                var service = new SquareAuthenticationService(base.Config);
                return(service.RefreshAccessToken(this.Credentials.RefreshToken, token));
            }, cancellationToken).ConfigureAwait(false);

            this.Credentials.AccessToken      = response.AccessToken;
            this.ApiConfiguration.AccessToken = response.AccessToken;
        }
Пример #2
0
 public void Init()
 {
     this._authenticationService = new SquareAuthenticationService(this.Config);
     this._applicationId         = this.Config.ApplicationId;
 }