I wonder if this code has proper masking in place for logs. The following line is not reassuring:
slog.Info("received message", "message", fmt.Sprintf("%x", rawMessage))``` // to make it right, let's filter the value of CVV field when we output it filterCVV := iso8583.FilterField("8", iso8583.FilterFunc(func(in string, data field.Field) string { if len(in) == 0 { return in } return in[0:1] + strings.Repeat("*", len(in)-1) }))
// don't forget to apply default filter filters := append(iso8583.DefaultFilters(), filterCVV)
err = iso8583.Describe(requestMessage, os.Stdout, filters...) require.NoError(t, err) ```
The post describes how to create a simple version of the client, but if you're interested in the topic, you can find a production-ready, battle-tested Golang package here: https://github.com/moov-io/iso8583-connection.
And to understand how the whole e2e flow works starting from the seller and finishing with issuer authorizeing the transaction, you can check a demo project here: https://github.com/alovak/cardflow-playground