AppdirectIntegration
Integration with AppDirect masrketplace.
Installation
Add this line to your application's Gemfile:
gem 'appdirect_integration'And then execute:
$ bundle
Or install it yourself as:
$ gem install appdirect_integration
Usage
Register with AppDirect (free): https://www.appdirect.com/developers/register
Create an application and and copy your consumer key and consumer secret.
Add appdirect_integration gem to Gemfile
gem 'appdirect_integration'Add Generate your Order scaffold
rails g scaffold OrderSetup Order model to work with AppDirect and generate migrations
rails g appdirect_integration OrderGenerate configuration
rails g appdirect_integration:installwhich will generate config/initializers/appdirect.rb file.
Edit initializer config/initializers/appdirect.rb and specify your consumer key, consumer secret, and Order model there.
gem will automatically create (new) and save your Order ActiveRecord/Mongoid object at runtime.
the list of supported fields:
company_uuidcompany_namecompany_emailcompany_phonecompany_websitecompany_countryuser_uuiduser_open_iduser_emailuser_first_nameuser_last_nameuser_languageuser_address_full_nameuser_address_company_nameuser_address_phoneuser_address_phone_extensionuser_address_faxuser_address_fax_extensionuser_address_street1user_address_street2user_address_cityuser_address_stateuser_address_zipuser_address_countryuser_address_poboxuser_address_pozipstatuseditionmarketplace_urlpricing_durationquantityunitquantity2unit2quantity3unit3all_data-
order_items- should be mentioned ashas_many: order_itemsfor ActiveRecord orembeds_many: order_itemsfor Mongoid
Fields for order_items OrderItem:
unitquantity
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake rspec 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. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/artgo/appdirect_integration.
CHANGELOG
See here.
Documentation
See AppDirect API documentation here.