CieloOficial 1.5.0

dotnet add package CieloOficial --version 1.5.0                
NuGet\Install-Package CieloOficial -Version 1.5.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CieloOficial" Version="1.5.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CieloOficial --version 1.5.0                
#r "nuget: CieloOficial, 1.5.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CieloOficial as a Cake Addin
#addin nuget:?package=CieloOficial&version=1.5.0

// Install CieloOficial as a Cake Tool
#tool nuget:?package=CieloOficial&version=1.5.0                

Webservice-1.5-csharp

Integração em C# com o Webservice Cielo 1.5

Criando uma transação

using CieloEcommerce;
//...
String mid = "1006993069";
String key = "25fbb99741c739dd84d7b06ec78c9bac718838630f30b112d033ce2e621b34f3";

Cielo cielo = new Cielo (mid, key, Cielo.TEST);

Holder holder = cielo.holder ("4012001038443335", "2018", "05", "123");
holder.name = "Fulano Portador da Silva";

Random randomOrder = new Random ();

Order order = cielo.order (randomOrder.Next (1000, 10000).ToString (), 10000);
PaymentMethod paymentMethod = cielo.paymentMethod (PaymentMethod.VISA, PaymentMethod.CREDITO_A_VISTA);

Transaction transaction = cielo.transactionRequest (
	holder,
	order,
	paymentMethod,
	"http://localhost/cielo",
	Transaction.AuthorizationMethod.AUTHORIZE_WITHOUT_AUTHENTICATION,
	false
);

//...

Criando uma transação e enviando para autorização

using CieloEcommerce;
//...

try {
	Transaction transaction = cielo.transactionRequest (
		                          holder,
		                          order,
		                          paymentMethod,
		                          "http://localhost/cielo",
		                          Transaction.AuthorizationMethod.AUTHORIZE_WITHOUT_AUTHENTICATION,
		                          false
	                          );

	if (transaction.authorization != null && transaction.authorization.lr == "00") {
		Console.Write ("Transação autorizada com sucesso. TID=");
		Console.WriteLine (transaction.tid);
	}
} catch (CieloException e) {
	Console.WriteLine ("Opz..");
	Console.WriteLine (e.Code);
	Console.WriteLine (e.Message);
}

Exemplo de consulta

using CieloEcommerce;
//...


try {
	transaction = cielo.consultationRequest ("1006993069000654F07A"); // tid da transação
} catch (CieloException e) {
	Console.WriteLine (e.Code);
	Console.WriteLine (e.Message);
}

Cancelamento total de uma transação

using CieloEcommerce;
//...


try {
	transaction = cielo.cancellationRequest (transaction);
} catch (CieloException e) {
	Console.WriteLine (e.Code);
	Console.WriteLine (e.Message);
}

Captura total de uma transação

using CieloEcommerce;
//...


try {
	transaction = cielo.captureRequest (transaction);
} catch (CieloException e) {
	Console.WriteLine (e.Code);
	Console.WriteLine (e.Message);
}

Captura parcial de uma transação

using CieloEcommerce;
//...


try {
	transaction = cielo.captureRequest (transaction, 10000);
} catch (CieloException e) {
	Console.WriteLine (e.Code);
	Console.WriteLine (e.Message);
}
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 1,215 1/30/2017
1.3.0 1,532 5/19/2016

Operações disponíveis:

- Criação de uma transação
- Autorização de uma transação
- Consulta de uma transação pelo TID
- Cancelamento de uma transação
- Captura total ou parcial de uma transação