From 562957efeebf6e27dd134ff76050ecceecbe4fce Mon Sep 17 00:00:00 2001 From: yerkortiz Date: Wed, 12 Apr 2023 13:23:17 -0400 Subject: [PATCH] certification cases --- internal/appconfig/appconfig.go | 2 +- internal/batches/gateway.go | 4 +--- main.go | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/internal/appconfig/appconfig.go b/internal/appconfig/appconfig.go index 2255fbc..c302024 100644 --- a/internal/appconfig/appconfig.go +++ b/internal/appconfig/appconfig.go @@ -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 } diff --git a/internal/batches/gateway.go b/internal/batches/gateway.go index e916c04..135330a 100644 --- a/internal/batches/gateway.go +++ b/internal/batches/gateway.go @@ -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 @@ -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 { diff --git a/main.go b/main.go index 9dad9ef..4f2e452 100644 --- a/main.go +++ b/main.go @@ -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", }, @@ -57,7 +57,7 @@ func GenerateBatches() [][]entities.Batch { Day: "2023-04-10", DocumentType: "48", Channel: "1", // 1 for cnp - Amount: 500, + Amount: 2042, NTransactions: 2, ExternalTrackID: "0", }, @@ -65,16 +65,16 @@ func GenerateBatches() [][]entities.Batch { 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", @@ -89,7 +89,7 @@ func GenerateBatches() [][]entities.Batch { DocumentType: "48", Channel: "1", // 1 for cnp Amount: 0, - NTransactions: 2, + NTransactions: 1, ExternalTrackID: "0", }, { @@ -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", }, })