diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 9d6df32..93ce310 --- a/.gitignore +++ b/.gitignore @@ -233,4 +233,7 @@ _Pvt_Extensions .paket/paket.exe # FAKE - F# Make -.fake/ \ No newline at end of file +.fake/ + +# nuget +Gerencianet.SDK/nuget.exe \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 19b27b9..5880644 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Gerencianet.SDK.Examples/CreateSubscriptionHistory.cs b/Gerencianet.SDK.Examples/CreateSubscriptionHistory.cs new file mode 100755 index 0000000..bc2f1b0 --- /dev/null +++ b/Gerencianet.SDK.Examples/CreateSubscriptionHistory.cs @@ -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); + } + } + } +} diff --git a/Gerencianet.SDK.Examples/UpdatePlan.cs b/Gerencianet.SDK.Examples/UpdatePlan.cs new file mode 100755 index 0000000..314d7bd --- /dev/null +++ b/Gerencianet.SDK.Examples/UpdatePlan.cs @@ -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); + } + } + } +} diff --git a/Gerencianet.SDK.nuspec b/Gerencianet.SDK.nuspec old mode 100644 new mode 100755 index 96abcde..cadb7e8 --- a/Gerencianet.SDK.nuspec +++ b/Gerencianet.SDK.nuspec @@ -2,8 +2,8 @@ Gerencianet.SDK - 1.0.4 - Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza + 1.0.6 + Cecília Devêza, Danniel Hugo, Francisco Thiene, Talita Campos, Thomaz Feitoza, Filipe Mata https://github.com/gerencianet/gn-api-sdk-dotnet https://avatars2.githubusercontent.com/u/7284118 https://github.com/gerencianet/gn-api-sdk-dotnet/blob/master/LICENSE diff --git a/Gerencianet.SDK/Endpoints.cs b/Gerencianet.SDK/Endpoints.cs old mode 100644 new mode 100755 index dcc397e..88c8de9 --- a/Gerencianet.SDK/Endpoints.cs +++ b/Gerencianet.SDK/Endpoints.cs @@ -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; diff --git a/Gerencianet.SDK/Properties/AssemblyInfo.cs b/Gerencianet.SDK/Properties/AssemblyInfo.cs old mode 100644 new mode 100755 index e5cadf0..9c1acce --- a/Gerencianet.SDK/Properties/AssemblyInfo.cs +++ b/Gerencianet.SDK/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Gerencianet.SDK/endpoints.json b/Gerencianet.SDK/endpoints.json index 565bee1..0458bf3 100755 --- a/Gerencianet.SDK/endpoints.json +++ b/Gerencianet.SDK/endpoints.json @@ -118,5 +118,13 @@ "UpdateChargeLink": { "route": "/charge/:id/link", "method": "PUT" + }, + "UpdatePlan": { + "route": "/plan/:id", + "method": "PUT" + }, + "CreateSubscriptionHistory": { + "route": "/subscription/:id/history", + "method": "POST" } }