![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#11
|
|||
|
|||
|
Bueno, parece que finalmente sí que consigo enviar el XML, recoger la firma para encadenar y generar el QR (al menos para Guipuzcoa)
Lo que no consigo es que dicho QR sea correcto. No sé si porque estoy obtieniendo el CRC mal, o cual es el motivo. (Y tampoco he visto ninguna url que funcione en todo el hilo) Me genera la siguiente cadena: https ://tbai.prep.gipuzkoa.eus/qr/?id=TBAI-B09500307-130521-YiT5C1USVoYiN-002&s=MP&nf=210914&i=5348.20&cr=245 No accede a la factura pero si accedo desde : https ://tbai.prep.gipuzkoa.eus/qr/verificar , ahí si que la encuentra También he probado con: https ://tbai.egoitza.gipuzkoa.eus/qr/verificar ,pero ahí tampoco la encuentra ¿qué diferencia hay entre un subdominio y el otro? La función en VB que utilizo para el cálculo del CRC es: Public Function calculateCRC8(ByVal AppID As String) As String Dim CRC8 As Byte Dim i As Integer Dim j As Integer Dim AppIDarray() As Byte '<--- explicitly dimensioned as a Byte array to avoid confusion Dim aidLength As Integer CRC8 = &HC7 'The AppID is actually bytes stored in hexadecimal in a string. You have to convert them back to bytes before you can run a crc8 on them. AppIDarray = HexToByte(AppID) aidLength = UBound(AppIDarray) For j = 0 To aidLength CRC8 = CRC8 Xor AppIDarray(j) For i = 1 To 8 If CRC8 And &H80 Then 'masking off the left-most bit before shifting prevents the Overflow error. CRC8 = ((&H7F And CRC8) * 2) Xor &H1D Else CRC8 = CRC8 * 2 End If Next i Next j calculateCRC8 = CRC8 End Function Private Function HexToByte(strHex As String) As Byte() Dim i As Integer Dim j As Integer Dim tempByte As Byte Dim outBytes() As Byte Dim Char As String ReDim outBytes(Len(strHex) \ 2 - 1) For i = 0 To Len(strHex) \ 2 - 1 For j = 0 To 1 Char = Mid(strHex, i * 2 + j + 1, 1) Select Case Char Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9": tempByte = tempByte Or (Asc(Char) - 48) Case "A", "B", "C", "D", "E", "F": tempByte = tempByte Or (Asc(Char) - 55) End Select If j = 0 Then tempByte = tempByte * 2 ^ 4 Else outBytes(i) = tempByte tempByte = 0 End If Next Next HexToByte = outBytes End Function |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| SII -Nuevo sistema de la Agencia Tributaria española de envío de datos vía Webservice | newtron | Internet | 3716 | 19-01-2026 20:01:34 |
| Como utilizar la ayuda del nuevo Sistema Operativo | gluglu | Humor | 3 | 24-09-2007 09:39:05 |
| Aplicacion Agencia De Viajes | ArdiIIa | Varios | 9 | 20-01-2007 16:49:53 |
| El Vasco Aguirre | Al González | La Taberna | 5 | 26-05-2006 09:22:28 |
| Microsoft ha lanzado su nuevo sistema operativo | DarkByte | Humor | 0 | 25-01-2004 09:21:14 |
|