public void Can_create_link_token() { // Arrange var sut = new PlaidClient(Environment.Sandbox); var request = new Management.CreateLinkTokenRequest() { ClientName = "Example Client Name", Language = "en", CountryCodes = new string[] { "US" }, User = new Management.CreateLinkTokenRequest.UserInfo { ClientUserId = Guid.NewGuid().ToString() }, Products = new string[] { "auth" } }.UseDefaultsWithNoAccessToken(); // Act var result = sut.CreateLinkToken(request).Result; // Assert result.IsSuccessStatusCode.ShouldBeTrue(); result.RequestId.ShouldNotBeNullOrEmpty(); result.LinkToken.ShouldNotBeNullOrEmpty(); result.Expiration.ShouldNotBeNullOrEmpty(); }
public async Task OnGetAsync() { var client = new PlaidClient(_clientId, _secrets, null, Environment.Sandbox); var response = await client.CreateLinkToken(new Management.CreateLinkTokenRequest { ClientName = "Example", ClientId = _clientId, Secret = _secrets, CountryCodes = new string[] { "US" }, Products = new string[] { "auth", "transactions" }, User = new Management.CreateLinkTokenRequest.UserInfo { ClientUserId = Guid.NewGuid().ToString() } }); LinkToken = response.LinkToken; }
public async System.Threading.Tasks.Task <IActionResult> CreateLinkAsync() { var client = new PlaidClient(_clientId, _secrets, null, Acklann.Plaid.Environment.Sandbox); var response = await client.CreateLinkToken(new Acklann.Plaid.Management.CreateLinkTokenRequest { ClientName = "Example", ClientId = _clientId, Secret = _secrets, CountryCodes = new string[] { "US" }, Products = new string[] { "auth", "transactions" }, User = new Acklann.Plaid.Management.CreateLinkTokenRequest.UserInfo { ClientUserId = Guid.NewGuid().ToString() } }); return(Json(response)); }