Ruby bindings for the sigma controller+ API. Currently only suppots the "product availability" and "zip code lookup" trasaction sets.
Product Availabilty
The product lookup transaction will return an array of objects, each representing a prodcut, from sigma. The information for each product is accessible through instance methods on each product object according to the response fields in the documentation for the product availability transaction set provided by fifth gear.
t = Sigma::Api.new(Sigma::ProductAvailability.new(:product_number => "57337", :response_type => 'D'))
t.products # => [product]
t.products[0].product_number # => 57337
t.products[0].price # => 3999
...
...
You can load more information from sigma using the same Api object by simply setting the transaction explicitly.
t.transaction = Sigma::ProductAvailability.new(:product_number => [57337, 36774, 50093, 93939], :response_type => "M")
t.products # => [product, product, product, product]
You can also change the trasaction type all together.
t.transaction = Sigma::ZipCodeLookup.new(:zip_code => "56007")
t.zip_codes # => [zip, zip, ..., ...]
Zip Code Lookup
The zip code lookup transaction will return an array of zip codes from sigma. The only information available for each zip code returned is the city and state which are callable as instance methods on each zip code object returned.
t = Sigma::Api.new(Sigma::ZipCodeLookup.new(:zip_code => "56007"))
t.zip_codes # => [zip, zip, ..., ...]
t.zip_codes[0].city # => "ALBERT LEA"
t.zip_codes[0].state # => "MN"
Customer Authentication
The customer authentication lookup transaction will attempt to authenticate a customer in sigma and will return the results of the attempted authentication. There are several feilds which are required to attempt a customer authentication request. The example below contains all of the fields that are required.
t = Sigma::Api.new(Sigma::CustomerAuthentication.new( :first_name => "Justin",
:last_name => "McGinnis",
:street_name => "Century",
:street_number => 8085,
:email_address => "justin.mcginnis@gmail.com",
:city => "Chaska" ))
t.customer # => ["15A", "9244216892", "000", "9", "001234567", "1", "", "", "N", "", "<EOT>"]
t.customer.customer_number # => "001234567"
t.customer.authentication_status # => "9"