Skip to content

Ruby gem to access Händlerbund's API for legal documents for online shopping

License

Notifications You must be signed in to change notification settings

leobossmann/haendlerbund_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Händlerbund API

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.

Installation

Add this line to your application's Gemfile:

gem 'haendlerbund_api', :git => 'git://github.com/leobossmann/haendlerbund_api'

And then execute:

$ bundle

Usage

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)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

Ruby gem to access Händlerbund's API for legal documents for online shopping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages