xdelivery 0.1.6 → 0.2.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: 1b405f05280d2cf6721ad68a40d700f3edd9b1e7
4
- data.tar.gz: 3b3dc72ac3dd52153812c3c353ff71f0758b47d8
3
+ metadata.gz: f7505c61730226f3cdf2b83f081d87f5229aee96
4
+ data.tar.gz: 1a7436d6092059754d66ec08eebc213af68f7e5b
5
5
  SHA512:
6
- metadata.gz: c583360fe17f9fd8054a5bb36d65ae986b7a578bf8d571160972a64061ce363db69b93d987172baf83b877da57c93e928ee212d3f24840b1a5ff03caaff7177f
7
- data.tar.gz: b72285e22a05fb59033229f543fbdeb3a75816f18586edf022b19d89ac4f72b330d5f64f4f65959399b85906fabb30b84f169754089cdbfa9df3d4b2407f9e68
6
+ metadata.gz: 0426f6199d154c21de0099785d25268d30bf96f49ffb3d19a7f7b341a0845cbf27a371717e866c8f0648fd7ff30a43ff6aba0337e009a90a4344fec54dd62347
7
+ data.tar.gz: 770aad3849dcf3e67aa5fc59b8c9a51a18ee8cb1072ef7ebf88c83b28388201cb9341d9a901754988dd6d0a4ed934eafdc896d546cd613e446ca939ea625b541
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xdelivery (0.1.5)
4
+ xdelivery (0.1.6)
5
5
  rest-client
6
6
 
7
7
  GEM
data/lib/xdelivery.rb CHANGED
@@ -7,10 +7,12 @@ require "xdelivery/api/orders"
7
7
  require "xdelivery/api/sales"
8
8
  require "xdelivery/api/products"
9
9
  require "xdelivery/api/ping"
10
+ require "xdelivery/api/invoice_settings"
10
11
  require "xdelivery/api/response/base"
11
12
  require "xdelivery/api/response/orders"
12
13
  require "xdelivery/api/response/products"
13
14
  require "xdelivery/api/response/ping"
15
+ require "xdelivery/api/response/invoice_settings"
14
16
 
15
17
 
16
18
  module Xdelivery
@@ -0,0 +1,9 @@
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
@@ -12,7 +12,7 @@ module Xdelivery
12
12
  ]
13
13
 
14
14
  INVOICE_COLUMNS = [
15
- :create_type, :email, :company_code, :donate_code, :device_id, :device, :items
15
+ :create_type, :email, :company_code, :donate_code, :device_id, :device, :items, :invoice_setting_id
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 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
@@ -26,6 +26,10 @@ 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!
31
+ end
32
+
29
33
  def ping!
30
34
  api = API::Ping.new(merchant_no, access_key)
31
35
  api.ping!
@@ -1,3 +1,3 @@
1
1
  module Xdelivery
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.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.1.6
4
+ version: 0.2.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-06-21 00:00:00.000000000 Z
11
+ date: 2019-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,10 +98,12 @@ files:
98
98
  - bin/setup
99
99
  - lib/xdelivery.rb
100
100
  - lib/xdelivery/api/base.rb
101
+ - lib/xdelivery/api/invoice_settings.rb
101
102
  - lib/xdelivery/api/orders.rb
102
103
  - lib/xdelivery/api/ping.rb
103
104
  - lib/xdelivery/api/products.rb
104
105
  - lib/xdelivery/api/response/base.rb
106
+ - lib/xdelivery/api/response/invoice_settings.rb
105
107
  - lib/xdelivery/api/response/orders.rb
106
108
  - lib/xdelivery/api/response/ping.rb
107
109
  - lib/xdelivery/api/response/products.rb