Created
July 3, 2018 19:32
-
-
Save MarceloPrado/22e25436a300e4443f379d5bec1afc07 to your computer and use it in GitHub Desktop.
Debugging PagarMe TLS update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Método para iniciar sistema e maquininha */ | |
public async Task IniciarPinPad() | |
{ | |
string storagePath = "C:\\Storage\\"; | |
Directory.CreateDirectory(storagePath); | |
// Pega a porta COM associada a maquininha | |
while (pinPadComPort == null) | |
{ | |
await Task.Delay(1000); | |
Console.WriteLine("Searching pinpad"); | |
pinPadComPort = GetPinPadComPort(); | |
} | |
Console.WriteLine("Done searching pinpad"); | |
form.setSystemStatus(form.STATUS_INITIALIZING_PIN_PAD); | |
SerialPort _port = new SerialPort(pinPadComPort, 140000, Parity.None, 8, StopBits.One); | |
Console.WriteLine("Port instance created"); | |
Console.WriteLine(pinPadComPort); | |
_port.Open(); | |
Console.WriteLine("Port opened!"); | |
this._mpos = new Mpos(_port.BaseStream, Constants.getEncryptionKey(), storagePath); | |
/* Evento de Erros */ | |
_mpos.Errored += _mpos_Errored; | |
_mpos.NotificationReceived += (sender, e) => Console.WriteLine("MPOS Notification Received, Status: {0}", e); | |
Console.WriteLine("initializing"); | |
await _mpos.Initialize(); | |
Console.WriteLine("done"); | |
await _mpos.SynchronizeTables(true); | |
_mpos.Display(" LAPAG"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment