private static void CancelarPFX() { byte[] pfx = File.ReadAllBytes(Path.Combine(@"Resources\CertificadosDePrueba", "CSD_Prueba_CFDI_LAN8507268IA.pfx")); string pfxB64 = Convert.ToBase64String(pfx); string uuid = "01724196-ac5a-4735-b621-e3b42bcbb459"; string rfc = "LAN8507268IA"; string passwordKey = "12345678a"; Cancelation cancelation = new Cancelation(_url, _user, _password); CancelationResponse response = (CancelationResponse)cancelation.CancelarByPFX(pfxB64, rfc, passwordKey, uuid); if (response.status == "success" && response.Data != null) { //Acuse de cancelación Console.WriteLine(response.Data.Acuse); //Estatus por UUID foreach (var folio in response.Data.uuid) { Console.WriteLine("UUID: {0} Estatus: {1}", folio.Key, folio.Value); } } else { Console.WriteLine("Error al Cancelar\n\n"); Console.WriteLine(response.message); Console.WriteLine(response.messageDetail); } }
public void CancelationByPFX() { var build = new BuildSettings(); Cancelation cancelation = new Cancelation(build.Url, build.User, build.Password); CancelationResponse response = cancelation.CancelarByPFX(build.Pfx, build.Rfc, build.CerPassword, uuid); Assert.IsTrue(response.data.acuse != null && response.status == "success"); }