Go implementation for Trustpilot Business Generated Links:
Import
import "github.com/mcmakler/trustpilot-authenticated-encryption/trustpilotLinkGen"
Creating of TrustpilotLinkGenerator interface exemplar:
tLG, err := trustpilotLinkGen.NewTrustpilotLinkGenerator(
encriptionKey, //your base64 encoded encryption key
authenticationKey, //your base64 encoded description key
domain) //your domain
Creating of payload:
trustpilotData := &trustpilotLinkGen.TrustpilotUserData{
Email: "test@email.example",
Name: "Name Lastname",
Ref: "Reference Number",
Skus: []string{"Sku1", "Sku2"}, //Can be omitted
Tags: []string{"Tag1", "Tag2"}, //Can be omitted
}
Generating of a link:
link, err := tLG.GenerateBusinessLink(trustpilotData)