BuildStatus Code Climate

FastshopCatalog

Integrates with Fastshop's catalog webservices.

Installation

Add this line to your application's Gemfile:

gem 'fastshop_catalog'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fastshop_catalog

Testing

The project was tested with ruby 1.9.3 and 2.0.0-p247.

Just run:

rake

To skip integration tests, pass an environment variable as follows:

integration=false rake

Usage

Global parameters

FastshopCatalog::BaseService.log_level, defaults to ':info'. You can change it to :debug, for example:

FastshopCatalog::BaseService.log_level = :debug

FastshopCatalog::BaseService.base_url, defaults to FastshopCatalog::BaseService::DEFAULT_BASE_URL. To change it:

FastshopCatalog::BaseService.base_url = 'http://your_server_here'

FastshopCatalog::BaseService.crypto_key which is described on its own section, under password generation.

Password generation for encrypted services

Outside the gem, there is the PasswordUtil class, which depends on the proprietary library chilkat, specifically the crypto modules. This is the only way to generate a .NET compatible PBKDF1 key. The default result from PasswordUtil.derive_fastshop_default is already configured. If you need to change your password, follow these steps:

1) Download this gem source code 2) Install the chilkat gem (instructions here http://www.example-code.com/ruby/default.asp) 3) Invoke this method on the console, given that you're already on the project source directory:

$irb
> PasswordUtil.derive_fastshop_default('your new password', 'your salt')
=> YOUR_NEW_KEY

And then you can set the new default with:

FastshopCatalog::BaseService.crypto_key = 'YOUR_KEY'

Notice that you might have to purchase a chilkat license if the trial does not work anymore. If you have a license you can invoke irb like this:

$ chilkat_license='your_license' irb