{"id":25049122,"url":"https://github.com/tech-gian/enablebanking","last_synced_at":"2025-03-31T03:31:55.436Z","repository":{"id":275974627,"uuid":"927190093","full_name":"tech-gian/EnableBanking","owner":"tech-gian","description":"A simple .NET nuget package to consume EnableBanking's API","archived":false,"fork":false,"pushed_at":"2025-02-05T15:58:12.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T16:22:42.069Z","etag":null,"topics":["api","dotnet","enablebanking","nuget","payments","rest"],"latest_commit_sha":null,"homepage":"https://enablebanking.com/docs/api/reference/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tech-gian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-04T14:56:38.000Z","updated_at":"2025-02-05T15:57:28.000Z","dependencies_parsed_at":"2025-02-05T16:22:44.500Z","dependency_job_id":"151ae1c5-20b1-42a9-966d-907a9174cb52","html_url":"https://github.com/tech-gian/EnableBanking","commit_stats":null,"previous_names":["tech-gian/enablebanking"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-gian%2FEnableBanking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-gian%2FEnableBanking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-gian%2FEnableBanking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tech-gian%2FEnableBanking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tech-gian","download_url":"https://codeload.github.com/tech-gian/EnableBanking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413377,"owners_count":20773053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dotnet","enablebanking","nuget","payments","rest"],"created_at":"2025-02-06T08:16:39.705Z","updated_at":"2025-03-31T03:31:55.416Z","avatar_url":"https://github.com/tech-gian.png","language":"C#","readme":"# .NET Client for the EnableBanking API\n\nFor full details of the EnableBanking API, see the [Docs](https://enablebanking.com/docs/).\n\n[![NuGet](https://img.shields.io/nuget/v/EnableBanking.svg)](https://www.nuget.org/packages/EnableBanking/)\n[![\u003cEnableBanking\u003e](https://github.com/tech-gian/EnableBanking/actions/workflows/publish.yml/badge.svg)](https://github.com/tech-gian/EnableBanking/actions)\n\n- [Quick Start](https://enablebanking.com/docs/api/quick-start/)\n- [API Reference](https://enablebanking.com/docs/api/reference/)\n- [Sandbox Environment](https://enablebanking.com/docs/api/sandbox/)\n- [NuGet Package](https://)\n\n## Installation\n\nTo install `EnableBanking`, run the following command in the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console)\n\n`Install-Package EnableBanking -Version 1.0.2`\n\n\n## Usage\n\n### Add a new Application\n\nFirst of all, a new application needs to be registered to the [EnableBanking portal](https://enablebanking.com/cp/applications/) (follow the instructions there). The private RSA needs to be saved and be accessible from the main .NET project.\n\n### Add Services using Dependency Injection\n\nThe services need to be registered in the `Program.cs` like this:\n\n```cs\nbuilder.Services.AddEnableBankingApi(options =\u003e\n{\n    options.KeyPath = \"your_path_to_key\";\n    options.AppKid = \"your_app_kid\";\n});\n```\n\nAfter that you can inject any of the following `Interfaces` in to your constructors and use their methods.\n\n```cs\nprivate readonly IGeneralService _generalService;\n\npublic TestClass(IGeneralService generalService)\n{\n    _generalService = generalService;\n}\n```\n\n#### Example of a Request\n\nBelow there is an example request. Every method has the same pattern regarding the request and response models. The only thing that varies from method to method is the actual properties.\n\n```cs\nvar request = new GetApplicationRequest();\nvar response = await _generalService.GetApplicationAsync(request, cancellationToken);\n\n// Successful Response\nif (response.Data != null)\n{\n    var applicationName = response.Data.Name;\n}\n// Unsuccessful Response\nelse if (response.Error != null)\n{\n    var errorMessage = response.Error.Message;\n}\n```\n\n### Interfaces\n\nBelow are mentioned all the methods of each Interface, that can be used like in the example above:\n\n*IGeneralService*\n\n```cs\npublic interface IGeneralService\n{\n    Task\u003cApiResponse\u003cStartAuthorizationResponse\u003e\u003e StartAuthorizationAsync(StartAuthorizationRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetASPSPsResponse\u003e\u003e GetASPSPsAsync(GetASPSPsRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetApplicationResponse\u003e\u003e GetApplicationAsync(GetApplicationRequest request, CancellationToken cancellationToken);\n}\n```\n\n*ISessionsService*\n\n```cs\npublic interface ISessionsService\n{\n    Task\u003cApiResponse\u003cGetSessionResponse\u003e\u003e GetSessionAsync(GetSessionRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cDeleteSessionResponse\u003e\u003e DeleteSessionAsync(DeleteSessionRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cAuthorizeSessionResponse\u003e\u003e AuthorizeSessionAsync(AuthorizeSessionRequest request, CancellationToken cancellationToken);\n}\n```\n\n*IAccountsService*\n\n```cs\npublic interface IAccountsService\n{\n    Task\u003cApiResponse\u003cGetTransactionsResponse\u003e\u003e GetTransactionsAsync(GetTransactionsRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetTransactionResponse\u003e\u003e GetTransactionAsync(GetTransactionRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetDetailsResponse\u003e\u003e GetDetailsAsync(GetDetailsRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetBalancesResponse\u003e\u003e GetBalancesAsync(GetBalancesRequest request, CancellationToken cancellationToken);\n}\n```\n\n*IPaymentsService*\n\n```cs\npublic interface IPaymentsService\n{\n    Task\u003cApiResponse\u003cGetPaymentResponse\u003e\u003e GetPaymentAsync(GetPaymentRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cGetPaymentTransactionResponse\u003e\u003e GetPaymentTransactionAsync(GetPaymentTransactionRequest request, CancellationToken cancellationToken);\n\n    Task\u003cApiResponse\u003cCreatePaymentResponse\u003e\u003e CreatePaymentAsync(CreatePaymentRequest request, CancellationToken cancellationToken);\n}\n```\n\n### Unsuccessful Requests\n\nThe ApiResponse class contains only 3 properties:\n- The actual `Data`, in case of a successful request\n- The `Error`, in case of an unsuccessful request\n- The `StatusCode`, in both cases\n\nIn the case of an unsuccessful request, the Error class has the following properties:\n\n```cs\npublic class ApiError\n{\n    [JsonProperty(\"message\")]\n    public string? Message { get; set; }\n\n    [JsonProperty(\"code\")]\n    public string? Code { get; set; }\n\n    [JsonProperty(\"error\")]\n    public string? Error { get; set; }\n\n    [JsonProperty(\"detail\")]\n    public object? Detail { get; set; }\n}\n```\n\n### Errors\n\nThe possible errors, based on the API documentation are:\n\n- `Bad Request`\n- `Unauthorized`\n- `Forbidden`\n- `Not Found`\n- `Request Timeout`\n- `Unprocessable Entity`\n- `Too Many Requests`\n- `Internal Server Error`\n\nThese errors are fully documented in the [API Reference](https://enablebanking.com/docs/api/reference/).\n\n### Support and feedback\n\nIf you find any problem or issue in the code, I'm more than happy to help you with that or fix any possible bug found.\n\nYou are more than welcome to raise any issue in the repository or contact me through my email: `zapantis2@gmail.com`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-gian%2Fenablebanking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftech-gian%2Fenablebanking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftech-gian%2Fenablebanking/lists"}