Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from rainxh11/main
Browse files Browse the repository at this point in the history
+ Fixed type 'ChagilyEpay' -->  'ChargilyEpay'
  • Loading branch information
rainxh11 authored Aug 24, 2022
2 parents 59878ad + 16c2dc7 commit 1af30ca
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using chargily.epay.csharp;
using Chargily.Epay;
using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/Chargily.Epay.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<OutputType>Library</OutputType>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<StartupObject />
<Authors>Chargily</Authors>
<Description>C# .NET Library to use Chargily Epay</Description>
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/ChargilyApIConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class ChargilyApIConfig
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
using chargily.epay.csharp.Validations;
using Chargily.Epay.Validations;
using FluentValidation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Refit;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public static class ChagilyEpay
public static class ChargilyEpay
{
private static ChargilyEpayClient _client = null;
private static IServiceProvider _provider;
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/ChargilyEpayClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class ChargilyEpayClient : IChargilyEpayClient<EpayPaymentResponse, EpayPaymentRequest>
{
Expand Down
4 changes: 2 additions & 2 deletions Chargily.Epay.CSharp/ChargilyEpayService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using Refit;
using FluentValidation;
using System.Net.Http;
using chargily.epay.csharp.Validations;
using Chargily.Epay.Validations;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public static partial class ChargilyEpayService
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/EpayPaymentRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text.Json.Serialization;


namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class EpayPaymentRequest
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/EpayPaymentResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text.Json;
using System.Threading.Tasks;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class EpayPaymentResponse
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/IChargilyEpayAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using Refit;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public interface IChargilyEpayAPI
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/IChargilyEpayClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Threading.Tasks;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public interface IChargilyEpayClient<TResponse, TRequest>
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/IWebHookValidator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.IO;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public interface IWebHookValidator
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/PaymentMethod.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace chargily.epay.csharp
namespace Chargily.Epay
{
public enum PaymentMethod
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/PaymentRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class PaymentRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Text;
using FluentValidation;

namespace chargily.epay.csharp.Validations
namespace Chargily.Epay.Validations
{
public class PaymentRequestValidator : AbstractValidator<EpayPaymentRequest>
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/WebHookValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class WebHookValidator : IWebHookValidator
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/WebHookValidatorMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.Extensions.Logging;
using System.Net.Http.Headers;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
public class WebHookValidatorMiddleware : IMiddleware
{
Expand Down
2 changes: 1 addition & 1 deletion Chargily.Epay.CSharp/WebHookValidatorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;

namespace chargily.epay.csharp
namespace Chargily.Epay
{
/// <summary>
/// Chargily Epay Services
Expand Down
4 changes: 2 additions & 2 deletions ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Text.Json;
using chargily.epay.csharp;
using Chargily.Epay;

Console.Write($"Provide Chargily API_KEY : ");
var apiKey = Console.ReadLine();

var client = ChagilyEpay.CreateClient(apiKey);
var client = ChargilyEpay.CreateClient(apiKey);

var payment = new EpayPaymentRequest()
{
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ Install-Package chargily.epay.csharp
1. Get your API Key/Secret from [ePay by Chargily](https://epay.chargily.com.dz) dashboard for free

# How to use
### Installation & Project Creation Video Guide
*Soon*

### __Usage with any generic C# Project:__
this package provide `ChargilyEpayClient` client, to create payment request use:
```csharp
using chargily.epay.csharp;
using Chargily.Epay;

var client = ChagilyEpay.CreateClient("[API_KEY]");
var client = ChargilyEpay.CreateClient("[API_KEY]");

var payment = new EpayPaymentRequest()
{
Expand All @@ -72,14 +75,22 @@ var response = await client.CreatePayment(payment);
```

# Usage with ASP.NET Core

### Video Guide how to use with Minimal API
*Soon*

### Video Guide how to use with ASP.NET Core WebAPI
*Soon*


## this applies to:
- ASP.NET Core WebAPI
- ASP.NET Core Minimal WebAPI
- Blazor Server
- Blazor WASM
- ASP.NET Core MVC
```csharp
using chargily.epay.csharp;
using Chargily.Epay;
using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);
Expand Down Expand Up @@ -128,7 +139,7 @@ app.Run();
```
### WebHook Validation:
```csharp
using chargily.epay.csharp;
using Chargily.Epay;
using Microsoft.AspNetCore.Mvc;

var builder = WebApplication.CreateBuilder(args);
Expand Down Expand Up @@ -182,7 +193,7 @@ builder.Services.AddChargilyEpayGateway();
This package provide `WebHookValidatorMiddleware` ASP.NET Core Middleware, when registered every `POST` request that have a `Signature` Http Header will be validated automatically.
How to register the Middleware:
```csharp
using chargily.epay.csharp;
using Chargily.Epay;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -205,7 +216,7 @@ using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Extensions.DependencyInjection;
using chargily.epay.csharp;
using Chargily.Epay;

namespace MyApp
{
Expand Down

0 comments on commit 1af30ca

Please sign in to comment.