Generate the Trustpilot Business Generated Links in ruby.
Ruby 2.1.0 or newer.
This gem is tested against supported versions of Ruby and no support will be provided for EOL Ruby releases.
gem install trustpilot-business-links
require 'json'
require 'trustpilot-business-links'
# Keys generated on https://businessapp.b2b.trustpilot.com/#/invitations/business-generated-links
encryption_key = 'gn96sJwFRQuQl3bjNIPM0xp+TnK4iBaW0I4DpR0o+cs='
authentication_key = 'eE4zdEfGNlxjGVjtWpOLAYAM0gKeF5j6Db7ZXd1Bixo='
trustpilot_bgl = TrustpilotBusinessLinks.new(encryption_key, authentication_key)
review_payload = {
email: "[email protected]",
name: "John Smith",
ref: "1234",
}
encrypted_payload = trustpilot_bgl.encrypt(review_payload.to_json)
puts "https://www.trustpilot.com/evaluate-bgl/www.example.com?p=#{encrypted_payload}"
make test
100% of the source code should be covered by tests.
You are warmly welcome to contribute to the project!
The projected is licensed under the MIT license. See LICENSE.md.