コード例 #1
0
        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);
        }
コード例 #2
0
        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();
            }
        }