Skip to content

Commit

Permalink
Add new enpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipeMata committed Jan 11, 2018
1 parent eeb4cd1 commit 5d9b083
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,7 @@ _Pvt_Extensions
.paket/paket.exe

# FAKE - F# Make
.fake/
.fake/

# nuget
Gerencianet.SDK/nuget.exe
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.0.6

- Added: new endpoint (update plan)
- Added: new endpoint (create subscription history)

# 1.0.5

- Added: new endpoint (update charge link)
Expand Down
33 changes: 33 additions & 0 deletions Gerencianet.SDK.Examples/CreateSubscriptionHistory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;

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

var param = new {
id = 1000
};

var body = new
{
description = "This subscription was not fully paid"
};


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

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

var param = new {
id = 1001
};

var body = new {
name = "My new plan"
};

try
{
var response = endpoints.UpdatePlan(param, body);
Console.WriteLine(response);
}
catch (GnException e)
{
Console.WriteLine(e.ErrorType);
Console.WriteLine(e.Message);
}
}
}
}
4 changes: 2 additions & 2 deletions Gerencianet.SDK.nuspec
100644 → 100755
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.4</version>
<authors>Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza</authors>
<version>1.0.6</version>
<authors>Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza, Filipe Mata</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
100644 → 100755
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.4";
private const string Version = "1.0.6";

private JObject endpoints;
private string clientId;
Expand Down
4 changes: 2 additions & 2 deletions Gerencianet.SDK/Properties/AssemblyInfo.cs
100644 → 100755
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.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
8 changes: 8 additions & 0 deletions Gerencianet.SDK/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,13 @@
"UpdateChargeLink": {
"route": "/charge/:id/link",
"method": "PUT"
},
"UpdatePlan": {
"route": "/plan/:id",
"method": "PUT"
},
"CreateSubscriptionHistory": {
"route": "/subscription/:id/history",
"method": "POST"
}
}

0 comments on commit 5d9b083

Please sign in to comment.