diff --git a/README.md b/README.md index 8199f93..5210108 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ # NordigenApiClient -This library provides a .NET client for the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following API endpoints are supported: +This library provides a .NET client for +the [GoCardless Bank Account Data API](https://gocardless.com/bank-account-data/) (formerly Nordigen API). The following +API endpoints are supported: - Token - Institutions @@ -12,7 +14,9 @@ This library provides a .NET client for the [GoCardless Bank Account Data API](h - Requisitions - Accounts -You can get started with the Quickstart Guide below or take a look at the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient). +You can get started with the Quickstart Guide below or take a look at +the [full documentation](https://robintty.github.io/NordigenApiClient/). You can find the nuget +package [here](https://www.nuget.org/packages/RobinTTY.NordigenApiClient). ## Quickstart Guide @@ -61,11 +65,13 @@ You can get started with the Quickstart Guide below or take a look at the [full Console.WriteLine($"Requisition couldn't be created: {requisitionResponse.Error.Summary}"); ``` -5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The authentication flow will roughly look like this: +5. You will now need to accept the end user agreement by following the authentication link you got in the last step. The + authentication flow will roughly look like this: ![authentication-flow](docs/static/img/authentication_flow.png) -6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This time the response will include the accounts you are now able to access. +6. Now that you have accepted the agreement we once again need to retrieve the requisition we created in step 4. This + time the response will include the accounts you are now able to access. ```cs var requisitionId = "your-requisition-id"; @@ -79,7 +85,8 @@ You can get started with the Quickstart Guide below or take a look at the [full Console.WriteLine($"Accounts couldn't be retrieved: {accountsResponse.Error.Summary}"); ``` -7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just acquired: +7. Now you can retrieve details about your bank account and the balances/transactions using the account ID(s) we just + acquired: ```cs var accountId = "your-account-id"; @@ -110,4 +117,6 @@ You can get started with the Quickstart Guide below or take a look at the [full }); ``` -That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you wanna learn more about this library please refer to the [full documentation](https://robintty.github.io/NordigenApiClient/). +That's it! You are now able to retrieve the account details, balances and transactions of your bank account. If you +wanna learn more about this library please refer to +the [full documentation](https://robintty.github.io/NordigenApiClient/). diff --git a/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs b/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs index 7fb9570..f5f959f 100644 --- a/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs +++ b/src/RobinTTY.NordigenApiClient.ExampleApplication/Program.cs @@ -72,4 +72,4 @@ Console.WriteLine($"Remittance: {transaction.RemittanceInformationUnstructured}"); Console.WriteLine($"Booking date:{transaction.ValueDate}"); Console.WriteLine($"Amount: {transactionAmount.Amount} {transactionAmount.Currency}"); - }); + }); \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs b/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs index c778001..9eafc69 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/AuthenticationTests.cs @@ -75,4 +75,4 @@ public void CheckForTokenExpiry() Assert.That(token.IsExpired(diffInvalid), Is.True); }); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs b/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs index 885a63f..00669e1 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/EnumDescriptionConverterTests.cs @@ -66,4 +66,4 @@ public void DeserializeEnum(string descriptor, T expectedDeserializedValue) var enumValue = JsonSerializer.Deserialize($"\"{descriptor}\""); Assert.That(enumValue, Is.EqualTo(expectedDeserializedValue)); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs index 92a98f1..7085e5a 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/CredentialTests.cs @@ -17,7 +17,8 @@ public void Setup() #region RequestsWithSuccessfulResponse /// - /// Tests that is populated after the first authenticated request is made. + /// Tests that is populated after the first authenticated request is + /// made. /// [Test] public async Task CheckValidTokensAfterRequest() @@ -105,4 +106,4 @@ public async Task ExecuteRequestWithUnauthorizedIp() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs index a2608a4..ec5b3b9 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AccountsEndpointTests.cs @@ -210,7 +210,8 @@ public async Task GetTransactionRangeInFuture() } /// - /// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the endDate is before the startDate. This should throw an exception. + /// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the + /// endDate is before the startDate. This should throw an exception. /// [Test] public void GetTransactionRangeWithIncorrectRange() @@ -237,4 +238,4 @@ await _apiClient.AccountsEndpoint.GetTransactions(_accountId, DateOnly.FromDateT } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs index 015b1b1..bb0d1c4 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/AgreementsEndpointTests.cs @@ -201,7 +201,8 @@ await _apiClient.AgreementsEndpoint.CreateAgreement(null!, uint.MaxValue, uint.M } /// - /// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that particular institution. + /// Tests the creation of an end user agreement with invalid accessValidForDays and maxHistoricalDays for that + /// particular institution. /// [Test] public async Task CreateAgreementWithInvalidArgumentsForInstitution() @@ -237,11 +238,12 @@ await _apiClient.AgreementsEndpoint.CreateAgreement("PKO_BPKOPLPW", Assert.That(response.Error!.AccessScopeError!.Detail, Is.EqualTo("For this institution the following scopes are required together: ['details', 'balances']")); - Assert.That(response.Error!.AccessScopeError.Summary, Is.EqualTo("Institution access scope dependencies error")); + Assert.That(response.Error!.AccessScopeError.Summary, + Is.EqualTo("Institution access scope dependencies error")); Assert.That(new[] {response.Error!.InstitutionIdError, response.Error!.AgreementError}, Has.All.Null); }); } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs index 5a91c64..cfcc3b4 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/InstitutionsEndpointTests.cs @@ -144,4 +144,4 @@ public async Task GetNonExistingInstitution() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs index 75de8d1..c005721 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/RequisitionsEndpointTests.cs @@ -208,4 +208,4 @@ await _apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementI } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs index cf48537..5e62447 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/Endpoints/TokenEndpointTests.cs @@ -48,8 +48,8 @@ public async Task ReuseExpiredToken() } /// - /// Tests whether the event is raised when the token pair is updated - /// automatically by the client itself. + /// Tests whether the event is raised when the token pair is updated + /// automatically by the client itself. /// [Test] public async Task TokenPairUpdateIsRaisedOnInternalUpdate() @@ -68,10 +68,10 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate() Assert.That(eventArgs.JsonWebTokenPair.RefreshToken.EncodedToken, Is.Not.Empty); }); } - + /// - /// Tests whether the event is raised when the token pair is updated - /// by the user. + /// Tests whether the event is raised when the token pair is updated + /// by the user. /// [Test] public void TokenPairUpdateIsRaisedOnManualUpdate() @@ -117,4 +117,4 @@ public async Task GetTokenWithInvalidCredentials() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs index 7895e27..db1fcd3 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/LiveApi/NordigenApiClientTests.cs @@ -71,4 +71,4 @@ private async Task ExecuteExampleRequest(NordigenClient apiClient) } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs index b12c819..a0bfd95 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/CredentialTests.cs @@ -9,7 +9,8 @@ public class CredentialTests #region RequestsWithSuccessfulResponse /// - /// Tests that is populated after the first authenticated request is made. + /// Tests that is populated after the first authenticated request is + /// made. /// [Test] public async Task CheckValidTokensAfterRequest() @@ -29,8 +30,8 @@ public async Task CheckValidTokensAfterRequest() } /// - /// Tests whether the event is raised when the token pair is updated - /// automatically by the client itself. + /// Tests whether the event is raised when the token pair is updated + /// automatically by the client itself. /// [Test] public async Task TokenPairUpdateIsRaisedOnInternalUpdate() @@ -52,8 +53,8 @@ public async Task TokenPairUpdateIsRaisedOnInternalUpdate() } /// - /// Tests whether the event is raised when the token pair is updated - /// by the user. + /// Tests whether the event is raised when the token pair is updated + /// by the user. /// [Test] public void TokenPairUpdateIsRaisedOnManualUpdate() @@ -120,4 +121,4 @@ public async Task ExecuteRequestWithUnauthorizedIp() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs index 116a243..6969572 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AccountsEndpointTests.cs @@ -234,7 +234,8 @@ public async Task GetTransactionRangeInFuture() } /// - /// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the endDate is before the startDate. This should throw an exception. + /// Tests the retrieval of transactions within a specific time frame where the date range is incorrect, since the + /// endDate is before the startDate. This should throw an exception. /// [Test] public void GetTransactionRangeWithIncorrectRange() @@ -262,4 +263,4 @@ await apiClient.AccountsEndpoint.GetTransactions(A.Dummy(), DateOnly.FromD } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs index 38bdad7..84a0a88 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/AgreementsEndpointTests.cs @@ -268,4 +268,4 @@ public async Task CreateAgreementWithInvalidParamsAtPolishInstitution() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs index 023d426..905813c 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/InstitutionsEndpointTests.cs @@ -126,4 +126,4 @@ public async Task GetNonExistingInstitution() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs index 0c040df..dbc00a6 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/RequisitionsEndpointTests.cs @@ -235,4 +235,4 @@ await apiClient.RequisitionsEndpoint.CreateRequisition("", redirect, agreementId } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs index 025b788..bbb7521 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Endpoints/TokenEndpointTests.cs @@ -66,4 +66,4 @@ public async Task RefreshAccessToken() } #endregion -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs index b184a01..e898e68 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/FakeHttpMessageHandler.cs @@ -7,6 +7,6 @@ public abstract Task FakeSendAsync( // sealed so FakeItEasy won't intercept calls to this method protected sealed override Task SendAsync( - HttpRequestMessage request, CancellationToken cancellationToken) - => FakeSendAsync(request, cancellationToken); -} + HttpRequestMessage request, CancellationToken cancellationToken) => + FakeSendAsync(request, cancellationToken); +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs index 3ea34b5..245de2d 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Mocks/Responses/MockResponsesModel.cs @@ -122,4 +122,4 @@ internal class CredentialMockData(BasicResponse noAccountForGivenCredentialsErro { public BasicResponse NoAccountForGivenCredentialsError { get; set; } = noAccountForGivenCredentialsError; public BasicResponse IpNotWhitelistedError { get; set; } = ipNotWhitelistedError; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj b/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj index 08a954f..3c7eb42 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj +++ b/src/RobinTTY.NordigenApiClient.Tests/RobinTTY.NordigenApiClient.Tests.csproj @@ -11,10 +11,10 @@ - - - - + + + + @@ -40,7 +40,7 @@ Always - PreserveNewest + PreserveNewest diff --git a/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs index a76c792..ebde002 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Serialization/CreateAgreementErrorTests.cs @@ -32,4 +32,4 @@ public void DeserializeTransactionWithSingleCurrencyExchange() "For this institution the following scopes are required together: ['details', 'balances']; Some Other Error Detail")); }); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs b/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs index 252df09..818adfa 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Serialization/TransactionTests.cs @@ -90,4 +90,4 @@ public async Task DeserializeWithException() "The following JSON content caused the problem: { \"transactionId\": \"AB123456789\", \"entryReference\": \"123456789\", \"bookingDate\": \"2023-03-20\", \"bookingDateTime\":")); } } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs b/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs index 3d5a5b1..8bf4952 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Shared/AssertionHelpers.cs @@ -51,4 +51,4 @@ internal static void AssertBasicResponseMatchesExpectations(BasicResponse? respo Assert.That(response?.Detail, Is.EqualTo(detail)); }); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs index e83b96f..5d58e7e 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestHelpers.cs @@ -12,6 +12,7 @@ namespace RobinTTY.NordigenApiClient.Tests.Shared; internal static class TestHelpers { private static readonly JsonSerializerOptions JsonSerializerOptions; + public static TestSecrets Secrets { get; } public static MockResponsesModel MockData { get; } @@ -41,8 +42,9 @@ internal static NordigenClient GetConfiguredClient(string? baseAddress = null) } internal static NordigenClient GetMockClient(object? value, HttpStatusCode statusCode, - bool addDefaultAuthToken = true) => GetMockClient([new ValueTuple(value, statusCode)], - addDefaultAuthToken); + bool addDefaultAuthToken = true) => + GetMockClient([new ValueTuple(value, statusCode)], + addDefaultAuthToken); private static NordigenClient GetMockClient(List<(object? Value, HttpStatusCode StatusCode)> responses, bool addDefaultAuthToken = true) @@ -79,10 +81,10 @@ private static NordigenClient GetMockClient(List<(object? Value, HttpStatusCode var credentials = new NordigenClientCredentials(Secrets.ValidSecretId, Secrets.ValidSecretKey); return new NordigenClient(mockHttpClient, credentials); } - + private static TestSecrets? GetSecrets() => new ConfigurationBuilder() .AddJsonFile("appsettings.test.json") .AddUserSecrets() .Build().Get(); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestSecrets.cs b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestSecrets.cs index 4675a55..a2484b5 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Shared/TestSecrets.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Shared/TestSecrets.cs @@ -18,4 +18,4 @@ public class TestSecrets( public string ValidSecretIdWithWhitelist { get; init; } = validSecretIdWithWhitelist; public string ValidSecretKeyWithWhitelist { get; init; } = validSecretKeyWithWhitelist; public string UnauthorizedJwtToken { get; init; } = unauthorizedJwtToken; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/Usings.cs b/src/RobinTTY.NordigenApiClient.Tests/Usings.cs index 6c7f844..d49d29e 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/Usings.cs +++ b/src/RobinTTY.NordigenApiClient.Tests/Usings.cs @@ -1,3 +1,3 @@ global using System.Net; global using System.Net.Http; -global using NUnit.Framework; +global using NUnit.Framework; \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient.Tests/appsettings.test.json b/src/RobinTTY.NordigenApiClient.Tests/appsettings.test.json index 1e0aaeb..13baabe 100644 --- a/src/RobinTTY.NordigenApiClient.Tests/appsettings.test.json +++ b/src/RobinTTY.NordigenApiClient.Tests/appsettings.test.json @@ -1,10 +1,10 @@ { - "ValidSecretId": "", - "ValidSecretKey": "", - "ExpiredJwtAccessToken": "", - "ValidJwtRefreshToken": "", - "ValidAccountId": "", - "ValidSecretIdWithWhitelist": "", - "ValidSecretKeyWithWhitelist": "", - "UnauthorizedJwtToken": "" + "ValidSecretId": "", + "ValidSecretKey": "", + "ExpiredJwtAccessToken": "", + "ValidJwtRefreshToken": "", + "ValidAccountId": "", + "ValidSecretIdWithWhitelist": "", + "ValidSecretKeyWithWhitelist": "", + "UnauthorizedJwtToken": "" } \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Contracts/IAccountsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Contracts/IAccountsEndpoint.cs index dc1f507..1c5618c 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/IAccountsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/IAccountsEndpoint.cs @@ -34,7 +34,10 @@ Task> GetAccount(string id, /// /// The id of the account for which to get the balances. /// Optional token to signal cancellation of the operation. - /// A which contains a of the balances for the specified account. + /// + /// A which contains a of the + /// balances for the specified account. + /// Task, AccountsError>> GetBalances(Guid accountId, CancellationToken cancellationToken = default); @@ -43,7 +46,10 @@ Task, AccountsError>> GetBalances(Guid account /// /// The id of the account for which to get the balances. /// Optional token to signal cancellation of the operation. - /// A which contains a of the balances for the specified account. + /// + /// A which contains a of the + /// balances for the specified account. + /// Task, AccountsError>> GetBalances(string accountId, CancellationToken cancellationToken = default); @@ -108,4 +114,4 @@ Task> GetTransactions(st Task> GetTransactions(string id, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default); #endif -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Contracts/IAgreementsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Contracts/IAgreementsEndpoint.cs index f257222..4556064 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/IAgreementsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/IAgreementsEndpoint.cs @@ -48,8 +48,10 @@ Task> GetAgreement(string id, /// The institution this agreement will refer to. /// The length the access to the account will be valid for to request. /// The length of the transaction history in days to request. - /// The scope of information that will be available for access to request. By default all access scopes - /// (balances, transactions and details) will be requested. + /// + /// The scope of information that will be available for access to request. By default all access scopes + /// (balances, transactions and details) will be requested. + /// /// Optional token to signal cancellation of the operation. /// A containing the created . Task> CreateAgreement(string institutionId, @@ -95,4 +97,4 @@ Task> AcceptAgreement(Guid id, str /// A which contains the accepted end user agreement. Task> AcceptAgreement(string id, string userAgent, string ipAddress, CancellationToken cancellationToken = default); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Contracts/IInstitutionsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Contracts/IInstitutionsEndpoint.cs index 176285b..41a3e14 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/IInstitutionsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/IInstitutionsEndpoint.cs @@ -128,8 +128,10 @@ Task, BasicResponse>> GetInstitutions(Supp /// /// Gets a specific institution by id. /// - /// The id of the institution to retrieve (can be retrieved via - /// ). + /// + /// The id of the institution to retrieve (can be retrieved via + /// ). + /// /// >Optional token to signal cancellation of the operation. /// /// A containing the institution matching the id if the diff --git a/src/RobinTTY.NordigenApiClient/Contracts/INordigenClient.cs b/src/RobinTTY.NordigenApiClient/Contracts/INordigenClient.cs index 16cb4b3..880a37b 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/INordigenClient.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/INordigenClient.cs @@ -58,4 +58,4 @@ public interface INordigenClient /// When the token is manually updated to be null, this event will not be raised. /// event EventHandler? TokenPairUpdated; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Contracts/IRequisitionsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Contracts/IRequisitionsEndpoint.cs index 368259d..222192f 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/IRequisitionsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/IRequisitionsEndpoint.cs @@ -48,15 +48,22 @@ Task> GetRequisition(string id, /// The id of the institution this requisition will be linked to. /// URI where the end user will be redirected after finishing authentication. /// The agreement this requisition will be linked to. - /// A unique ID which can be used for internal referencing. By default, set to a random - /// . - /// Enforces a language for all end user steps hosted by GoCardless. Passed as a two-letter country code + /// + /// A unique ID which can be used for internal referencing. By default, set to a random + /// . + /// + /// + /// Enforces a language for all end user steps hosted by GoCardless. Passed as a two-letter country code /// adhering to ISO 639-1. For a list of all possible languages /// see the /// GoCardless documentation - /// . - /// Some European banks allow sending an end-user's SSN to check whether the SSN is valid. + /// href="https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529165730332-Is-it-possible-to-change-language-for-GoCardless-consent-step"> + /// GoCardless documentation + /// + /// . + /// + /// + /// Some European banks allow sending an end-user's SSN to check whether the SSN is valid. /// For bank availability see the /// /// GoCardless @@ -64,22 +71,29 @@ Task> GetRequisition(string id, /// /// . /// - /// Enables the end user to select which accounts they want to share (like joint accounts, accounts of children, etc.) + /// + /// Enables the end user to select which accounts they want to share (like joint accounts, accounts of children, etc.) /// if set to true. For details see the /// /// GoCardless /// Documentation /// - /// . - /// Enables you to redirect end users back to your app immediately after they have given their consent to access the account - /// information data from the bank, instead of waiting for transaction data being processed. Accounts endpoint status will be - /// PROCESSING and you have to wait until account status is READY before you're able to query the transactions. For details see the + /// . + /// + /// + /// Enables you to redirect end users back to your app immediately after they have given their consent to access the + /// account + /// information data from the bank, instead of waiting for transaction data being processed. Accounts endpoint status + /// will be + /// PROCESSING and you have to wait until account status is READY before you're able to query the transactions. For + /// details see the /// /// GoCardless /// Documentation /// - /// . + /// . + /// /// Optional token to signal cancellation of the operation. /// A which contains the created requisition. Task> CreateRequisition(string institutionId, @@ -104,4 +118,4 @@ Task> DeleteRequisition(Guid i /// A containing a confirmation of the deletion. Task> DeleteRequisition(string id, CancellationToken cancellationToken = default); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Contracts/ITokenEndpoint.cs b/src/RobinTTY.NordigenApiClient/Contracts/ITokenEndpoint.cs index 8c517a7..f9d883b 100644 --- a/src/RobinTTY.NordigenApiClient/Contracts/ITokenEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Contracts/ITokenEndpoint.cs @@ -27,8 +27,10 @@ Task> GetTokenPair( /// /// Refreshes the JWT access token. /// - /// The refresh token previously obtained through the - /// method. + /// + /// The refresh token previously obtained through the + /// method. + /// /// Optional token to signal cancellation of the operation. /// /// A containing the refreshed @@ -36,4 +38,4 @@ Task> GetTokenPair( /// Task> RefreshAccessToken(JsonWebToken refreshToken, CancellationToken cancellationToken = default); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/AccountsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/AccountsEndpoint.cs index 82e6ec0..089435c 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/AccountsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/AccountsEndpoint.cs @@ -46,7 +46,7 @@ private async Task, AccountsError>> GetBalance { var response = await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.AccountsEndpoint}{accountId}/balances/", HttpMethod.Get, cancellationToken); - + return new NordigenApiResponse, AccountsError>(response.StatusCode, response.IsSuccess, response.Result?.Balances, response.Error, response.RateLimits); } @@ -66,7 +66,7 @@ private async Task> GetAc { var response = await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.AccountsEndpoint}{id}/details/", HttpMethod.Get, cancellationToken); - + return new NordigenApiResponse(response.StatusCode, response.IsSuccess, response.Result?.Account, response.Error, response.RateLimits); } @@ -113,7 +113,7 @@ private async Task> GetT var response = await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.AccountsEndpoint}{id}/transactions/", HttpMethod.Get, cancellationToken, query); - + return new NordigenApiResponse(response.StatusCode, response.IsSuccess, response.Result?.Transactions, response.Error, response.RateLimits); } @@ -123,4 +123,4 @@ private async Task> GetT #else private string DateToIso8601(DateTime date) => date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); #endif -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs index d225e88..999fb48 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/AgreementsEndpoint.cs @@ -91,4 +91,4 @@ private async Task> AcceptAgreemen return await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.AgreementsEndpoint}{id}/accept/", HttpMethod.Put, cancellationToken, body: body); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/InstitutionsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/InstitutionsEndpoint.cs index 9d624d0..6115c5e 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/InstitutionsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/InstitutionsEndpoint.cs @@ -83,6 +83,6 @@ public async Task> GetInstitutio await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.InstitutionsEndpoint}{id}/", HttpMethod.Get, cancellationToken); - private static KeyValuePair GetSupportFlagQuery(string flag, bool value) - => new(flag, value.ToString().ToLower()); + private static KeyValuePair GetSupportFlagQuery(string flag, bool value) => + new(flag, value.ToString().ToLower()); } \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/NordigenEndpointUrls.cs b/src/RobinTTY.NordigenApiClient/Endpoints/NordigenEndpointUrls.cs index 19ed865..d147ac2 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/NordigenEndpointUrls.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/NordigenEndpointUrls.cs @@ -8,4 +8,4 @@ internal static class NordigenEndpointUrls internal const string AgreementsEndpoint = "agreements/enduser/"; internal const string InstitutionsEndpoint = "institutions/"; internal const string RequisitionsEndpoint = "requisitions/"; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs index 74c2309..b2a06ae 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/RequisitionsEndpoint.cs @@ -74,4 +74,4 @@ private async Task> DeleteRequ CancellationToken cancellationToken) => await _nordigenClient.MakeRequest( $"{NordigenEndpointUrls.RequisitionsEndpoint}{id}/", HttpMethod.Delete, cancellationToken); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Endpoints/TokenEndpoint.cs b/src/RobinTTY.NordigenApiClient/Endpoints/TokenEndpoint.cs index be6ce59..c56920a 100644 --- a/src/RobinTTY.NordigenApiClient/Endpoints/TokenEndpoint.cs +++ b/src/RobinTTY.NordigenApiClient/Endpoints/TokenEndpoint.cs @@ -37,4 +37,4 @@ public async Task> Refres $"{NordigenEndpointUrls.TokensEndpoint}refresh/", HttpMethod.Post, cancellationToken, body: requestBody, useAuthentication: false); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Events/TokenPairUpdatedEventArgs.cs b/src/RobinTTY.NordigenApiClient/Events/TokenPairUpdatedEventArgs.cs index 3e019f0..e900d6d 100644 --- a/src/RobinTTY.NordigenApiClient/Events/TokenPairUpdatedEventArgs.cs +++ b/src/RobinTTY.NordigenApiClient/Events/TokenPairUpdatedEventArgs.cs @@ -17,4 +17,4 @@ public class TokenPairUpdatedEventArgs : EventArgs /// /// The updated . public TokenPairUpdatedEventArgs(JsonWebTokenPair jsonWebTokenPair) => JsonWebTokenPair = jsonWebTokenPair; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/CultureSpecificDecimalConverter.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/CultureSpecificDecimalConverter.cs index c45b761..c4963d3 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/CultureSpecificDecimalConverter.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/CultureSpecificDecimalConverter.cs @@ -18,4 +18,4 @@ public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerO { writer.WriteStringValue(value.ToString(Culture)); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/EnumDescriptionConverter.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/EnumDescriptionConverter.cs index 06ad9d5..ca15418 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/EnumDescriptionConverter.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/EnumDescriptionConverter.cs @@ -16,4 +16,4 @@ public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions { writer.WriteStringValue(value.GetDescription()); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/GuidConverter.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/GuidConverter.cs index d735e8e..a3f43c5 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/GuidConverter.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/GuidConverter.cs @@ -15,4 +15,4 @@ public override void Write(Utf8JsonWriter writer, Guid value, JsonSerializerOpti { writer.WriteStringValue(value.ToString()); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/JsonWebTokenConverter.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/JsonWebTokenConverter.cs index a6e54b6..7f8b325 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/JsonWebTokenConverter.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/JsonWebTokenConverter.cs @@ -15,4 +15,4 @@ public override void Write(Utf8JsonWriter writer, JsonWebToken value, JsonSerial { writer.WriteStringValue(value.EncodedToken); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/SingleOrArrayConverter.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/SingleOrArrayConverter.cs index bfd23da..063a982 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/SingleOrArrayConverter.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/SingleOrArrayConverter.cs @@ -42,4 +42,4 @@ public override void Write(Utf8JsonWriter writer, TCollection value, JsonSeriali writer.WriteEndArray(); } } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/JsonConverters/StringArrayConverters.cs b/src/RobinTTY.NordigenApiClient/JsonConverters/StringArrayConverters.cs index 20e1b2b..9650efa 100644 --- a/src/RobinTTY.NordigenApiClient/JsonConverters/StringArrayConverters.cs +++ b/src/RobinTTY.NordigenApiClient/JsonConverters/StringArrayConverters.cs @@ -6,7 +6,8 @@ namespace RobinTTY.NordigenApiClient.JsonConverters; /// -/// For some errors the GoCardless API returns arrays for Summary/Detail properties inside the +/// For some errors the GoCardless API returns arrays for Summary/Detail properties inside the +/// /// . /// I've never actually seen them contain multiple values, but this converter merges them into one string so that the /// can stay as simple as possible. @@ -34,14 +35,18 @@ internal class StringArrayMergeConverter : JsonConverter } } - public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) => + public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) + { JsonSerializer.Serialize(writer, value, options); + } } /// /// For some errors (so far only seen when creating requisitions) the GoCardless API returns a simple array of strings -/// as response to a field in the having an invalid value. To bring them in line -/// with errors from other fields in the response this converter converts them to the type. +/// as response to a field in the having an invalid value. To bring them in +/// line +/// with errors from other fields in the response this converter converts them to the +/// type. /// internal class StringArrayToBasicResponseConverter : JsonConverter { @@ -66,6 +71,8 @@ internal class StringArrayToBasicResponseConverter : JsonConverter + public override void Write(Utf8JsonWriter writer, BasicResponse value, JsonSerializerOptions options) + { JsonSerializer.Serialize(writer, value, options); -} + } +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Errors/AccountsError.cs b/src/RobinTTY.NordigenApiClient/Models/Errors/AccountsError.cs index d34520f..e45e637 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Errors/AccountsError.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Errors/AccountsError.cs @@ -54,7 +54,9 @@ public class AccountsError : BasicResponse /// /// Creates a new instance of . /// - public AccountsError() { } + public AccountsError() + { + } #if NET6_0_OR_GREATER /// @@ -103,4 +105,4 @@ public AccountsError(string? summary, string? detail, string? type, BasicRespons StartDateError = startDateError; EndDateError = endDateError; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Errors/CreateAgreementError.cs b/src/RobinTTY.NordigenApiClient/Models/Errors/CreateAgreementError.cs index 96a291a..e270c8e 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Errors/CreateAgreementError.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Errors/CreateAgreementError.cs @@ -48,7 +48,9 @@ public class CreateAgreementError : BasicResponse /// /// Creates a new instance of . /// - public CreateAgreementError() { } + public CreateAgreementError() + { + } /// /// Creates a new instance of . @@ -87,4 +89,4 @@ public CreateAgreementError( AccessValidForDaysError = accessValidForDaysError; AgreementError = agreementError; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Errors/CreateRequisitionError.cs b/src/RobinTTY.NordigenApiClient/Models/Errors/CreateRequisitionError.cs index 07276ae..9430e7a 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Errors/CreateRequisitionError.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Errors/CreateRequisitionError.cs @@ -68,7 +68,9 @@ public class CreateRequisitionError : BasicResponse /// /// Creates a new instance of . /// - public CreateRequisitionError() { } + public CreateRequisitionError() + { + } /// /// Creates a new instance of . @@ -110,4 +112,4 @@ public CreateRequisitionError(string? summary, string? detail, BasicResponse? re AccountSelectionError = accountSelectionError; InstitutionIdError = institutionIdError; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Errors/InstitutionsErrorInternal.cs b/src/RobinTTY.NordigenApiClient/Models/Errors/InstitutionsErrorInternal.cs index fd64f05..2df7b7e 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Errors/InstitutionsErrorInternal.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Errors/InstitutionsErrorInternal.cs @@ -16,7 +16,9 @@ internal class InstitutionsErrorInternal : BasicResponse /// /// Creates a new instance of . /// - public InstitutionsErrorInternal() { } + public InstitutionsErrorInternal() + { + } /// /// Creates a new instance of . @@ -31,4 +33,4 @@ public InstitutionsErrorInternal(string? summary, string? detail, BasicResponse? Summary = country?.Summary ?? summary; Detail = country?.Detail ?? detail; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebAccessToken.cs b/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebAccessToken.cs index 48c709c..90faef9 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebAccessToken.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebAccessToken.cs @@ -31,4 +31,4 @@ public JsonWebAccessToken(JsonWebToken accessToken, int accessExpires) AccessToken = accessToken; AccessExpires = accessExpires; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebTokenPair.cs b/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebTokenPair.cs index c6c9d99..2e8efaa 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebTokenPair.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Jwt/JsonWebTokenPair.cs @@ -61,4 +61,4 @@ public JsonWebTokenPair(string accessToken, string refreshToken) AccessExpires = (int) (AccessToken.ValidTo.ToUniversalTime() - DateTime.UtcNow).TotalSeconds; RefreshExpires = (int) (RefreshToken.ValidTo.ToUniversalTime() - DateTime.UtcNow).TotalSeconds; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/NordigenClientCredentials.cs b/src/RobinTTY.NordigenApiClient/Models/NordigenClientCredentials.cs index 7850497..4db61d1 100644 --- a/src/RobinTTY.NordigenApiClient/Models/NordigenClientCredentials.cs +++ b/src/RobinTTY.NordigenApiClient/Models/NordigenClientCredentials.cs @@ -29,4 +29,4 @@ public NordigenClientCredentials(string secretId, string secretKey) SecretId = secretId ?? throw new ArgumentNullException(nameof(secretId)); SecretKey = secretKey ?? throw new ArgumentNullException(nameof(secretKey)); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/AcceptAgreementRequest.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/AcceptAgreementRequest.cs index 9d62c2f..0f47784 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/AcceptAgreementRequest.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/AcceptAgreementRequest.cs @@ -29,4 +29,4 @@ public AcceptAgreementRequest(string userAgent, string ipAddress) UserAgent = userAgent; IpAddress = ipAddress; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs index c56a39d..3557a25 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateAgreementRequest.cs @@ -49,4 +49,4 @@ public CreateAgreementRequest(string institutionId, List accessScop AccessScope = accessScope; InstitutionId = institutionId; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateRequisitionRequest.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateRequisitionRequest.cs index 0ec710b..da3d75c 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/CreateRequisitionRequest.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/CreateRequisitionRequest.cs @@ -36,7 +36,9 @@ internal class CreateRequisitionRequest /// (ISO 639-1). For a list of all possible languages /// see the /// GoCardless documentation + /// href="https://bankaccountdata.zendesk.com/hc/en-gb/articles/11529165730332-Is-it-possible-to-change-language-for-GoCardless-consent-step"> + /// GoCardless documentation + /// /// . /// [JsonPropertyName("user_language")] @@ -68,9 +70,12 @@ internal class CreateRequisitionRequest public bool AccountSelection { get; set; } /// - /// Enables you to redirect end users back to your app immediately after they have given their consent to access the account - /// information data from the bank, instead of waiting for transaction data being processed. Accounts endpoint status will be - /// PROCESSING and you have to wait until account status is READY before you're able to query the transactions. For details see the + /// Enables you to redirect end users back to your app immediately after they have given their consent to access the + /// account + /// information data from the bank, instead of waiting for transaction data being processed. Accounts endpoint status + /// will be + /// PROCESSING and you have to wait until account status is READY before you're able to query the transactions. For + /// details see the /// /// GoCardless @@ -96,7 +101,8 @@ internal class CreateRequisitionRequest /// Some European banks allow sending an end-user's SSN to check whether the SSN is valid. /// /// For bank availability check: - /// + /// /// GoCardless /// Documentation /// @@ -144,4 +150,4 @@ public CreateRequisitionRequest(string institutionId, Uri redirect, string refer AccountSelection = accountSelection; RedirectImmediate = redirectImmediate; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs b/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs index 75d53af..ac13a47 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Requests/SupportedCountry.cs @@ -195,4 +195,4 @@ public enum SupportedCountry /// [Description("SI")] Slovenia -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs index 78bb9f8..c2f009c 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AccessScope.cs @@ -33,4 +33,4 @@ public enum AccessScope /// [Description("details")] Details -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs index 3df744f..bcb0ab2 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountDetails.cs @@ -48,10 +48,18 @@ public class AccountDetails /// Creates a new instance of . /// /// The IBAN of the bank account. - /// Basic Bank Account Number represents a country-specific bank account number. - /// This data element is used for payment accounts which have no IBAN. - /// Primary account number (unique identifier on credit cards, debit cards, and other types of payment cards). - /// Masked primary account number (unique identifier on credit cards, debit cards, and other types of payment cards). + /// + /// Basic Bank Account Number represents a country-specific bank account number. + /// This data element is used for payment accounts which have no IBAN. + /// + /// + /// Primary account number (unique identifier on credit cards, debit cards, and other types of payment + /// cards). + /// + /// + /// Masked primary account number (unique identifier on credit cards, debit cards, and other types + /// of payment cards). + /// /// An alias to a payment account via a registered mobile phone number. /// The currency the amount is denominated in. [JsonConstructor] @@ -64,4 +72,4 @@ public AccountDetails(string? iban, string? bban, string? pan, string? maskedPan Msisdn = msisdn; Currency = currency; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountTransactions.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountTransactions.cs index 56deaa3..bfdbb88 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AccountTransactions.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AccountTransactions.cs @@ -49,4 +49,4 @@ internal class AccountTransactionsWrapper /// A list of transactions. [JsonConstructor] public AccountTransactionsWrapper(AccountTransactions transactions) => Transactions = transactions; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs index d71e2ae..89a23a0 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Address.cs @@ -54,4 +54,4 @@ public Address(string? streetName, string? buildingNumber, string? postCode, str TownName = townName; Country = country; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs index 55c3b07..1249f42 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Agreement.cs @@ -71,4 +71,4 @@ public Agreement(Guid id, DateTime created, DateTime? accepted, string instituti MaxHistoricalDays = maxHistoricalDays; AccessValidForDays = accessValidForDays; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/AmountCurrencyPair.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/AmountCurrencyPair.cs index cf30676..5458c5e 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/AmountCurrencyPair.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/AmountCurrencyPair.cs @@ -30,4 +30,4 @@ public AmountCurrencyPair(decimal amount, string currency) Amount = amount; Currency = currency; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/ApiRateLimits.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/ApiRateLimits.cs index f234d77..29004e1 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/ApiRateLimits.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/ApiRateLimits.cs @@ -13,45 +13,57 @@ public class ApiRateLimits /// Usually populated in every response. /// public int? RequestLimit { get; set; } + /// /// Indicates the number of remaining requests you can make in the current time window. /// Usually populated in every response. /// public int? RemainingRequests { get; set; } + /// /// Indicates the time remaining in the current time window (in seconds). /// Usually populated in every response. /// public int? RemainingSecondsInTimeWindow { get; set; } + /// - /// Indicates the maximum number of allowed requests to the - /// within the defined time window. Only populated in responses from the . + /// Indicates the maximum number of allowed requests to the + /// within the defined time window. Only populated in responses from the . /// public int? RequestLimitAccountsEndpoint { get; set; } + /// - /// Indicates the number of remaining requests to the - /// you can make in the current time window. Only populated in responses from the . + /// Indicates the number of remaining requests to the + /// you can make in the current time window. Only populated in responses from the . /// public int? RemainingRequestsAccountsEndpoint { get; set; } + /// /// Indicates the time remaining in the current time window (in seconds) for requests - /// to the . Only populated in responses from the . + /// to the . Only populated in responses from the . /// public int? RemainingSecondsInTimeWindowAccountsEndpoint { get; set; } - + /// /// Creates a new instance of . /// /// Indicates the maximum number of allowed requests within the defined time window. /// Indicates the number of remaining requests you can make in the current time window. /// Indicates the time remaining in the current time window (in seconds). - /// Indicates the maximum number of allowed requests to the - /// within the defined time window. - /// Indicates the number of remaining requests to the - /// you can make in the current time window. - /// Indicates the time remaining in the current time window (in seconds) for requests - /// to the . - public ApiRateLimits(int? requestLimit, int? remainingRequests, int? remainingSecondsInTimeWindow, int? requestLimitAccountsEndpoint, + /// + /// Indicates the maximum number of allowed requests to the + /// within the defined time window. + /// + /// + /// Indicates the number of remaining requests to the + /// you can make in the current time window. + /// + /// + /// Indicates the time remaining in the current time window (in seconds) for requests + /// to the . + /// + public ApiRateLimits(int? requestLimit, int? remainingRequests, int? remainingSecondsInTimeWindow, + int? requestLimitAccountsEndpoint, int? remainingRequestsAccountsEndpoint, int? remainingSecondsInTimeWindowAccountsEndpoint) { RequestLimit = requestLimit; @@ -61,7 +73,7 @@ public ApiRateLimits(int? requestLimit, int? remainingRequests, int? remainingSe RemainingRequestsAccountsEndpoint = remainingRequestsAccountsEndpoint; RemainingSecondsInTimeWindowAccountsEndpoint = remainingSecondsInTimeWindowAccountsEndpoint; } - + /// /// Creates a new instance of . /// @@ -73,7 +85,8 @@ public ApiRateLimits(HttpHeaders headers) RemainingSecondsInTimeWindow = TryParseApiLimit(headers, "HTTP_X_RATELIMIT_RESET"); RequestLimitAccountsEndpoint = TryParseApiLimit(headers, "HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_LIMIT"); RemainingRequestsAccountsEndpoint = TryParseApiLimit(headers, "HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_REMAINING"); - RemainingSecondsInTimeWindowAccountsEndpoint = TryParseApiLimit(headers, "HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_RESET"); + RemainingSecondsInTimeWindowAccountsEndpoint = + TryParseApiLimit(headers, "HTTP_X_RATELIMIT_ACCOUNT_SUCCESS_RESET"); } private static int? TryParseApiLimit(HttpHeaders headers, string headerName) @@ -81,7 +94,7 @@ public ApiRateLimits(HttpHeaders headers) headers.TryGetValues(headerName, out var values); var firstHeaderValue = values?.FirstOrDefault(); var parseSuccess = int.TryParse(firstHeaderValue, out var limitValue); - + return parseSuccess ? limitValue : null; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Balance.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Balance.cs index 2f8bd85..96108fb 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Balance.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Balance.cs @@ -96,4 +96,4 @@ internal class BalanceJsonWrapper /// /// A list of account balances. public BalanceJsonWrapper(List balances) => Balances = balances; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BalanceType.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BalanceType.cs index 09a2afe..5b5f73e 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BalanceType.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BalanceType.cs @@ -121,4 +121,4 @@ public enum BalanceType /// [Description("previouslyClosedBooked")] PreviouslyClosedBooked -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccount.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccount.cs index 9c76561..556d546 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccount.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccount.cs @@ -55,7 +55,10 @@ public class BankAccount : MinimalBankAccount /// The time this account was last accessed via the API. /// The IBAN of the account. /// The institution id this account belongs to. - /// Name of the legal account owner. If there is more than one owner, then two names might be noted here. + /// + /// Name of the legal account owner. If there is more than one owner, then two names might be noted + /// here. + /// /// The status of the account (e.g. user has successfully authenticated and account is discovered). [JsonConstructor] public BankAccount(Guid id, DateTime created, DateTime? lastAccessed, string iban, string institutionId, @@ -68,4 +71,4 @@ public BankAccount(Guid id, DateTime created, DateTime? lastAccessed, string iba OwnerName = ownerName; Status = status; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountDetails.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountDetails.cs index ee6d9f3..652d4d4 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountDetails.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountDetails.cs @@ -206,4 +206,4 @@ internal class BankAccountDetailsWrapper /// Detailed information about a bank account. [JsonConstructor] public BankAccountDetailsWrapper(BankAccountDetails account) => Account = account; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountStatus.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountStatus.cs index bf91707..f8ceea6 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountStatus.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountStatus.cs @@ -51,8 +51,9 @@ public enum BankAccountStatus Ready, /// - /// Indicates that the account has been suspended due to more than 10 consecutive failed attempts to access the account. + /// Indicates that the account has been suspended due to more than 10 consecutive failed attempts to access the + /// account. /// [Description("SUSPENDED")] Suspended -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountUsage.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountUsage.cs index 571f14c..6544ab6 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountUsage.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BankAccountUsage.cs @@ -30,4 +30,4 @@ public enum BankAccountUsage /// A professional bank account. /// Organization -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/BasicResponse.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/BasicResponse.cs index a4d65f2..916bd8b 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/BasicResponse.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/BasicResponse.cs @@ -25,7 +25,9 @@ public class BasicResponse /// /// Creates a new instance of . /// - public BasicResponse() { } + public BasicResponse() + { + } /// /// Creates a new instance of . @@ -38,4 +40,4 @@ public BasicResponse(string? summary, string? detail) Summary = summary; Detail = detail; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/CashAccountType.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/CashAccountType.cs index 57c4e45..db31ab0 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/CashAccountType.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/CashAccountType.cs @@ -163,4 +163,4 @@ public enum CashAccountType /// [Description("NFCA")] NonResidentForeignCurrent -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/CurrencyExchange.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/CurrencyExchange.cs index 5256a3f..6f7865a 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/CurrencyExchange.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/CurrencyExchange.cs @@ -28,8 +28,8 @@ public class CurrencyExchange public string TargetCurrency { get; } /// - /// Currency in which the rate of exchange is expressed in a currency exchange. In the example 1 EUR = xxx USD, the unit - /// currency is EUR. ISO 4217 Alpha 3 currency code (e.g. "USD"). + /// Currency in which the rate of exchange is expressed in a currency exchange. In the example 1 EUR = xxx USD, the + /// unit currency is EUR. ISO 4217 Alpha 3 currency code (e.g. "USD"). /// [JsonPropertyName("unitCurrency")] public string UnitCurrency { get; } @@ -90,4 +90,4 @@ public CurrencyExchange(AmountCurrencyPair? instructedAmount, string sourceCurre QuotationDate = quotationDate; ContractIdentification = contractIdentification; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Institution.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Institution.cs index 21a6da5..5c7e5a1 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Institution.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Institution.cs @@ -53,7 +53,8 @@ public class Institution public SupportedPayments? SupportedPayments { get; } /// - /// Supported features for this institution. Only populated when calling . + /// Supported features for this institution. Only populated when calling + /// . /// [JsonPropertyName("supported_features")] public List? SupportedFeatures { get; } diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/IsoBankAccountStatus.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/IsoBankAccountStatus.cs index c85ca0f..4545139 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/IsoBankAccountStatus.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/IsoBankAccountStatus.cs @@ -32,4 +32,4 @@ public enum IsoBankAccountStatus /// [Description("blocked")] Blocked -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/MinimalBankAccount.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/MinimalBankAccount.cs index 4fd729b..209556e 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/MinimalBankAccount.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/MinimalBankAccount.cs @@ -18,4 +18,4 @@ public class MinimalBankAccount /// /// The IBAN of the account. public MinimalBankAccount(string iban) => Iban = iban; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/NordigenApiResponse.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/NordigenApiResponse.cs index c4dd9ee..8756439 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/NordigenApiResponse.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/NordigenApiResponse.cs @@ -34,7 +34,7 @@ public class NordigenApiResponse where TResult : class where TE /// The error returned by the API. Null if the HTTP response was successful. /// public TError? Error { get; } - + /// /// The rate limits of the GoCardless API. /// @@ -95,4 +95,4 @@ internal static async Task> FromHttpRespons $"The following JSON content caused the problem: {responseJson}", ex); } } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/PaymentProduct.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/PaymentProduct.cs index a915556..8db2501 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/PaymentProduct.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/PaymentProduct.cs @@ -22,13 +22,15 @@ public enum PaymentProduct Target2Payments, /// - /// SEPA Credit Transfer, more commonly abbreviated as SCT, is a payment processing scheme used for making one-time, euro-denominated fund transfers between banks and payment service providers (PSPs) in the SEPA area. + /// SEPA Credit Transfer, more commonly abbreviated as SCT, is a payment processing scheme used for making one-time, + /// euro-denominated fund transfers between banks and payment service providers (PSPs) in the SEPA area. /// [Description("SCT")] SepaCreditTransfers, /// - /// Instant SEPA Credit Transfer supports money transfers of up to €100,000 between participating banks or PSPs in the SEPA area in real or near-real time. + /// Instant SEPA Credit Transfer supports money transfers of up to €100,000 between participating banks or PSPs in the + /// SEPA area in real or near-real time. /// [Description("ISCT")] InstantSepaCreditTransfer, @@ -40,19 +42,24 @@ public enum PaymentProduct CrossBorderCreditTransfers, /// - /// Bacs Payment Schemes Limited (Bacs), previously known as Bankers' Automated Clearing System, is responsible for the clearing and settlement of UK automated direct debit and Bacs Direct Credit and the provision of third-party services. + /// Bacs Payment Schemes Limited (Bacs), previously known as Bankers' Automated Clearing System, is responsible for the + /// clearing and settlement of UK automated direct debit and Bacs Direct Credit and the provision of third-party + /// services. /// [Description("BACS")] BacsPaymentSchemesLimited, /// - /// The Clearing House Automated Payment System (CHAPS) is a real-time gross settlement payment system used for sterling transactions in the United Kingdom. + /// The Clearing House Automated Payment System (CHAPS) is a real-time gross settlement payment system used for + /// sterling transactions in the United Kingdom. /// [Description("CHAPS")] ClearingHouseAutomatedPaymentSystem, /// - /// The Faster Payments Service (FPS) is a United Kingdom banking initiative to reduce payment times between different banks' customer accounts to typically a few seconds, from the three working days that transfers usually take using the long-established BACS system. + /// The Faster Payments Service (FPS) is a United Kingdom banking initiative to reduce payment times between different + /// banks' customer accounts to typically a few seconds, from the three working days that transfers usually take using + /// the long-established BACS system. /// [Description("FPS")] FasterPaymentScheme, @@ -64,7 +71,8 @@ public enum PaymentProduct SwiftPaymentService, /// - /// A balance transfer is the transfer of the balance in an account to another account, often held at another institution. It is most commonly used when describing a credit card balance transfer. + /// A balance transfer is the transfer of the balance in an account to another account, often held at another + /// institution. It is most commonly used when describing a credit card balance transfer. /// [Description("BT")] BalanceTransfer, @@ -82,8 +90,9 @@ public enum PaymentProduct DomesticCreditTransfer, /// - /// An instant domestic transfer is a transfer completed between accounts that are held in the same country in real-time. + /// An instant domestic transfer is a transfer completed between accounts that are held in the same country in + /// real-time. /// [Description("IDCT")] InstantDomesticCreditTransfer -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Requisition.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Requisition.cs index 121595f..ba3a4fb 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Requisition.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Requisition.cs @@ -72,7 +72,8 @@ public class Requisition /// Some European banks allow sending an end-user's SSN to check whether the SSN is valid. /// /// For bank availability check: - /// + /// /// GoCardless /// Documentation /// @@ -136,7 +137,8 @@ public class Requisition /// Some European banks allow sending an end-user's SSN to check whether the SSN is valid. /// /// For bank availability check: - /// + /// /// GoCardless /// Documentation /// @@ -187,4 +189,4 @@ public Requisition(Guid id, DateTime created, RequisitionStatus status, List [Description("EX")] Expired -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/ResponsePage.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/ResponsePage.cs index 5aa345a..48f6d51 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/ResponsePage.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/ResponsePage.cs @@ -81,4 +81,4 @@ public ResponsePage(uint count, Uri? next, Uri? previous, List results) return await nordigenClient.MakeRequest, BasicResponse>(Previous.AbsoluteUri, HttpMethod.Get, cancellationToken); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/SupportedPayments.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/SupportedPayments.cs index ed3b740..3bc9768 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/SupportedPayments.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/SupportedPayments.cs @@ -18,4 +18,4 @@ public class SupportedPayments /// /// Supported payment products in the single-payment category. public SupportedPayments(List singlePayment) => SinglePayment = singlePayment; -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Models/Responses/Transaction.cs b/src/RobinTTY.NordigenApiClient/Models/Responses/Transaction.cs index f25ca0a..3973362 100644 --- a/src/RobinTTY.NordigenApiClient/Models/Responses/Transaction.cs +++ b/src/RobinTTY.NordigenApiClient/Models/Responses/Transaction.cs @@ -6,7 +6,8 @@ namespace RobinTTY.NordigenApiClient.Models.Responses; /// /// A financial transaction. /// -/// Reference: GoCardless Documentation +/// Reference: +/// GoCardless Documentation /// /// public class Transaction @@ -381,4 +382,4 @@ public Transaction(string? transactionId, string? debtorName, AccountDetails? de MerchantCategoryCode = merchantCategoryCode; BookingDateTime = bookingDateTime; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/NordigenClient.cs b/src/RobinTTY.NordigenApiClient/NordigenClient.cs index 305492b..53db10b 100644 --- a/src/RobinTTY.NordigenApiClient/NordigenClient.cs +++ b/src/RobinTTY.NordigenApiClient/NordigenClient.cs @@ -14,11 +14,11 @@ namespace RobinTTY.NordigenApiClient; /// public class NordigenClient : INordigenClient { - private JsonWebTokenPair? _jsonWebTokenPair; private static readonly SemaphoreSlim TokenSemaphore = new(1, 1); private readonly HttpClient _httpClient; private readonly JsonSerializerOptions _serializerOptions; internal readonly NordigenClientCredentials Credentials; + private JsonWebTokenPair? _jsonWebTokenPair; /// /// Creates a new instance of . @@ -168,9 +168,7 @@ private async Task> TryGetV { // Request a new token if it is null or if the refresh token has expired if (JsonWebTokenPair == null || JsonWebTokenPair.RefreshToken.IsExpired(TimeSpan.FromMinutes(1))) - { return await TokenEndpoint.GetTokenPair(cancellationToken); - } // Refresh the current access token if it's expired (or valid for less than a minute) if (JsonWebTokenPair.AccessToken.IsExpired(TimeSpan.FromMinutes(1))) @@ -190,4 +188,4 @@ private async Task> TryGetV return new NordigenApiResponse(HttpStatusCode.OK, true, JsonWebTokenPair, null, new ApiRateLimits(-1, -1, -1, -1, 0, -1)); } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Utility/EnumDescriptorExtension.cs b/src/RobinTTY.NordigenApiClient/Utility/EnumDescriptorExtension.cs index 405f2bb..f19047b 100644 --- a/src/RobinTTY.NordigenApiClient/Utility/EnumDescriptorExtension.cs +++ b/src/RobinTTY.NordigenApiClient/Utility/EnumDescriptorExtension.cs @@ -36,4 +36,4 @@ internal static T StringToEnumValue(string? description) where T : struct return default!; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Utility/HttpClientExtensions.cs b/src/RobinTTY.NordigenApiClient/Utility/HttpClientExtensions.cs index 365cff9..f661ad7 100644 --- a/src/RobinTTY.NordigenApiClient/Utility/HttpClientExtensions.cs +++ b/src/RobinTTY.NordigenApiClient/Utility/HttpClientExtensions.cs @@ -8,7 +8,10 @@ internal static class HttpClientExtensions /// /// Sets the authentication header needed for most of the Nordigen API requests. /// See: - /// GoCardless Documentation + /// + /// GoCardless + /// Documentation + /// /// /// The to apply the authentication header on. /// @@ -22,4 +25,4 @@ internal static HttpClient UseNordigenAuthenticationHeader(this HttpClient clien client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", rawToken); return client; } -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Utility/JsonWebTokenExtensions.cs b/src/RobinTTY.NordigenApiClient/Utility/JsonWebTokenExtensions.cs index 322e759..41ab329 100644 --- a/src/RobinTTY.NordigenApiClient/Utility/JsonWebTokenExtensions.cs +++ b/src/RobinTTY.NordigenApiClient/Utility/JsonWebTokenExtensions.cs @@ -12,4 +12,4 @@ internal static class JsonWebTokenExtensions /// True if token is expired otherwise false. internal static bool IsExpired(this SecurityToken token, TimeSpan timeToExpiry = default) => token.ValidTo.ToUniversalTime() < DateTime.UtcNow.Add(timeToExpiry); -} +} \ No newline at end of file diff --git a/src/RobinTTY.NordigenApiClient/Utility/UriQueryBuilder.cs b/src/RobinTTY.NordigenApiClient/Utility/UriQueryBuilder.cs index c69e50c..5fde202 100644 --- a/src/RobinTTY.NordigenApiClient/Utility/UriQueryBuilder.cs +++ b/src/RobinTTY.NordigenApiClient/Utility/UriQueryBuilder.cs @@ -18,4 +18,4 @@ internal static string GetQueryString(IEnumerable> foreach (var kvp in queryKeyValuePairs) query.Add(kvp.Key, kvp.Value); return query.ToString() is null ? string.Empty : $"?{query}"; } -} +} \ No newline at end of file