This package supports the following frameowrks and platforms:
| Framework | Support | Platform |
|---|---|---|
| Console | ✅ | Windows, Linux, macOS |
| ASP.NET Core | ✅ | Windows, Linux, macOS |
| Blazor WASM | ✅ | Windows, Linux, macOS |
| Blazor Server | ✅ | Windows, Linux, macOS |
| .NET MAUI | ✅ | Windows, Linux, macOS, Android, iOS, Tizen |
| Xamarin | ✅ | Android, iOS |
| ASP.NET | ✅ | Windows |
| WPF | ✅ | Windows |
| AvaloniaUI | ✅ | Windows, Linux, macOS |
| UWP | ✅ | Windows, Xbox OS |
| WinForms | ✅ | Windows |
Microsoft.Extensions.DependencyInjection can use this package.
Installation
First, install thechargily.epay.csharp NuGet package into your app
Using DotNet CLI :
Using Visual Studio Dev Console:
Using Visual Studio IDE:
Requirements
- Get your API Key/Secret from ePay by Chargily dashboard for free
How to use
Installation & Project Creation Video Guide
Implemention of the code below:
Usage with any generic C# Project:
this package provideChargilyEpayClient client, to create payment request use:
Usage with ASP.NET Core
Video Guide how to use with Minimal API
Video Guide how to use with ASP.NET Core WebAPI
Soonthis applies to:
- ASP.NET Core WebAPI
- ASP.NET Core Minimal WebAPI
- Blazor Server
- Blazor WASM
- ASP.NET Core MVC
Request:
Response:
WebHook Validation:
Configuration:
API_KEY & APP_SECRET can be added directly in code or from appsettings.json configuration file
appsettings.json file:
ASP.NET Core Middleware
This package provideWebHookValidatorMiddleware ASP.NET Core Middleware, when registered every POST request that have a Signature Http Header will be validated automatically.
How to register the Middleware:
Usage with .NET MAUI
ViewModels:
Note when using .NET MAUI / Xamarin:
storing sensitiveAPP_SECRET in a frontend app is not a recommended approach, you’d be better off calling a backend api to handle payment, but it’s doable.
if you decide to use it in the frontend, consider storing APP_SECRET with Akavache BlobCache.Secure