public VATApi(string UrlSite, OAuthApplication Application, OAuthToken Token, string VRN, UpdateOAuthTokenDelegate UpdateOAuthToken = null) { application = Application; token = Token; urlSite = UrlSite; updateOAuthToken = UpdateOAuthToken; setVRN(VRN); ApplicationProcessor = new MTDApplicationProcessor(UrlSite); }
public VATApi(OAuthSettings Application, OAuthToken Token, string VRN, Dictionary <string, string> FraudHeaders, SaveOAuthTokenDelegate SaveOAuthToken = null) { application = Application; token = Token; urlSite = Application.ServerUrl; saveOAuthToken = SaveOAuthToken; setVRN(VRN); fraudHeaders = FraudHeaders; ApplicationProcessor = new MTDApplicationProcessor(Application.ServerUrl); try { if (token != null && token.RefreshToken != null) { RefreshAccessToken(); } } catch (VATAPIInvalidToken) { // if (ex.Code == "asd") // token = new OAuthToken(); } }