Example #1
0
        public async Task Authorize()
        {
            String username = CrossSecureStorage.Current.GetValue("username");
            String password = CrossSecureStorage.Current.GetValue("password");

            Debug.WriteLine("Authorizing...");
            await client.LoginAsync(username, password);

            expirationDate = DateTime.Now.AddSeconds(client.OAuthTokens.ExpiresIn);
            Debug.WriteLine("New token will expire on " + expirationDate.ToString("dd/MM/yyyy HH:mm:ss"));
        }
Example #2
0
        private static async Task Run(string username, string password)
        {
            using (var client = new OvClient())
            {
                var loginResponse = await client.LoginAsync(username, password);

                if (!loginResponse)
                {
                    return;
                }

                Console.WriteLine(JsonConvert.SerializeObject(client.OAuthTokens, Formatting.Indented));
                Console.WriteLine(client.AuthorizationToken);

                var cards = await client.GetCardsAsync();

                Console.WriteLine(JsonConvert.SerializeObject(await client.GetTransactionsAsync(cards.Data[0].MediumId), Formatting.Indented));
            }
        }