Skip to content

Commit

Permalink
Add new enpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiagogresende committed Jan 8, 2019
1 parent 5d9b083 commit 21fe488
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.0.7

- Added: new endpoint (SettleCarnetParcel)
- Added: new endpoint (SettleCharge)

# 1.0.6

- Added: new endpoint (update plan)
Expand Down
3 changes: 3 additions & 0 deletions Gerencianet.SDK.Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ static void Main(string[] args)
//UpdateBillet.Execute();
//UpdateCarnetMetadata.Execute();
//CancelCharge.Execute();
//SettleCharge.Execute();

//CreateBilletPayment.Execute();
//CreateCardPayment.Execute();
Expand All @@ -32,6 +33,8 @@ static void Main(string[] args)
//DetailCarnet.Execute();
//ResendCarnet.Execute();
//ResendParcel.Execute();
//SettleCarnetParcel.Execute();

//UpdateCarnetMetadata.Execute();
//UpdateParcel.Execute();

Expand Down
29 changes: 29 additions & 0 deletions Gerencianet.SDK.Examples/SettleCarnetParcel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;

namespace Gerencianet.SDK.Examples
{
class SettleCarnetParcel
{
public static void Execute()
{
dynamic endpoints = new Endpoints(Credentials.Default.ClientId, Credentials.Default.ClientSecret, Credentials.Default.Sandbox);

var param = new
{
id = 0,
parcel = 1
};

try
{
var response = endpoints.SettleCarnetParcel(param);
Console.WriteLine(response);
}
catch (GnException e)
{
Console.WriteLine(e.ErrorType);
Console.WriteLine(e.Message);
}
}
}
}
28 changes: 28 additions & 0 deletions Gerencianet.SDK.Examples/SettleCharge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

namespace Gerencianet.SDK.Examples
{
class SettleCharge
{
public static void Execute()
{
dynamic endpoints = new Endpoints(Credentials.Default.ClientId, Credentials.Default.ClientSecret, Credentials.Default.Sandbox);

var param = new
{
id = 1
};

try
{
var response = endpoints.settleCharge(param);
Console.WriteLine(response);
}
catch (GnException e)
{
Console.WriteLine(e.ErrorType);
Console.WriteLine(e.Message);
}
}
}
}
4 changes: 2 additions & 2 deletions Gerencianet.SDK.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package >
<metadata>
<id>Gerencianet.SDK</id>
<version>1.0.6</version>
<authors>Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza, Filipe Mata</authors>
<version>1.0.7</version>
<authors>Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza, Filipe Mata, Thiago Resende</authors>
<projectUrl>https://github.com/gerencianet/gn-api-sdk-dotnet</projectUrl>
<iconUrl>https://avatars2.githubusercontent.com/u/7284118</iconUrl>
<licenseUrl>https://github.com/gerencianet/gn-api-sdk-dotnet/blob/master/LICENSE</licenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion Gerencianet.SDK/Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Endpoints : DynamicObject
{
private const string ApiBaseURL = "https://api.gerencianet.com.br/v1";
private const string ApiBaseSandboxURL = "https://sandbox.gerencianet.com.br/v1";
private const string Version = "1.0.6";
private const string Version = "1.0.7";

private JObject endpoints;
private string clientId;
Expand Down
4 changes: 2 additions & 2 deletions Gerencianet.SDK/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]
10 changes: 9 additions & 1 deletion Gerencianet.SDK/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,13 @@
"CreateSubscriptionHistory": {
"route": "/subscription/:id/history",
"method": "POST"
}
},
"SettleCharge": {
"route": "/charge/:id/settle",
"method": "PUT"
},
"SettleCarnetParcel": {
"route": "/carnet/:id/parcel/:parcel/settle",
"method": "PUT"
}
}

0 comments on commit 21fe488

Please sign in to comment.