A Ruby client to access PromoStandards data from suppliers.
Currently, only interfaces some of the Product Data and the Media Content services.
- Add tests
- Return
nil
when primary image is not available - Provide interfaces to other services as well
Add this line to your application's Gemfile:
gem 'promostandards-client', git: 'https://github.com/promohunt/promostandards-client'
And then execute:
$ bundle
require 'promostandards/client.rb'
client = PromoStandards::Client.new(
access_id: 'YOUR ID'
password: 'YOUR PASSWORD'
product_data_service_url: 'https://services.starline.com/CustomerProductDataService/CustomerProductDataService.svc'
media_content_service_url: 'https://services.starline.com/MediaContentService/MediaContentService.svc'
product_pricing_and_configuration_service_url: 'https://services.starline.com/ppc/PricingAndConfiguration.svc'
)
# Get sellable product ids
product_ids = client.get_sellable_product_ids
# Get product data
product_hash = client.get_product_data('product_id')
# Get primary product image
primary_image = client.get_primary_image('product_id')
- Add credentials and service URLs to a
ps_configs.yml
(Seeps_configs.yml.example
) - Run
bundle exec ruby test_ps_services.rb
This would use the data in the YAML file, make sample requests to all the supplier services and log outcomes. This is useful to test out the services end to end.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/promohunt/promostandards-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the promostandards-client
project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
promostandards-client is maintained and funded by PromoHunt, inc. The names and logos for PromoHunt are trademarks of PromoHunt, inc.
PromoHunt is a browser extension that helps promotional products distributors & suppliers save time and money.