protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.TRANSACTIONS }); } else { var transactionstat = client.TransactionsStats( authorization.AccessToken, new TransactionStatsType[] { TransactionStatsType.TRANSACTIONSCOUNT, TransactionStatsType.TRANSACTIONSTOTAL }, new DateTime(2011, 6, 1), new DateTime(2011, 6, 15)); if (transactionstat == null) { var l = new Label(); l.Text = "No transaction stat found"; this.transactionstatHolder.Controls.Add(l); } else { var table = WebUIUtility.BuildFieldDescTable( new Tuple <string, string>[] { Tuple.Create("TransactionsCount", transactionstat.TransactionsCount.ToString()), Tuple.Create("TransactionsTotal", transactionstat.TransactionsTotal.ToString()), }); this.transactionstatHolder.Controls.Add(table); this.transactionstatHolder.Controls.Add(WebUIUtility.HorizontalLine()); } } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.ACCOUNTINFOFULL }); } else { var accountInfo = client.AccountInformation(authorization.AccessToken); var table = WebUIUtility.BuildFieldDescTable( new Tuple <string, string>[] { Tuple.Create("Id", accountInfo.Id), Tuple.Create("Name", accountInfo.Name), Tuple.Create("Latitude", accountInfo.Latitude.ToString()), Tuple.Create("Longitude", accountInfo.Longitude.ToString()), Tuple.Create("Type", accountInfo.Type.Value), Tuple.Create("City", accountInfo.City), Tuple.Create("State", accountInfo.State), } ); this.accountInfoHolder.Controls.Add(table); this.accountInfoHolder.Controls.Add(WebUIUtility.HorizontalLine()); } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.REQUEST }); } else { var request = client.Request(authorization.AccessToken, 1111, "812-111-1111", 1, UserType.DWOLLA, null, "Test"); this.requestLabel.Text = HttpUtility.HtmlEncode(request); } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.BALANCE }); } else { var balance = client.AccountBalance(authorization.AccessToken); this.nameLabel.Text = HttpUtility.HtmlEncode(balance); } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.SEND }); } else { var send = client.Send(authorization.AccessToken, 1111, "812-111-1111", null, 1, 0, null, "Test"); this.sendLabel.Text = HttpUtility.HtmlEncode(send); } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.TRANSACTIONS }); } else { var transactions = client.TransactionsListing(authorization.AccessToken); if (!transactions.Any()) { var l = new Label(); l.Text = "No transactions found"; this.transactionsHolder.Controls.Add(l); } else { foreach (TransactionsResult transaction in transactions) { var table = WebUIUtility.BuildFieldDescTable( new Tuple <string, string>[] { Tuple.Create("Id", transaction.Id), Tuple.Create("Date", transaction.Date.ToString()), Tuple.Create("Amount", transaction.Amount.ToString()), Tuple.Create("DestinationId", transaction.DestinationId), Tuple.Create("DestinationName", transaction.DestinationName), Tuple.Create("SourceId", transaction.SourceId), Tuple.Create("SourceName", transaction.SourceName), Tuple.Create("SourceType", transaction.Type.Value), Tuple.Create("UserType", transaction.UserType.Value), Tuple.Create("Status", transaction.Status.Value), Tuple.Create("ClearingDate", transaction.ClearingDate.ToString()), } ); this.transactionsHolder.Controls.Add(table); this.transactionsHolder.Controls.Add(WebUIUtility.HorizontalLine()); } } } }
protected void Page_Load(object sender, EventArgs e) { IAuthorizationState authorization = client.ProcessUserAuthorization(); if (authorization == null) { client.RequestUserAuthorization(new Scope[] { Scope.CONTACTS }); } else { var contacts = client.Contacts(authorization.AccessToken); if (!contacts.Any()) { var l = new Label(); l.Text = "No contacts found."; this.contactsHolder.Controls.Add(l); } else { foreach (ContactsResult contact in contacts) { var table = WebUIUtility.BuildFieldDescTable( new Tuple <string, string>[] { Tuple.Create("Id", contact.Id), Tuple.Create("Name", contact.Name), Tuple.Create("Image", contact.Image), Tuple.Create("Type", contact.Type.Value), } ); this.contactsHolder.Controls.Add(table); this.contactsHolder.Controls.Add(WebUIUtility.HorizontalLine()); } } } }