This gem provides a simpe method to access Händlerbund's API for (German) legal documents for online shopping use. You will need to sign up for an account with them and ask them for an access token.
Add this line to your application's Gemfile:
gem 'haendlerbund_api', :git => 'git://github.com/leobossmann/haendlerbund_api'
And then execute:
$ bundle
initalize the API client with your access token:
require 'haendlerbund_api'
@client = HaendlerbundApi::LegalDocuments.new('access_token')
Then you can access the legal documents for your store:
@client.terms_and_conditions.body
The response of the client contains the full HTTP response, so you can check the status code:
@client.imprint.response.code
The following document types are available:
- terms_and_conditions (Allgemeine Geschäftsbedingungen)
- cancellation_policy (Widerrufsbelehrung)
- payment_and_delivery_terms (Bedingungen für Zahlung und Versand)
- privacy_policy (Datenschutzerklärung)
- imprint (Impressunm)
- battery_information (Batteriehinweise)
Optionally you can specify an output style:
@client.terms_and_conditions :mode => :plain
The following document modes are available:
- default (HTML with inline styling)
- classes (HTML with CSS classes)
- classes_head (HTML with CSS classes and CSS Snippet in header)
- plain (plain text)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request