Skip to content

Simple gem for generating Trustpilot Business Generated Links

License

Notifications You must be signed in to change notification settings

trainline-eu/trustpilot-business-links

Repository files navigation

Trustpilot Business Links generator gem Build Status Gem Version

Generate the Trustpilot Business Generated Links in ruby.

Requirements

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.

Installation

gem install trustpilot-business-links

Usage

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}"

Test

make test

100% of the source code should be covered by tests.

Contributing

You are warmly welcome to contribute to the project!

Documentation

License

The projected is licensed under the MIT license. See LICENSE.md.

About

Simple gem for generating Trustpilot Business Generated Links

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published