github.com/mundipagg/boleto-api@v0.0.0-20230620145841-3f9ec742599f/itau/response.go (about)

     1  package itau
     2  
     3  const registerBoletoResponseItau = `{
     4      {{if (hasErrorTags . "errorCode") | (hasErrorTags . "errorMessage")}}
     5          "Errors": [
     6              {                    
     7                  "Code": "{{trim .errorCode}}",
     8                  "Message": "{{trim .errorMessage}}"
     9              }
    10          ]
    11      {{else}}
    12          "DigitableLine": "{{fmtDigitableLine (trim .digitableLine)}}",
    13          "BarCodeNumber": "{{trim .barcodeNumber}}"
    14      {{end}}
    15  }
    16  `
    17  
    18  const boletoResponseItau = `
    19  {		
    20  	"codigo_barras": "{{barcodeNumber}}",
    21  	"numero_linha_digitavel": "{{digitableLine}}"	
    22  }
    23  `
    24  
    25  const boletoResponseErrorItau = `
    26  {
    27      "codigo":"{{errorCode}}",
    28      "mensagem":"{{errorMessage}}"	
    29  }
    30  `
    31  
    32  func getResponseItau() string {
    33  	return boletoResponseItau
    34  }
    35  
    36  func getAPIResponseItau() string {
    37  	return registerBoletoResponseItau
    38  }
    39  
    40  func getResponseErrorItau() string {
    41  	return boletoResponseErrorItau
    42  }