Skip to content

Commit

Permalink
Merge pull request #7 from pallomabritoGN/master
Browse files Browse the repository at this point in the history
Versão 3.0.0
  • Loading branch information
pallomabritoGN authored Aug 11, 2022
2 parents ef94099 + 815996d commit 31a54d6
Show file tree
Hide file tree
Showing 33 changed files with 1,396 additions and 446 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 3.0.0
- Added: include new endpoints of "API Open Finance"
- Added: include new endpoints of "API Pagamentos"
- Added: include new endpoints of "API Pix"
- Updated: PixSend example
- Update: rename 'pix_cert' for 'certificate' in credentials.json

# 2.0.2

- Fix: update dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.6.0"/>
<PackageReference Include="RestSharp" Version="106.12.0"/>
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.3.21201.4"/>
<PackageReference Include="Gerencianet.NETCore.SDK" Version="2.0.2"/>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="RestSharp" Version="108.0.1" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="Gerencianet.NETCore.SDK" Version="3.0.0"/>
</ItemGroup>

<ItemGroup>
<Reference Include="System">
<HintPath>System</HintPath>
</Reference>
</ItemGroup>

</Project>
170 changes: 101 additions & 69 deletions Gerencianet.NETCore.SDK.Examples/Program.cs
Original file line number Diff line number Diff line change
@@ -1,89 +1,121 @@
namespace Gerencianet.NETCore.SDK.Examples {
internal class Program {
private static void Main (string[] args) {
using System;

/* PIX - WEBHOOK*/
//PixConfigWebhook.Execute();
//PixDeleteWebhook.Execute();
//PixDetailWebhook.Execute();
//PixListWebhook.Execute();
namespace Gerencianet.NETCore.SDK.Examples
{
internal class Program
{
static void Main(string[] args)
{
/* PIX - WEBHOOK */
// PixConfigWebhook.Execute();
// PixDeleteWebhook.Execute();
// PixDetailWebhook.Execute();
// PixListWebhook.Execute();

/* PIX - CHARGE*/
//PixCreateCharge.Execute();
//PixCreateImmediateCharge.Execute();
//PixDetailCharge.Execute();
//PixListCharges.Execute();
//PixUpdateCharge.Execute();
/* PIX - CHARGE */
// PixCreateCharge.Execute();
// PixCreateImmediateCharge.Execute();
// PixDetailCharge.Execute();
// PixListCharges.Execute();
// PixUpdateCharge.Execute();

/* PIX - COBV */
// PixCreateDueCharge.Execute();
// PixUpdateDueCharge.Execute();
// PixDetailDueCharge.Execute();
// PixListDueCharges.Execute();

/* PIX - PIX*/
//PixDetail.Execute();
//PixDevolution.Execute();
//PixDetailDevolution.Execute();
//PixListReceived.Execute();
//PixSend.Execute();
/* PIX - PIX */
// PixDetail.Execute();
// PixDevolution.Execute();
// PixDetailDevolution.Execute();
// PixListReceived.Execute();
// PixSend.Execute();

/* PIX - LOCATION*/
//PixCreateLocation.Execute();
//PixDetailLocation.Execute();
//PixListLocation.Execute();
//PixUnsetTxid.Execute();
//PixGenerateQRCode.Execute();
/* PIX - LOCATION */
// PixCreateLocation.Execute();
// PixDetailLocation.Execute();
// PixListLocation.Execute();
// PixUnsetTxid.Execute();
// PixGenerateQRCode.Execute();

/* GN - KEY */
// GnListEvp.Execute();
// GnCreateEvp.Execute();
// GnDeleteEvp.Execute();

/* GN - KEY*/
//GnListEvp.Execute();
//GnCreateEvp.Execute();
//GnDeleteEvp.Execute();
/* GN - ACCOUNT */
// GnDetailBalance.Execute();
// GnDetailSettings.Execute();
// GnUpdateSettings.Execute();

/* GN - ACCOUNT*/
//GnDetailBalance.Execute();
//GnDetailSettings.Execute();
//GnUpdateSettings.Execute();
/* GN - REPORT */
// CreateReport.Execute();
// DetailReport.Execute();

/* CHARGES */
//OneStepBankingBillet.Execute ();
//CreateCharge.Execute();
//CreateChargeHistory.Execute();
//DetailCharge.Execute();
//ResendBillet.Execute();
//UpdateBillet.Execute();
//UpdateChargeMetadata.Execute();
//CancelCharge.Execute();
//SettleCharge.Execute();
//CreateBilletPayment.Execute();
//CreateCardPayment.Execute();
//ChargeLink.Execute();
// OneStepBankingBillet.Execute ();
// CreateCharge.Execute();
// CreateChargeHistory.Execute();
// DetailCharge.Execute();
// ResendBillet.Execute();
// UpdateBillet.Execute();
// UpdateChargeMetadata.Execute();
// CancelCharge.Execute();
// SettleCharge.Execute();
// CreateBilletPayment.Execute();
// CreateCardPayment.Execute();
// ChargeLink.Execute();
// OneStepLink.Execute();
// ResendChargeLink.Execute();

/* SUBSCRIPTIONS */
//CancelSubscription.Execute();
//CreatePlan.Execute();
//GetPlans.Execute();
//DeletePlan.Execute();
//CreateSubscription.Execute();
//CreateSubscriptionHistory.Execute();
//CreateSubscriptionPayment.Execute();
//DetailSubscription.Execute();
//UpdateSubscriptionMetadata.Execute();
//UpdatePlan.Execute();
// CancelSubscription.Execute();
// CreatePlan.Execute();
// GetPlans.Execute();
// DeletePlan.Execute();
// CreateSubscription.Execute();
// CreateSubscriptionHistory.Execute();
// CreateSubscriptionPayment.Execute();
// DetailSubscription.Execute();
// UpdateSubscriptionMetadata.Execute();
// UpdatePlan.Execute();
// OneStepSubscriptionLink.Execute();
// OneStepSubscription.Execute();
// ResendSubscriptionCharge.Execute();

/* CARNETS */
//CancelCarnet.Execute();
//CancelParcel.Execute();
//CreateCarnet.Execute();
//CreateCarnetHistory.Execute();
//DetailCarnet.Execute();
//ResendCarnet.Execute();
//ResendParcel.Execute();
//SettleCarnetParcel.Execute();
//UpdateCarnetMetadata.Execute();
//UpdateParcel.Execute();
// CancelCarnet.Execute();
// CancelParcel.Execute();
// CreateCarnet.Execute();
// CreateCarnetHistory.Execute();
// DetailCarnet.Execute();
// ResendCarnet.Execute();
// ResendParcel.Execute();
// SettleCarnet.Execute();
// SettleCarnetParcel.Execute();
// UpdateCarnetMetadata.Execute();
// UpdateParcel.Execute();

/* NOTIFICATIONS */
//GetNotification.Execute();

/* OTHER */
//GetInstallments.Execute();
// GetInstallments.Execute();

/* OPEN FINANCE */
// OfUpdateSettings.Execute();
// OfDetailSettings.Execute();
// OfListParticipants.Execute();
// OfStartPixPayment.Execute();
// OfListPixPayment.Execute();

/* PAYMENTS */
// PayDetailBarCode.Execute();
// PayRequestBarCode.Execute();
// PayDetailPayment.Execute();
// PayListPayments.Execute();

//AllInOne.Execute();
}
}
}
}
8 changes: 4 additions & 4 deletions Gerencianet.NETCore.SDK.Examples/credentials.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"client_id": "",
"client_secret": "",
"sandbox": false,
"pix_cert": "certificate.p12"
"client_id":"",
"client_secret":"",
"sandbox": false,
"certificate": "production.p12"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void Execute () {
dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

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

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void Execute () {
dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void Execute () {
dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

var param = new {
id = 1001
id = 1
};

var body = new {
Expand Down
25 changes: 25 additions & 0 deletions Gerencianet.NETCore.SDK.Examples/default/carnet/SettleCarnet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.IO;
using Newtonsoft.Json.Linq;

namespace Gerencianet.NETCore.SDK.Examples {
internal class SettleCarnet {
public static void Execute () {

dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

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

try {
var response = endpoints.SettleCarnet(param);
Console.WriteLine (response);
} catch (GnException e) {
Console.WriteLine (e.ErrorType);
Console.WriteLine (e.Message);
}
}
}
}
36 changes: 36 additions & 0 deletions Gerencianet.NETCore.SDK.Examples/default/charge/OneStepLink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.IO;
using Newtonsoft.Json.Linq;


namespace Gerencianet.NETCore.SDK.Examples {
internal class OneStepLink {
public static void Execute () {

dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

var body = new {
items = new [] {
new {
name = "Product 1",
value = 590,
amount = 2
}
},
settings = new {
payment_method = "all",
expire_at = "2022-12-15",
request_delivery_address = false
}
};

try {
var response = endpoints.OneStepLink(null, body);
Console.WriteLine (response);
} catch (GnException e) {
Console.WriteLine (e.ErrorType);
Console.WriteLine (e.Message);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.IO;
using Newtonsoft.Json.Linq;


namespace Gerencianet.NETCore.SDK.Examples {
internal class ResendChargeLink {
public static void Execute () {

dynamic endpoints = new Endpoints(JObject.Parse (File.ReadAllText ("credentials.json")));

var param = new {
id = 1
};

try {
var response = endpoints.ResendChargeLink(param);
Console.WriteLine (response);
} catch (GnException e) {
Console.WriteLine (e.ErrorType);
Console.WriteLine (e.Message);
}
}
}
}
Loading

0 comments on commit 31a54d6

Please sign in to comment.