Skip to content

Commit

Permalink
certification cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yerkortiz committed Apr 12, 2023
1 parent db2daad commit 562957e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion internal/appconfig/appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func getTaxAuthorityCertificate() (string, error) {
if err != nil {
return "", fmt.Errorf("errCannotReadTaxAuthorityCertificate")
}
fmt.Println(string(file))
//fmt.Println(string(file))

return string(file), nil
}
4 changes: 1 addition & 3 deletions internal/batches/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ func (g *Gateway) GetToken(ctx context.Context, seed string) (string, error) {
return "", errClientCallFailed
}

fmt.Printf("%s \n", tokenRespString)

getTokenResponse := xmlschema.GetTokenResponse{}
if err = xml.Unmarshal(tokenRespString, &getTokenResponse); err != nil {
return "", errCantUnmarshalResponse
Expand All @@ -178,7 +176,7 @@ func (g *Gateway) SendMany(ctx context.Context, token string, batchesMatrix [][]
var req xmlschema.SendTransactionsBody

req.Fill(transactions)
fmt.Println(token)

res, rAsString, err := g.SendTransactions(ctx, token, req)
fmt.Println(rAsString)
if err != nil {
Expand Down
24 changes: 12 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func main() {
}

func GenerateBatches() [][]entities.Batch {
batchesMatrix := make([][]entities.Batch, 10)
batchesMatrix := make([][]entities.Batch, 0)
// document 48 with amount distinct to zero
batchesMatrix = append(batchesMatrix, []entities.Batch{
{
VatID: "96965568-3", // valid rut
Day: "2023-04-10",
Day: "2023-04-12",
DocumentType: "48",
Channel: "1", // 1 for cnp
Amount: 500,
Amount: 10000,
NTransactions: 2,
ExternalTrackID: "0",
},
Expand All @@ -57,24 +57,24 @@ func GenerateBatches() [][]entities.Batch {
Day: "2023-04-10",
DocumentType: "48",
Channel: "1", // 1 for cnp
Amount: 500,
Amount: 2042,
NTransactions: 2,
ExternalTrackID: "0",
},
{
VatID: "65537690-9", // valid rut
Day: "2023-04-10",
DocumentType: "48",
Channel: "0", // 1 for cnp
Amount: 500,
NTransactions: 2,
Channel: "1", // 1 for cnp
Amount: 40202,
NTransactions: 10,
ExternalTrackID: "0",
},
{
VatID: "39020493-0", // valid rut
Day: "2023-04-10",
DocumentType: "48",
Channel: "0", // 1 for cnp
Channel: "1", // 1 for cnp
Amount: 500,
NTransactions: 2,
ExternalTrackID: "0",
Expand All @@ -89,7 +89,7 @@ func GenerateBatches() [][]entities.Batch {
DocumentType: "48",
Channel: "1", // 1 for cnp
Amount: 0,
NTransactions: 2,
NTransactions: 1,
ExternalTrackID: "0",
},
{
Expand All @@ -98,16 +98,16 @@ func GenerateBatches() [][]entities.Batch {
DocumentType: "48",
Channel: "1", // 1 for cnp
Amount: 0,
NTransactions: 2,
NTransactions: 1,
ExternalTrackID: "0",
},
{
VatID: "85445473-0", // valid rut
Day: "2023-04-10",
DocumentType: "48",
Channel: "0", // 1 for cnp
Channel: "1", // 1 for cnp
Amount: 0,
NTransactions: 2,
NTransactions: 1,
ExternalTrackID: "0",
},
})
Expand Down

0 comments on commit 562957e

Please sign in to comment.