Generic.Payment.Integrations
1.1.0
dotnet add package Generic.Payment.Integrations --version 1.1.0
NuGet\Install-Package Generic.Payment.Integrations -Version 1.1.0
<PackageReference Include="Generic.Payment.Integrations" Version="1.1.0" />
paket add Generic.Payment.Integrations --version 1.1.0
#r "nuget: Generic.Payment.Integrations, 1.1.0"
// Install Generic.Payment.Integrations as a Cake Addin #addin nuget:?package=Generic.Payment.Integrations&version=1.1.0 // Install Generic.Payment.Integrations as a Cake Tool #tool nuget:?package=Generic.Payment.Integrations&version=1.1.0
.NET Payment and Fintech Integration Library
This library aims to centralize online payment and digital funds transsfer integrations in .NET applications, providing developers with a seamless and standardized way to incorporate payment processing features into their projects. The scope of this project is stricly about unifying integrations that are generic and cut across multiple providers it does not intend to cover all possible apis provided by the individual providers.
Features
- Unified API: Offers a unified API interface for various payment gateways and fintech services.
- Easy Integration: Simplifies the integration process, reducing development time and effort.
- Extensible: Provides a framework for adding new payment gateways and fintech services as needed.
- Best Practices: Implements industry-standard coding best practices.
- Multi-Platform Targeting: The library is built using .NET standard 2.0 as such it can be used by both .NET framework and .NET core applications.
Installation
To use this library in your .NET project, follow these steps:
NuGet Package Manager: Open your project in Visual Studio and go to
Tools > NuGet Package Manager > Manage NuGet Packages for Solution
.Search for Package: In the NuGet Package Manager, search for the package named
Generic.Payment.Integrations
.Install Package: Select the package from the search results and click
Install
to add it to your project.
Alternatively, you can install the package via the NuGet Package Manager Console using the following command:
Install-Package Generic.Payment.Integrations
Usage
Once the package is installed, you can start using the library to integrate payment and fintech services into your application. Here's an example of how to get started:
The following platforms have been integrated thus far
- Paystack (https://paystack.com/docs/api/)
- Remita (https://api.remita.net/)
The following apis have been currently integrated
Provider | Remita | Paystack |
---|---|---|
Online Payment | No | Yes |
Fund Transfer | Yes | Yes |
Bulk Fund Transfer | Yes | Yes |
Account Enquiry | Yes | Yes |
Transaction Enquiry | Yes | Yes |
Bulk Transaction Enquiry | Yes | Yes |
Settlement Transaction | Yes | No |
Settlement Transaction Enquiry | Yes | No |
Banks | Yes | Yes |
using Microsoft.AspNetCore.Mvc;
using Integrations.Interfaces;
using Integrations.Model.Common;
using Integrations.Model.Api.Request;
[ApiController]
[Route("[controller]")]
public class PaymentController : ControllerBase
{
private readonly IPaymentServiceProviderSelector _serviceProviderSelector;
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(IPaymentServiceProviderSelector serviceProviderSelector,
ILogger<WeatherForecastController> logger)
{
_serviceProviderSelector = serviceProviderSelector;
_logger = logger;
}
[HttpGet(Name = "Banks")]
public async Task<IActionResult> GetBanks()
{
var provider = _serviceProviderSelector.GetPaymentService(PaymentProvider.Remita);
var banks = await provider.GetBanks();
return Ok(banks);
}
[HttpPost(Name = "InitiateBulkTransaction")]
public async Task<IActionResult> Initiate(BulkTransactionInitiationRequest bulkTransactionInitiationRequest)
{
var provider = _serviceProviderSelector.GetPaymentService(PaymentProvider.Remita);
var transactionResponse = await provider.InitiateTransaction(bulkTransactionInitiationRequest, CleanUp);
return Ok(transactionResponse);
}
private Task CleanUp(object requestObject, string rawResponse, string httpMethod, string relativeUrl)
{
_logger.LogInformation(relativeUrl, new
{
httpMethod,
rawResponse,
requestObject
});
return Task.CompletedTask;
}
}
Contributing
Contributions to this library are welcome! If you have ideas for improvements or new features, feel free to fork the repository, make your changes, and submit a pull request.
License
This library is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Caching.Abstractions (>= 2.1.23)
- Microsoft.Extensions.Caching.Memory (>= 2.1.23)
- Microsoft.Extensions.Configuration.Binder (>= 2.1.10)
- Microsoft.Extensions.Http (>= 2.1.0)
- Microsoft.Net.Http.Headers (>= 2.1.0)
- Paystack.Net (>= 1.1.1)
- System.Text.Json (>= 8.0.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.