Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Paybook/Paybook.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 17
VisualStudioVersion = 17.11.35208.52
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Paybook", "Paybook\Paybook.csproj", "{ED50E44A-ADCD-466F-8EB0-B2EE7032B919}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Paybook", "Paybook\Paybook.csproj", "{ED50E44A-ADCD-466F-8EB0-B2EE7032B919}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTesting", "UnitTesting\UnitTesting.csproj", "{3807A3FB-8950-4207-A24C-AA7B9AA64E5C}"
EndProject
Expand Down
5 changes: 0 additions & 5 deletions Paybook/Paybook/Account.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
Expand Down
6 changes: 1 addition & 5 deletions Paybook/Paybook/Account_Type.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
Expand Down
5 changes: 0 additions & 5 deletions Paybook/Paybook/Attachment.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
Expand Down
7 changes: 1 addition & 6 deletions Paybook/Paybook/Attachment_Type.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
public class Attachment_Type
Expand Down
15 changes: 5 additions & 10 deletions Paybook/Paybook/Catalogues.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
public class Catalogues : Paybook
{

public List<Account_Type> get_account_types(Session session, string id_user = "", Dictionary<string, string> d = null)
public List<Account_Type> get_account_types(Session session, string id_user = "", Dictionary<string, string>? d = null)
{
try
{
Expand Down Expand Up @@ -39,7 +34,7 @@ public List<Account_Type> get_account_types(Session session, string id_user = ""
}


public List<Attachment_Type> get_attachment_types(Session session, string id_user = "", Dictionary<string, string> d = null)
public List<Attachment_Type> get_attachment_types(Session session, string id_user = "", Dictionary<string, string>? d = null)
{
try
{
Expand Down Expand Up @@ -67,7 +62,7 @@ public List<Attachment_Type> get_attachment_types(Session session, string id_use
}


public List<Country> get_countries(Session session, string id_user = "", Dictionary<string, string> d = null)
public List<Country> get_countries(Session session, string id_user = "", Dictionary<string, string>? d = null)
{
try
{
Expand All @@ -94,7 +89,7 @@ public List<Country> get_countries(Session session, string id_user = "", Diction
}
}

public List<Site> get_sites(Session session, string id_user = "", Dictionary<string, string> d = null, bool is_test = false)
public List<Site> get_sites(Session session, string id_user = "", Dictionary<string, string>? d = null, bool is_test = false)
{
try
{
Expand Down Expand Up @@ -125,7 +120,7 @@ public List<Site> get_sites(Session session, string id_user = "", Dictionary<str
}
}

public List<Site_Organization> get_site_organizations(Session session, string id_user = "", Dictionary<string, string> d = null, bool is_test = false)
public List<Site_Organization> get_site_organizations(Session session, string id_user = "", Dictionary<string, string>? d = null, bool is_test = false)
{
try
{
Expand Down
6 changes: 1 addition & 5 deletions Paybook/Paybook/Country.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
Expand Down
5 changes: 0 additions & 5 deletions Paybook/Paybook/Credentials.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
Expand Down
6 changes: 1 addition & 5 deletions Paybook/Paybook/Credentials_Structure.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
Expand Down
7 changes: 1 addition & 6 deletions Paybook/Paybook/Error.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
Expand Down
11 changes: 3 additions & 8 deletions Paybook/Paybook/JsonContent.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
Expand All @@ -26,15 +21,15 @@ public JsonContent(JToken value)
}

protected override Task SerializeToStreamAsync(Stream stream,
TransportContext context)
TransportContext? context)
{
var jw = new JsonTextWriter(new StreamWriter(stream))
{
Formatting = Formatting.Indented
};
_value.WriteTo(jw);
jw.Flush();
return Task.FromResult<object>(null);
return Task.FromResult<object?>(null);
}

protected override bool TryComputeLength(out long length)
Expand All @@ -54,7 +49,7 @@ public static string JsonToQueryString(JObject json)
}

StringBuilder sb = new StringBuilder();
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json.ToString());
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json.ToString()) ?? new Dictionary<string, string>();
foreach (KeyValuePair<string, string> entry in values)
{
sb.AppendLine("&" + entry.Key + "=" + entry.Value);
Expand Down
24 changes: 0 additions & 24 deletions Paybook/Paybook/PBException.cs

This file was deleted.

10 changes: 2 additions & 8 deletions Paybook/Paybook/Paybook.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Http;
using Newtonsoft.Json.Linq;
using System.Net.Http.Headers;
using System.Text;

namespace PaybookSDK
{
public abstract class Paybook
{
const string paybook_link = "https://sync.paybook.com/v1/";
const string paybook_link = "https://opendata-api.syncfy.com/v1/";

public static string api_key { get; set; }
public enum method { post, get, delete }
Expand Down
95 changes: 17 additions & 78 deletions Paybook/Paybook/Paybook.csproj
Original file line number Diff line number Diff line change
@@ -1,82 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ED50E44A-ADCD-466F-8EB0-B2EE7032B919}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Paybook</RootNamespace>
<AssemblyName>Paybook</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Title>Paybook</Title>
<Version>2.0.0</Version>
<PackageId>$(AssemblyName)</PackageId>
<Description>this is a .net(v.8.0) sdk to comunicate with paybook service, in OOP way.</Description>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageProjectUrl>https://github.com/Paybook/sync-net</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Account.cs" />
<Compile Include="Account_Type.cs" />
<Compile Include="Attachment.cs" />
<Compile Include="Attachment_Type.cs" />
<Compile Include="Catalogues.cs" />
<Compile Include="Country.cs" />
<Compile Include="Credentials.cs" />
<Compile Include="Credentials_Structure.cs" />
<Compile Include="JsonContent.cs" />
<Compile Include="Paybook.cs" />
<Compile Include="Error.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Session.cs" />
<Compile Include="Site.cs" />
<Compile Include="Site_Organization.cs" />
<Compile Include="Transaction.cs" />
<Compile Include="User.cs" />
</ItemGroup>

<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
36 changes: 0 additions & 36 deletions Paybook/Paybook/Properties/AssemblyInfo.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Paybook/Paybook/Session.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaybookSDK
{
public class Session : Paybook
Expand Down
6 changes: 1 addition & 5 deletions Paybook/Paybook/Site.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace PaybookSDK
{
Expand Down
Loading