xdelivery 0.2.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d92f2aaad01c0ebc7a226cbb22fc08b52d74c697
4
- data.tar.gz: 070694f59a56765b20971805470f712704b74ded
3
+ metadata.gz: 32e729a05b87441921a17b67e77554b16d1115b0
4
+ data.tar.gz: 9a1734fc97bb1424e72cbf0b637d2ca2996cb592
5
5
  SHA512:
6
- metadata.gz: dfa8a207525114da3d26f2268be95bbf4023ab3330cdeb796ec5518e2f4612844f5b76d82b1792531c170d9145f61445f8096165f19c3f0965e29f92c0ee6ee1
7
- data.tar.gz: 0735a33a6509d8f53993287b667b6dd6da1dbb702813c54a3657cb4a760406cc412e3e53db43b89da3c31afba76c5521d9f36c0e096479fe8d92e04fe8157c7f
6
+ metadata.gz: f66bfcdad33a55d88e597c722995ad7611a5efea9af5dadcc17c1fcbebecb374b2c203f4c7446aba88bf390efb6364296e6347d0e4f1f27a053fb7a6244bb0a3
7
+ data.tar.gz: 8819f364dfa29f97ca66f4e44cc7cc0e76f71848b97a77d25e54ff3e0cde36a17701c9fda6182fd59ac28ecb5f948da25dda4267fdd7a607b91ab70e0778e435
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xdelivery (0.2.3)
4
+ xdelivery (1.0.0)
5
5
  rest-client
6
6
 
7
7
  GEM
data/lib/xdelivery.rb CHANGED
@@ -8,12 +8,12 @@ require "xdelivery/api/orders"
8
8
  require "xdelivery/api/sales"
9
9
  require "xdelivery/api/products"
10
10
  require "xdelivery/api/ping"
11
- require "xdelivery/api/invoice_settings"
11
+ require "xdelivery/api/shops"
12
12
  require "xdelivery/api/response/base"
13
13
  require "xdelivery/api/response/orders"
14
14
  require "xdelivery/api/response/products"
15
15
  require "xdelivery/api/response/ping"
16
- require "xdelivery/api/response/invoice_settings"
16
+ require "xdelivery/api/response/shops"
17
17
 
18
18
 
19
19
  module Xdelivery
@@ -8,11 +8,11 @@ module Xdelivery
8
8
  COLUMNS = [
9
9
  :order_id, :provider, :recipient, :mobile, :email, :store_id, :store_name, :address,
10
10
  :items, :warehouse_items, :total_order_amount, :cash_on_delivery, :order_created_at,
11
- :note, :callback_url, :ref_id, :tag, :merchant_note
11
+ :note, :callback_url, :ref_id, :tag, :merchant_note, :shop_id
12
12
  ]
13
13
 
14
14
  INVOICE_COLUMNS = [
15
- :create_type, :email, :company_code, :company_title, :donate_code, :device_id, :device, :items, :invoice_setting_id
15
+ :create_type, :email, :company_code, :company_title, :donate_code, :device_id, :device, :items
16
16
  ]
17
17
 
18
18
  def add(params, invoice_params={})
@@ -0,0 +1,20 @@
1
+ module Xdelivery
2
+ module API
3
+ module Response
4
+ class Shops < Base
5
+
6
+ Shop = Struct.new(:id, :title, :pay2go_merchant_id, :default_shop)
7
+
8
+ def status?
9
+ auth?
10
+ end
11
+
12
+ def shops
13
+ data.map do |setting|
14
+ Shop.new(setting['id'], setting['title'], setting['pay2go_merchant_id'], setting['default_shop'])
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -8,11 +8,11 @@ module Xdelivery
8
8
  COLUMNS = [
9
9
  :order_id, :recipient, :mobile, :email, :address,
10
10
  :items, :warehouse_items, :total_order_amount, :cash_on_delivery, :order_created_at,
11
- :note, :callback_url, :ref_id, :tag, :tracking_code, :merchant_note
11
+ :note, :callback_url, :ref_id, :tag, :tracking_code, :merchant_note, :shop_id
12
12
  ]
13
13
 
14
14
  INVOICE_COLUMNS = [
15
- :create_type, :email, :company_code, :company_title, :donate_code, :device_id, :device, :items, :invoice_setting_id
15
+ :create_type, :email, :company_code, :company_title, :donate_code, :device_id, :device, :items
16
16
  ]
17
17
 
18
18
  def add(params, invoice_params={})
@@ -0,0 +1,9 @@
1
+ module Xdelivery
2
+ module API
3
+ class Shops < Base
4
+ def get!
5
+ Response::Shops.new(get('/shops.json'))
6
+ end
7
+ end
8
+ end
9
+ end
@@ -26,8 +26,8 @@ module Xdelivery
26
26
  api.update!
27
27
  end
28
28
 
29
- def get_invoice_settings!
30
- API::InvoiceSettings.new(merchant_no, access_key).get!
29
+ def get_shops!
30
+ API::Shops.new(merchant_no, access_key).get!
31
31
  end
32
32
 
33
33
  def ping!
@@ -1,3 +1,3 @@
1
1
  module Xdelivery
2
- VERSION = "0.2.4"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xdelivery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - eddie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-31 00:00:00.000000000 Z
11
+ date: 2019-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,16 +98,16 @@ files:
98
98
  - bin/setup
99
99
  - lib/xdelivery.rb
100
100
  - lib/xdelivery/api/base.rb
101
- - lib/xdelivery/api/invoice_settings.rb
102
101
  - lib/xdelivery/api/orders.rb
103
102
  - lib/xdelivery/api/ping.rb
104
103
  - lib/xdelivery/api/products.rb
105
104
  - lib/xdelivery/api/response/base.rb
106
- - lib/xdelivery/api/response/invoice_settings.rb
107
105
  - lib/xdelivery/api/response/orders.rb
108
106
  - lib/xdelivery/api/response/ping.rb
109
107
  - lib/xdelivery/api/response/products.rb
108
+ - lib/xdelivery/api/response/shops.rb
110
109
  - lib/xdelivery/api/sales.rb
110
+ - lib/xdelivery/api/shops.rb
111
111
  - lib/xdelivery/callback.rb
112
112
  - lib/xdelivery/client.rb
113
113
  - lib/xdelivery/version.rb
@@ -1,9 +0,0 @@
1
- module Xdelivery
2
- module API
3
- class InvoiceSettings < Base
4
- def get!
5
- Response::InvoiceSettings.new(get('/invoice_settings.json'))
6
- end
7
- end
8
- end
9
- end
@@ -1,20 +0,0 @@
1
- module Xdelivery
2
- module API
3
- module Response
4
- class InvoiceSettings < Base
5
-
6
- Setting = Struct.new(:id, :title, :pay2go_merchant_id, :default_setting)
7
-
8
- def status?
9
- auth?
10
- end
11
-
12
- def settings
13
- data.map do |setting|
14
- Setting.new(setting['id'], setting['title'], setting['pay2go_merchant_id'], setting['default_setting'])
15
- end
16
- end
17
- end
18
- end
19
- end
20
- end