public static Repository CreateRepository() { // Load the private certificate from disk using the password used to create it X509Certificate2 privateCertificate = new X509Certificate2(@"D:\Stevie-Cert.pfx", "xero"); IOAuthSession consumerSession = new XeroApiPrivateSession(UserAgentString, ConsumerKey, privateCertificate); consumerSession.MessageLogger = new DebugMessageLogger(); // Wrap the authenticated consumerSession in the repository... return(new Repository(consumerSession)); }
XeroCoreApi api_User; //Api User According to the Skinny Wrapper //This Method Create Reposirity in the Xero System public Repository CreateRepository() { try { //Load the proivate Certificate from the DISK using the Password to Create it X509Certificate2 privateCertificate = new X509Certificate2(@"C:\SSLCertificate\\public_privatekey.pfx", "@dmin123"); IOAuthSession consumerSession = new XeroApiPrivateSession("MyAPITestSoftware", "QXHJ4IHP7KJPKGRR0SDRUOO8LTE063", privateCertificate); consumerSession.MessageLogger = new DebugMessageLogger(); return(new Repository(consumerSession)); } catch (Exception ex) { Console.WriteLine(ex.StackTrace.ToString() + ":" + ex.Message.ToString()); return(null); } }