zinc-api 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.rubocop.yml +35 -0
- data/.travis.yml +10 -0
- data/Gemfile +14 -0
- data/LICENSE.md +21 -0
- data/README.md +49 -0
- data/Rakefile +3 -0
- data/bin/console +27 -0
- data/lib/zinc.rb +24 -0
- data/lib/zinc/account_status.rb +8 -0
- data/lib/zinc/address.rb +13 -0
- data/lib/zinc/merchant_order_id.rb +12 -0
- data/lib/zinc/model.rb +38 -0
- data/lib/zinc/order.rb +79 -0
- data/lib/zinc/payment_method.rb +10 -0
- data/lib/zinc/price_components.rb +10 -0
- data/lib/zinc/product.rb +12 -0
- data/lib/zinc/resource.rb +53 -0
- data/lib/zinc/retailer_credentials.rb +8 -0
- data/lib/zinc/seller_selection_criteria.rb +7 -0
- data/lib/zinc/shipping.rb +7 -0
- data/lib/zinc/tracking.rb +10 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/zinc/order_spec.rb +64 -0
- data/zinc.gemspec +27 -0
- metadata +89 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 17e2df35b414b9cd6d7e9020b3540638d208acdd
|
4
|
+
data.tar.gz: 731065cd9ed01a6435b027cf8cd705e444a795fc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d8b3808422e089a9ddb4213904cd11e079b887adee93eec6a7aa5ee357e4a820ac8672a77d585174fabb53284b360d0f841e21c0493824ed64f986979bc0ef30
|
7
|
+
data.tar.gz: 4b0ab1ab71c019dbe530588436a86e87c0e8840e751c3aa413be3b07dde6d84dd2323359396620f6eab15457056be0bdd0d8a296378e7dff680e3eedfb4def8d
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.2
|
3
|
+
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Enabled: false
|
6
|
+
Metrics/CyclomaticComplexity:
|
7
|
+
Enabled: false
|
8
|
+
Metrics/PerceivedComplexity:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Metrics/LineLength:
|
12
|
+
Enabled: false
|
13
|
+
Metrics/ClassLength:
|
14
|
+
Enabled: false
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Enabled: false
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Enabled: false
|
19
|
+
Metrics/ParameterLists:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Lint/EndAlignment:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Layout/IndentationWidth:
|
26
|
+
Enabled: false
|
27
|
+
Layout/ElseAlignment:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Style/Documentation:
|
31
|
+
Enabled: false
|
32
|
+
Style/GuardClause:
|
33
|
+
Enabled: false
|
34
|
+
Style/NumericLiterals:
|
35
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Tophatter
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
### Zinc API
|
2
|
+
Full documentation is available [here](https://docs.zincapi.com/).
|
3
|
+
|
4
|
+
### Installation
|
5
|
+
```ruby
|
6
|
+
gem 'zinc-api'
|
7
|
+
```
|
8
|
+
|
9
|
+
### Usage
|
10
|
+
```ruby
|
11
|
+
Zinc::Order.create(
|
12
|
+
retailer: 'amazon',
|
13
|
+
retailer_credentials: Zinc::RetailerCredentials.new(
|
14
|
+
'email' => 'foo@bar.com',
|
15
|
+
'password' => 'jabberwocky'
|
16
|
+
),
|
17
|
+
products: [Zinc::Product.new('product_id' => 'B06XGHJ5H3', 'quantity' => 1)],
|
18
|
+
payment_method: Zinc::PaymentMethod.new(
|
19
|
+
'name_on_card' => 'Foo Bar',
|
20
|
+
'number' => '4242424242424242',
|
21
|
+
'security_code' => '123',
|
22
|
+
'expiration_month' => 1,
|
23
|
+
'expiration_year' => 2020
|
24
|
+
),
|
25
|
+
billing_address: Zinc::Address.new(
|
26
|
+
'first_name' => 'Jane',
|
27
|
+
'last_name' => 'Doe',
|
28
|
+
'address_line1' => '185 Berry St',
|
29
|
+
'address_line2' => 'Suite 2400 ',
|
30
|
+
'zip_code' => '94107',
|
31
|
+
'city' => 'San Francisco',
|
32
|
+
'state' => 'CA',
|
33
|
+
'country' => 'US',
|
34
|
+
'phone_number' => '1231231234'
|
35
|
+
),
|
36
|
+
shipping_address: Zinc::Address.new(
|
37
|
+
'first_name' => 'Jane',
|
38
|
+
'last_name' => 'Doe',
|
39
|
+
'address_line1' => '185 Berry St',
|
40
|
+
'address_line2' => 'Suite 2400 ',
|
41
|
+
'zip_code' => '94107',
|
42
|
+
'city' => 'San Francisco',
|
43
|
+
'state' => 'CA',
|
44
|
+
'country' => 'US',
|
45
|
+
'phone_number' => '1231231234'
|
46
|
+
),
|
47
|
+
shipping: Zinc::Shipping.new('order_by' => 'price', 'max_days' => 5, 'max_price' => 1000)
|
48
|
+
)
|
49
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'rest-client'
|
5
|
+
require 'zinc'
|
6
|
+
|
7
|
+
begin
|
8
|
+
Zinc.api_path = File.read('.api_path').chomp
|
9
|
+
puts "Zinc.api_path: #{Zinc.api_path}"
|
10
|
+
rescue Errno::ENOENT
|
11
|
+
puts "No .api_path file, using default: #{Zinc.api_path}"
|
12
|
+
end
|
13
|
+
|
14
|
+
begin
|
15
|
+
Zinc.access_token = File.read('.access_token').chomp
|
16
|
+
puts "Zinc.access_token: #{Zinc.access_token}"
|
17
|
+
rescue Errno::ENOENT
|
18
|
+
puts "No .access_token file - you'll have to set Zinc.access_token manually from the console."
|
19
|
+
end
|
20
|
+
|
21
|
+
Zinc.logger.level = Logger::DEBUG
|
22
|
+
|
23
|
+
require 'awesome_print'
|
24
|
+
require 'pry'
|
25
|
+
|
26
|
+
AwesomePrint.pry!
|
27
|
+
Pry.start
|
data/lib/zinc.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Zinc
|
4
|
+
class << self
|
5
|
+
attr_accessor :api_path, :access_token, :logger
|
6
|
+
|
7
|
+
def api_path
|
8
|
+
@api_path || 'https://api.zinc.io/v1'
|
9
|
+
end
|
10
|
+
|
11
|
+
def logger
|
12
|
+
unless defined?(@logger)
|
13
|
+
@logger = Logger.new(STDOUT)
|
14
|
+
@logger.level = Logger::WARN
|
15
|
+
end
|
16
|
+
|
17
|
+
@logger
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
%w(model resource account_status address merchant_order_id order payment_method price_components product retailer_credentials seller_selection_criteria shipping tracking).each do |file|
|
23
|
+
require File.dirname(__FILE__) + "/zinc/#{file}"
|
24
|
+
end
|
data/lib/zinc/address.rb
ADDED
data/lib/zinc/model.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Zinc
|
2
|
+
class Model
|
3
|
+
def initialize(hash, exclude: {})
|
4
|
+
hash.each do |key, value|
|
5
|
+
if exclude.include?(key)
|
6
|
+
next
|
7
|
+
end
|
8
|
+
|
9
|
+
if respond_to?("#{key}=")
|
10
|
+
send("#{key}=", value)
|
11
|
+
else
|
12
|
+
Zinc.logger.warn "Invalid attribute #{key} specified for #{self.class.name}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_hash
|
18
|
+
instance_variables.map do |instance_variable|
|
19
|
+
key = instance_variable_name(instance_variable)
|
20
|
+
value = instance_variable_get(instance_variable)
|
21
|
+
|
22
|
+
if value.is_a?(Array) && value.all? { |element| element.respond_to?(:to_hash) }
|
23
|
+
value = value.map(&:to_hash)
|
24
|
+
elsif value.respond_to?(:to_hash)
|
25
|
+
value = value.to_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
value ? [key, value] : nil
|
29
|
+
end.compact.to_h
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def instance_variable_name(instance_variable)
|
35
|
+
instance_variable.to_s.delete('@')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/zinc/order.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
module Zinc
|
2
|
+
class Order < Resource
|
3
|
+
attr_accessor :request_id,
|
4
|
+
:_type,
|
5
|
+
:code,
|
6
|
+
:message,
|
7
|
+
:status_updates,
|
8
|
+
:error,
|
9
|
+
:price_components, # A Zinc::PriceComponent object.
|
10
|
+
:merchant_order_ids, # Array of Zinc::MerchantOrderId objects.
|
11
|
+
:tracking, # Array of Zinc::Tracking objects.
|
12
|
+
:request, # ?
|
13
|
+
:delivery_dates, # ?
|
14
|
+
:account_status # A Zinc::AccountStatus object.
|
15
|
+
|
16
|
+
def initialize(hash)
|
17
|
+
@request_id = hash['request_id'] if hash['request_id']
|
18
|
+
@_type = hash['_type'] if hash['_type']
|
19
|
+
@code = hash['code'] if hash['code']
|
20
|
+
@message = hash['message'] if hash['message']
|
21
|
+
@status_updates = hash['status_updates'] if hash['status_updates']
|
22
|
+
@error = hash['error'] if hash['error']
|
23
|
+
@price_components = PriceComponents.new(hash['price_components']) if hash['price_components']
|
24
|
+
@merchant_order_ids = hash['merchant_order_ids'].map { |hash| MerchantOrderId.new(hash) } if hash['merchant_order_ids']
|
25
|
+
@tracking = hash['tracking'].map { |hash| Tracking.new(hash) } if hash['tracking']
|
26
|
+
@request = hash['request'] if hash['request']
|
27
|
+
@delivery_dates = hash['delivery_dates'] if hash['delivery_dates']
|
28
|
+
@account_status = AccountStatus.new(hash['account_status']) if hash['account_status']
|
29
|
+
end
|
30
|
+
|
31
|
+
class << self
|
32
|
+
def all(offset: 0, limit: 20)
|
33
|
+
response = get(path: 'orders', params: { offset: offset, limit: limit })
|
34
|
+
response['orders'].map { |hash| Order.new(hash) }
|
35
|
+
end
|
36
|
+
|
37
|
+
def retrieve(request_id)
|
38
|
+
response = get(path: "orders/#{request_id}")
|
39
|
+
Order.new(response)
|
40
|
+
end
|
41
|
+
|
42
|
+
def create(retailer:, retailer_credentials:, products:, payment_method:, billing_address:, shipping_address:, shipping:, options: {})
|
43
|
+
params = {
|
44
|
+
retailer: retailer,
|
45
|
+
retailer_credentials: retailer_credentials.to_hash,
|
46
|
+
products: products.map(&:to_hash),
|
47
|
+
payment_method: payment_method.to_hash,
|
48
|
+
billing_address: billing_address.to_hash,
|
49
|
+
shipping_address: shipping_address.to_hash,
|
50
|
+
shipping: shipping.to_hash
|
51
|
+
}
|
52
|
+
|
53
|
+
# Valid options:
|
54
|
+
# - is_gift
|
55
|
+
# - gift_message
|
56
|
+
# - max_price
|
57
|
+
# - webhooks
|
58
|
+
# - client_notes
|
59
|
+
# - promo_codes
|
60
|
+
# - po_number
|
61
|
+
# - bundled
|
62
|
+
params.merge!(options) unless params.empty?
|
63
|
+
|
64
|
+
response = post(path: 'orders', params: params)
|
65
|
+
Order.new(response)
|
66
|
+
end
|
67
|
+
|
68
|
+
def abort(request_id)
|
69
|
+
response = post(path: "orders/#{request_id}/abort")
|
70
|
+
Order.new(response)
|
71
|
+
end
|
72
|
+
|
73
|
+
def cancel(request_id)
|
74
|
+
response = post(path: "orders/#{request_id}/cancel")
|
75
|
+
Order.new(response)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
data/lib/zinc/product.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Zinc
|
2
|
+
class Product < Model
|
3
|
+
attr_accessor :product_id,
|
4
|
+
:quantity,
|
5
|
+
:seller_selection_criteria
|
6
|
+
|
7
|
+
def initialize(hash)
|
8
|
+
super(hash, exclude: %w(seller_selection_criteria))
|
9
|
+
@seller_selection_criteria = SellerSelectionCriteria.new(hash['seller_selection_criteria']) if hash['seller_selection_criteria']
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Zinc
|
2
|
+
class Resource < Model
|
3
|
+
class << self
|
4
|
+
protected
|
5
|
+
|
6
|
+
def get(path:, params: {})
|
7
|
+
Zinc.logger.debug url(path, params)
|
8
|
+
response = RestClient::Request.new(
|
9
|
+
method: :get,
|
10
|
+
url: url(path, params),
|
11
|
+
user: Zinc.access_token,
|
12
|
+
headers: headers
|
13
|
+
).execute
|
14
|
+
# Zinc.logger.debug response.headers.inspect
|
15
|
+
Zinc.logger.debug response.code
|
16
|
+
Zinc.logger.debug response.body
|
17
|
+
JSON.parse(response.body)
|
18
|
+
end
|
19
|
+
|
20
|
+
def post(path:, params: {})
|
21
|
+
Zinc.logger.debug url(path)
|
22
|
+
Zinc.logger.debug params.to_json
|
23
|
+
response = RestClient::Request.new(
|
24
|
+
method: :post,
|
25
|
+
url: url(path),
|
26
|
+
user: Zinc.access_token,
|
27
|
+
payload: params.to_json,
|
28
|
+
headers: headers
|
29
|
+
).execute
|
30
|
+
# Zinc.logger.debug response.headers.inspect
|
31
|
+
Zinc.logger.debug response.code
|
32
|
+
Zinc.logger.debug response.body
|
33
|
+
JSON.parse(response.body)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def url(path, params = {})
|
39
|
+
url = "#{Zinc.api_path}/#{path}"
|
40
|
+
url += "?#{URI.encode_www_form(params)}" unless params.empty?
|
41
|
+
url
|
42
|
+
end
|
43
|
+
|
44
|
+
def headers
|
45
|
+
{
|
46
|
+
accept: :json,
|
47
|
+
content_type: :json,
|
48
|
+
user_agent: 'Zinc API [Ruby] (https://github.com/tophatter/zinc-api)'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# rspec spec/zinc/order_spec.rb
|
4
|
+
describe Zinc::Order do
|
5
|
+
let(:request_id) { 'abc123'}
|
6
|
+
let(:retailer) { 'amazon' }
|
7
|
+
let(:retailer_credentials) { Zinc::RetailerCredentials.new('email' => 'foo@bar.com', 'password' => 'jabberwocky') }
|
8
|
+
let(:product) { Zinc::Product.new('product_id' => 'B06XGHJ5H3', 'quantity' => 1, 'seller_selection_criteria' => { 'prime' => true, 'handling_days_max' => 6, 'condition_in' => ['New'] }) }
|
9
|
+
let(:payment_method) { Zinc::PaymentMethod.new('name_on_card' => 'Foo Bar', 'number' => '4242424242424242', 'security_code' => '123', 'expiration_month' => 1, 'expiration_year' => 2020) }
|
10
|
+
let(:address) { Zinc::Address.new('first_name' => 'Jane', 'last_name' => 'Doe', 'address_line1' => '185 Berry St', 'address_line2' => 'Suite 2400 ', 'zip_code' => '94107', 'city' => 'San Francisco', 'state' => 'CA', 'country' => 'US', 'phone_number' => '1231231234') }
|
11
|
+
let(:shipping) { Zinc::Shipping.new('order_by' => 'price', 'max_days' => 5, 'max_price' => 1000) }
|
12
|
+
|
13
|
+
let(:create_response) do
|
14
|
+
{
|
15
|
+
'request_id' => request_id
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:retrieve_response) do
|
20
|
+
{
|
21
|
+
'_type' => 'order_response',
|
22
|
+
'price_components' => { 'shipping' => 0, 'subtotal' => 1999, 'tax' => 0, 'total' => 1999 },
|
23
|
+
'merchant_order_ids' => [{ 'merchant_order_id' => '112-1234567-7272727', 'merchant' => 'amazon', 'account' => 'foo@bar.com', 'placed_at' => '2017-07-02T23:51:08.366Z' }],
|
24
|
+
'tracking' => [{ 'product_id' => '0923568964', 'merchant_order_id' => '112-1234567-7272727', 'carrier' => 'Fedex', 'tracking_number' => '9261290100129790891234', 'obtained_at' => '2017-07-03T23:22:48.165Z' }],
|
25
|
+
'request' => {},
|
26
|
+
'account_status' => { 'prime' => true, 'fresh' => false, 'business' => true }
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '.create' do
|
31
|
+
it 'creates a new order' do
|
32
|
+
expect(Zinc::Order).to receive(:post).and_return(create_response)
|
33
|
+
|
34
|
+
order = Zinc::Order.create(
|
35
|
+
retailer: retailer,
|
36
|
+
retailer_credentials: retailer_credentials,
|
37
|
+
products: [product],
|
38
|
+
payment_method: payment_method,
|
39
|
+
billing_address: address,
|
40
|
+
shipping_address: address,
|
41
|
+
shipping: shipping
|
42
|
+
)
|
43
|
+
|
44
|
+
expect(order.request_id).to eq(request_id)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#retrieve' do
|
49
|
+
it 'fetches an existing order' do
|
50
|
+
expect(Zinc::Order).to receive(:get).with(path: "orders/#{request_id}").and_return(retrieve_response)
|
51
|
+
order = Zinc::Order.retrieve(request_id)
|
52
|
+
expect(order.tracking[0].product_id).to eq('0923568964')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#to_hash' do
|
57
|
+
let(:order) { Zinc::Order.new(retrieve_response) }
|
58
|
+
|
59
|
+
it 'serializes the object to a hash' do
|
60
|
+
hash = order.to_hash
|
61
|
+
expect(hash['tracking'][0]['product_id']).to eq('0923568964')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/zinc.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
# To publish the next version:
|
4
|
+
# gem build zinc-api.gemspec
|
5
|
+
# gem push zinc-api-{VERSION}.gem
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'zinc-api'
|
8
|
+
s.version = '0.0.1'
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.licenses = ['MIT']
|
11
|
+
s.authors = ['Chris Estreich']
|
12
|
+
s.email = ['chris@tophatter.com']
|
13
|
+
s.homepage = 'https://github.com/tophatter/zinc-api-ruby'
|
14
|
+
s.summary = 'Ruby bindings for the Zinc API.'
|
15
|
+
s.description = 'Ruby bindings for the Zinc API.'
|
16
|
+
|
17
|
+
s.extra_rdoc_files = ['README.md']
|
18
|
+
|
19
|
+
s.required_ruby_version = '~> 2.0'
|
20
|
+
|
21
|
+
s.add_dependency 'rest-client', '~> 1.6'
|
22
|
+
|
23
|
+
s.files = `git ls-files`.split("\n")
|
24
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
26
|
+
s.require_paths = ['lib']
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zinc-api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Estreich
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
description: Ruby bindings for the Zinc API.
|
28
|
+
email:
|
29
|
+
- chris@tophatter.com
|
30
|
+
executables:
|
31
|
+
- console
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files:
|
34
|
+
- README.md
|
35
|
+
files:
|
36
|
+
- ".coveralls.yml"
|
37
|
+
- ".gitignore"
|
38
|
+
- ".rspec"
|
39
|
+
- ".rubocop.yml"
|
40
|
+
- ".travis.yml"
|
41
|
+
- Gemfile
|
42
|
+
- LICENSE.md
|
43
|
+
- README.md
|
44
|
+
- Rakefile
|
45
|
+
- bin/console
|
46
|
+
- lib/zinc.rb
|
47
|
+
- lib/zinc/account_status.rb
|
48
|
+
- lib/zinc/address.rb
|
49
|
+
- lib/zinc/merchant_order_id.rb
|
50
|
+
- lib/zinc/model.rb
|
51
|
+
- lib/zinc/order.rb
|
52
|
+
- lib/zinc/payment_method.rb
|
53
|
+
- lib/zinc/price_components.rb
|
54
|
+
- lib/zinc/product.rb
|
55
|
+
- lib/zinc/resource.rb
|
56
|
+
- lib/zinc/retailer_credentials.rb
|
57
|
+
- lib/zinc/seller_selection_criteria.rb
|
58
|
+
- lib/zinc/shipping.rb
|
59
|
+
- lib/zinc/tracking.rb
|
60
|
+
- spec/spec_helper.rb
|
61
|
+
- spec/zinc/order_spec.rb
|
62
|
+
- zinc.gemspec
|
63
|
+
homepage: https://github.com/tophatter/zinc-api-ruby
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata: {}
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options: []
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.6.12
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: Ruby bindings for the Zinc API.
|
87
|
+
test_files:
|
88
|
+
- spec/spec_helper.rb
|
89
|
+
- spec/zinc/order_spec.rb
|