Chargily / chargily-epay-csharp

C# Library for Chargily ePay Gateway
https://dev.chargily.com/docs/#/epay-csharp
MIT License
7 stars 3 forks source link

problem de epay c sharp #5

Closed cheurfa20081984 closed 2 years ago

cheurfa20081984 commented 2 years ago

Project Sdk="Microsoft.NET.Sdk">

Exe net6.0 enable enable

problem execustion en consol test problem version chargily 1.0.2 na pas compatible chargily epaygetway problem monque de dll

Gravité Code Description Projet Fichier Ligne État de la suppression Avertissement NETSDK1182 le ciblage de .NET 6.0 dans Visual Studio 2019 n’est pas pris en charge. Chargily.Epay.CSharp.AspNetCore.MinimalAPIExample C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets 134

<Target Name="_WarnWhenUsingNET6AndVSPriorTo17" BeforeTargets="_CheckForInvalidConfigurationAndPlatform" Condition="$([MSBuild]::VersionLessThan($(VisualStudioVersion), '17.0')) and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '6.0'))">

Gravité Code Description Projet Fichier Ligne État de la suppression Erreur NU1104 Projet 'C:\Users\DEMDZ\Desktop\chargily-epay-csharp-1.0.2\Chargily.EpayGateway.NET\Chargily.EpayGateway.NET.csproj' introuvable. Vérifiez que la référence de projet est valide et que le fichier projet existe. ConsoleTest C:\Users\DEMDZ\Desktop\chargily-epay-csharp-1.0.2\ConsoleTest\ConsoleTest.csproj 1

rainxh11 commented 2 years ago

Avertissement NETSDK1182 le ciblage de .NET 6.0 dans Visual Studio 2019 n’est pas pris en charge. .NET 6 is not installed

rainxh11 commented 2 years ago

This is the most generic way to use it and it doesn't require any messing with dependency injection

using chargily.epay.csharp;

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

var payment = new EpayPaymentRequest()
{
    InvoiceNumber = "[INVOICE_NUMBER]",
    Name = "Ahmed",
    Email = "rainxh11@gmail.com",
    Amount = 1500,
    DiscountPercentage = 5.0,
    PaymentMethod = PaymentMethod.EDAHABIA,
    BackUrl = "https://yourapp.com/",
    WebhookUrl = "https://api.yourbackend.com/webhook-validator",
    ExtraInfo = "Product Purchase"
};

var response = await client.CreatePayment(payment);

This is using .NET 6.0 Top Statements