This development is in a very early stage, please use it at your own risk and feel free to improve it and send Pull Requests.
To install you must:
- Install from nuget PM> Install-Package PuntoPagos-SDK
- Configure this sdk by code or config file, view Configuration
- Use.
You can configure and use this SDK to create a new instance of the class PuntoPago and calling the following order independent methods:
var puntoPagoSdk = new PuntoPago().SetKey("Key").SetSecretCode("SecretCode").SetEnvironment(EnvironmentForPuntoPago.Sandbox).CreateTransaction();
If you prefer, you can configure this Sdk by config file, addings this keys of AppSetting
<add key ="PuntoPago-Secret" value="YOU SECRET CODE" /> <add key ="PuntoPago-Key" value="YOU KEY" /> <add key="PuntoPago-Environment" value="" /><!--Values: Sandbox or Production--/>
By default this Sdk use Log4Net for logger, but you can set you favorite logs system, calling to SetLog method of class PuntoPago. You need extends ILog interface located in Acid.PuntoPagos.Sdk.Interfaces.ILog
var puntoPagoSdk = new PuntoPago().SetLog(you instance of log);
var puntoPago = new PuntoPago().CreateTransaction(); var createTransactionDto = puntoPago.CreateTransaction(new CreateTransactionRequestDto(100, 123121)); //Redirect to createTransactionDto.ProcessUrl
var puntoPago = new PuntoPago().CreateTransaction(); //request is the WebRequest var notificationTransactionDto = puntoPago.NotificationTransaction(request); //Returns if the result of transacction. notificationTransactionDto.IsTransactionSuccessful(); //Returns response for Punto Pagos notificationTransactionDto.GenerateResponse();
var puntoPago = new PuntoPago().CreateTransaction(); // var checkTransactionRequestDto = puntoPago.CheckStatusTransaction(new CheckTransactionRequestDto(100, Transaction Client Id, "Token of Punto Pago")); //Returns if the result of transacction. checkTransactionRequestDto.IsTransactionSuccessful();
Gateway | Payload | Expected Result |
Transbank | Visa / 4051885600446623 / CVV: 123 / exp: any | Success |
Transbank | Mastercard / 5186059559590568 / CVV: 123 / exp: any | Failure |
- Create Wiki
Alejandro Labra
Thanks to dvinales for not suing us, and imella for by knowledge.