Project

trustvox

0.0
No commit activity in last 3 years
No release in over 3 years
This gem is used to acess the Trustvox api, create stores, send orders and etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
>= 0
~> 1.8.7
~> 10.0
~> 3.7

Runtime

~> 0.14
 Project Readme

Trustvox

Gem to send interact with Trustvox API.

Installation

gem 'trustvox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install trustvox

Usage

Set your credentials

Trustvox::Config.token = 'PLATFORM TOKEN'
Trustvox::Config.store_token = 'STORE TOKEN'
Trustvox::Config.store_id = 'STORE ID'

Or with ENV vars

TRUSTVOX_ACCESS_TOKEN='PLATFORM TOKEN'
TRUSTVOX_STORE_TOKEN='STORE TOKEN'
TRUSTVOX_STORE_ID='STORE ID'

Push order information.

order = Trustvox::Store.new.push_order({
                    order_id: 1,
                    delivery_date: DateTime.now.to_s,
                    client:  {
                      first_name: 'Homer',
                      last_name: 'Simpson',
                      email: 'homer@fox.com',
                    },
                    items: [{
                      id: 1,
                      url: 'http://www.fox.com/donut',
                      name: 'Donut',
                      price: 2.99,
                      photos_urls: ["http://store.fox.com/donut.png"],
                    }]
                  })

order.inspect

{:status=>201, :data=>{"tags"=>[], "order_id"=>1, "client"=>{"tags"=>[], "first_name"=>"Homer", "last_name"=>"Simpson", "email"=>"homer@fox.com"}, "delivery_date"=>"2018-04-03", "items"=>[{"id"=>"1", "name"=>"Donut", "url"=>"http://www.fox.com/donut", "price"=>"2.99", "tags"=>[]}]}}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/brunofrank/trustvox.

License

The gem is available as open source under the terms of the MIT License.