desertcart 1.0.0 → 1.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96786e0639aedbd1ea6b5385a9e8365233c130e03d42e5a71c0c9f36e5cf788f
4
- data.tar.gz: 33e199b3fd1ddc4ec40727165de105473a995bb6c6c97a45e11daf3dd2bfe41c
3
+ metadata.gz: 922d201ef27df956f41a02feaaccca3fff4ce8c490ac7e3011da1714f0a8e8c2
4
+ data.tar.gz: aaf81ab26675c020442deed5de7dfb308e1f928279d4869a2995c4081cc851ad
5
5
  SHA512:
6
- metadata.gz: 7982f5aa663b627b53c3b69c9e1f391bd397ed65f15b001929bd277cbc34ca28d69faef378eaa34a8e355344384d2ee06be1e71253793dfd48734b64fbacffb5
7
- data.tar.gz: aef6ebc66f95aacae392da90c7e180f5c550344fae01f32684131733a201e6b5345332308f16003dde81fcf6217ed543af321aa56aa5e5609288ccd4adba221e
6
+ metadata.gz: 2e43364dd0012f3e2d3f7e92db686ee7a8d2131eb97b919b896bffd1df2e45df039e0a1a4fcc3622b51d37dcdc6062150c99804ca812b3c2910e0b6a60a92b57
7
+ data.tar.gz: c0871c79a3cc8d60c7461399e5077270475a1e82f24328841a54cc847a48f21ee1674732304a113d818e4aa339d7bb79ef09c2dea2d1133740209663dabb5d2d
@@ -0,0 +1,36 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [master]
13
+ pull_request:
14
+ branches: [master]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby-version: ["2.7", "3.0"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby
26
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
+ # uses: ruby/setup-ruby@v1
29
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
30
+ with:
31
+ ruby-version: ${{ matrix.ruby-version }}
32
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
+ - name: Rspec
34
+ run: bundle exec rspec
35
+ - name: Rubocop
36
+ run: bundle exec rubocop
data/.rubocop.yml ADDED
@@ -0,0 +1,25 @@
1
+ inherit_mode:
2
+ merge:
3
+ - Exclude
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.7
7
+ Exclude:
8
+ - "Gemfile"
9
+ - "Rakefile"
10
+ - "bin/**/*"
11
+ - "spec/**/*"
12
+
13
+ Style/StringLiterals:
14
+ Enabled: true
15
+ EnforcedStyle: single_quotes
16
+
17
+ Style/StringLiteralsInInterpolation:
18
+ Enabled: true
19
+ EnforcedStyle: single_quotes
20
+
21
+ Layout/LineLength:
22
+ Max: 100
23
+
24
+ Style/Documentation:
25
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.7.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.1.2] - 2021-11-22
4
+
5
+ - Fix: Add final purchase details to OrderItemAcceptance resource
6
+
7
+ ## [1.1.2] - 2021-11-22
8
+
9
+ - Feature: Add final purchase details to OrderItemAcceptance
10
+
11
+ ## [1.1.0] - 2021-09-26
12
+
13
+ - Feature: Support Ruby 2.7 and newer
14
+ - Feature: Expose `Marketplace::Movement::Operations::Update` operation to update `estimated_arrival_at`
15
+
3
16
  ## [1.0.0] - 2021-09-01
4
17
 
5
18
  - Initial release of first stable version.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- desertcart (1.0.0)
4
+ desertcart (1.1.3)
5
5
  ledger_sync (~> 2.2.0)
6
6
 
7
7
  GEM
@@ -15,15 +15,17 @@ GEM
15
15
  minitest (>= 5.1)
16
16
  tzinfo (~> 2.0)
17
17
  zeitwerk (~> 2.3)
18
+ ast (2.4.2)
18
19
  colorize (0.8.1)
19
20
  concurrent-ruby (1.1.9)
20
21
  diff-lcs (1.4.4)
21
- dry-configurable (0.12.1)
22
+ dotenv (2.7.6)
23
+ dry-configurable (0.13.0)
22
24
  concurrent-ruby (~> 1.0)
23
- dry-core (~> 0.5, >= 0.5.0)
24
- dry-container (0.8.0)
25
+ dry-core (~> 0.6)
26
+ dry-container (0.9.0)
25
27
  concurrent-ruby (~> 1.0)
26
- dry-configurable (~> 0.1, >= 0.1.3)
28
+ dry-configurable (~> 0.13, >= 0.13.0)
27
29
  dry-core (0.7.1)
28
30
  concurrent-ruby (~> 1.0)
29
31
  dry-equalizer (0.3.0)
@@ -53,7 +55,7 @@ GEM
53
55
  dry-equalizer (~> 0.2)
54
56
  dry-initializer (~> 3.0)
55
57
  dry-schema (~> 1.5, >= 1.5.2)
56
- faraday (1.7.1)
58
+ faraday (1.8.0)
57
59
  faraday-em_http (~> 1.0)
58
60
  faraday-em_synchrony (~> 1.0)
59
61
  faraday-excon (~> 1.1)
@@ -64,8 +66,8 @@ GEM
64
66
  faraday-rack (~> 1.0)
65
67
  multipart-post (>= 1.2, < 3)
66
68
  ruby2_keywords (>= 0.0.4)
67
- faraday-detailed_logger (2.3.0)
68
- faraday (>= 0.8, < 2)
69
+ faraday-detailed_logger (2.4.2)
70
+ faraday (>= 0.16, < 2)
69
71
  faraday-em_http (1.0.0)
70
72
  faraday-em_synchrony (1.0.0)
71
73
  faraday-excon (1.1.0)
@@ -74,15 +76,15 @@ GEM
74
76
  faraday-net_http_persistent (1.2.0)
75
77
  faraday-patron (1.0.0)
76
78
  faraday-rack (1.0.0)
77
- faraday_middleware (1.1.0)
79
+ faraday_middleware (1.2.0)
78
80
  faraday (~> 1.0)
79
81
  fingerprintable (1.2.1)
80
82
  colorize
81
- i18n (1.8.10)
83
+ i18n (1.8.11)
82
84
  concurrent-ruby (~> 1.0)
83
- ledger_sync (2.2.0)
85
+ ipaddr (1.2.3)
86
+ ledger_sync (2.2.3)
84
87
  activemodel
85
- colorize
86
88
  dry-schema (~> 1.5.4)
87
89
  dry-validation (~> 1.5.6)
88
90
  faraday
@@ -93,19 +95,27 @@ GEM
93
95
  openssl (~> 2.2.0)
94
96
  pd_ruby
95
97
  rack (~> 2.2.3)
98
+ rainbow (~> 3.0)
96
99
  resonad
97
100
  simply_serializable (>= 1.5.1)
98
101
  minitest (5.14.4)
99
102
  multipart-post (2.1.1)
100
- nokogiri (1.12.4-x86_64-linux)
103
+ nokogiri (1.12.5-x86_64-linux)
101
104
  racc (~> 1.4)
102
- openssl (2.2.0)
105
+ openssl (2.2.1)
106
+ ipaddr
107
+ parallel (1.21.0)
108
+ parser (3.0.2.0)
109
+ ast (~> 2.4.1)
103
110
  pd_ruby (0.2.3)
104
111
  colorize
105
- racc (1.5.2)
112
+ racc (1.6.0)
106
113
  rack (2.2.3)
114
+ rainbow (3.0.0)
107
115
  rake (13.0.6)
116
+ regexp_parser (2.1.1)
108
117
  resonad (1.4.0)
118
+ rexml (3.2.5)
109
119
  rspec (3.10.0)
110
120
  rspec-core (~> 3.10.0)
111
121
  rspec-expectations (~> 3.10.0)
@@ -119,20 +129,35 @@ GEM
119
129
  diff-lcs (>= 1.2.0, < 2.0)
120
130
  rspec-support (~> 3.10.0)
121
131
  rspec-support (3.10.2)
132
+ rubocop (1.21.0)
133
+ parallel (~> 1.10)
134
+ parser (>= 3.0.0.0)
135
+ rainbow (>= 2.2.2, < 4.0)
136
+ regexp_parser (>= 1.8, < 3.0)
137
+ rexml
138
+ rubocop-ast (>= 1.9.1, < 2.0)
139
+ ruby-progressbar (~> 1.7)
140
+ unicode-display_width (>= 1.4.0, < 3.0)
141
+ rubocop-ast (1.11.0)
142
+ parser (>= 3.0.1.1)
143
+ ruby-progressbar (1.11.0)
122
144
  ruby2_keywords (0.0.5)
123
145
  simply_serializable (1.5.1)
124
146
  fingerprintable (>= 1.2.1)
125
147
  tzinfo (2.0.4)
126
148
  concurrent-ruby (~> 1.0)
127
- zeitwerk (2.4.2)
149
+ unicode-display_width (2.1.0)
150
+ zeitwerk (2.5.1)
128
151
 
129
152
  PLATFORMS
130
153
  x86_64-linux
131
154
 
132
155
  DEPENDENCIES
133
156
  desertcart!
157
+ dotenv
134
158
  rake (~> 13.0)
135
159
  rspec (~> 3.0)
160
+ rubocop
136
161
 
137
162
  BUNDLED WITH
138
- 2.2.15
163
+ 2.2.26
data/desertcart.gemspec CHANGED
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # require_relative 'lib/desertcart/version'
3
+ require_relative 'lib/desertcart/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'desertcart'
7
- # spec.version = Desertcart::VERSION
8
- spec.version = '1.0.0'
7
+ spec.version = Desertcart::VERSION
9
8
  spec.authors = ['Jozef Vaclavik']
10
9
  spec.email = ['jozef@desertcart.com']
11
10
 
@@ -15,7 +14,7 @@ Gem::Specification.new do |spec|
15
14
  'and retrieve informations about your orders.'
16
15
  spec.homepage = 'https://developer.desertcart.com'
17
16
  spec.license = 'MIT'
18
- spec.required_ruby_version = '>= 3.0'
17
+ spec.required_ruby_version = '>= 2.7'
19
18
 
20
19
  spec.metadata['homepage_uri'] = spec.homepage
21
20
  spec.metadata['source_code_uri'] = 'https://github.com/desertcart/desertcart-ruby'
@@ -31,4 +30,6 @@ Gem::Specification.new do |spec|
31
30
  spec.require_paths = ['lib']
32
31
 
33
32
  spec.add_dependency 'ledger_sync', '~> 2.2.0'
33
+ spec.add_development_dependency 'dotenv'
34
+ spec.add_development_dependency 'rubocop'
34
35
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Desertcart
4
+ module Marketplace
5
+ class Movement
6
+ module Operations
7
+ class Update < Desertcart::Operation::Update
8
+ class Contract < LedgerSync::Ledgers::Contract
9
+ params do
10
+ required(:ledger_id).filled(:string)
11
+ required(:estimated_arrival_at).filled(:integer)
12
+ end
13
+ end
14
+
15
+ def ledger_namespace_path
16
+ 'marketplace'
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -15,6 +15,8 @@ module Desertcart
15
15
  attribute :merchant_id
16
16
  attribute :currency_code
17
17
  attribute :price
18
+ attribute :final_purchase_currency_code
19
+ attribute :final_purchase_price
18
20
  attribute :title
19
21
  attribute :state
20
22
  attribute :marketplace_shipping_state
@@ -6,7 +6,7 @@ module Desertcart
6
6
  module Operations
7
7
  class Find < Desertcart::Operation::Find
8
8
  class Contract < LedgerSync::Ledgers::Contract
9
- params do
9
+ params do # rubocop:disable Metrics/BlockLength
10
10
  required(:ledger_id).filled(:string)
11
11
  optional(:name).maybe(:string)
12
12
  optional(:store_uid).maybe(:string)
@@ -16,6 +16,8 @@ module Desertcart
16
16
  optional(:merchant_id).maybe(:string)
17
17
  optional(:currency_code).maybe(:string)
18
18
  optional(:price).maybe(:integer)
19
+ optional(:final_purchase_currency_code).maybe(:string)
20
+ optional(:final_pruchase_price).maybe(:integer)
19
21
  optional(:title).maybe(:string)
20
22
  optional(:state).maybe(:string)
21
23
  optional(:marketplace_shipping_state).maybe(:string)
@@ -6,7 +6,7 @@ module Desertcart
6
6
  module Operations
7
7
  class Update < Desertcart::Operation::Update
8
8
  class Contract < LedgerSync::Ledgers::Contract
9
- params do
9
+ params do # rubocop:disable Metrics/BlockLength
10
10
  required(:ledger_id).filled(:string)
11
11
  optional(:name).maybe(:string)
12
12
  optional(:store_uid).maybe(:string)
@@ -16,6 +16,8 @@ module Desertcart
16
16
  optional(:merchant_id).maybe(:string)
17
17
  optional(:currency_code).maybe(:string)
18
18
  optional(:price).maybe(:integer)
19
+ optional(:final_purchase_currency_code).maybe(:string)
20
+ optional(:final_pruchase_price).maybe(:integer)
19
21
  optional(:title).maybe(:string)
20
22
  optional(:state).maybe(:string)
21
23
  optional(:marketplace_shipping_state).maybe(:string)
@@ -13,6 +13,8 @@ module Desertcart
13
13
  attribute :merchant_id
14
14
  attribute :currency_code
15
15
  attribute :price
16
+ attribute :final_purchase_currency_code
17
+ attribute :final_purchase_price
16
18
  attribute :title
17
19
  attribute :state
18
20
  attribute :marketplace_shipping_state
@@ -11,6 +11,8 @@ module Desertcart
11
11
  params do
12
12
  required(:order_item).maybe(:hash, Types::Reference)
13
13
  optional(:seller_reference_number).maybe(:string)
14
+ optional(:final_purchase_price).maybe(:string)
15
+ optional(:final_purchase_currency_code).maybe(:string)
14
16
  end
15
17
  end
16
18
 
@@ -9,6 +9,8 @@ module Desertcart
9
9
  resource.order_item.ledger_id
10
10
  end
11
11
  attribute :seller_reference_number
12
+ attribute :final_purchase_price
13
+ attribute :final_purchase_currency_code
12
14
  end
13
15
  end
14
16
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'store'
4
+
3
5
  module Desertcart
4
6
  module Marketplace
5
7
  class Authorization < Desertcart::Resource
@@ -13,6 +13,8 @@ module Desertcart
13
13
  attribute :merchant_id, type: LedgerSync::Type::String
14
14
  attribute :currency_code, type: LedgerSync::Type::String
15
15
  attribute :price, type: LedgerSync::Type::Integer
16
+ attribute :final_purchase_currency_code, type: LedgerSync::Type::String
17
+ attribute :final_purchase_price, type: LedgerSync::Type::Integer
16
18
  attribute :title, type: LedgerSync::Type::String
17
19
  attribute :state, type: LedgerSync::Type::String
18
20
  attribute :marketplace_shipping_state, type: LedgerSync::Type::String
@@ -1,10 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'order_item'
4
+
3
5
  module Desertcart
4
6
  module Marketplace
5
7
  class OrderItemAcceptance < Desertcart::Resource
6
8
  references_one :order_item, to: Desertcart::Marketplace::OrderItem
7
9
  attribute :seller_reference_number, type: LedgerSync::Type::String
10
+ attribute :final_purchase_price, type: LedgerSync::Type::String
11
+ attribute :final_purchase_currency_code, type: LedgerSync::Type::String
8
12
  end
9
13
  end
10
14
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'order_item'
4
+
3
5
  module Desertcart
4
6
  module Marketplace
5
7
  class OrderItemRejection < Desertcart::Resource
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Desertcart
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.3'
5
5
  end
data/lib/desertcart.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ledger_sync'
3
4
  require 'desertcart/config'
4
5
  require 'desertcart/version'
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desertcart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jozef Vaclavik
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-01 00:00:00.000000000 Z
11
+ date: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ledger_sync
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  description: Client library to talk to Desertcart API. Get products details, proceed
28
56
  with checkout and retrieve informations about your orders.
29
57
  email:
@@ -32,9 +60,11 @@ executables: []
32
60
  extensions: []
33
61
  extra_rdoc_files: []
34
62
  files:
35
- - ".github/workflows/main.yml"
63
+ - ".github/workflows/ruby.yml"
36
64
  - ".gitignore"
37
65
  - ".rspec"
66
+ - ".rubocop.yml"
67
+ - ".ruby-version"
38
68
  - CHANGELOG.md
39
69
  - Gemfile
40
70
  - Gemfile.lock
@@ -55,6 +85,7 @@ files:
55
85
  - lib/desertcart/marketplace/authorizations/serializer.rb
56
86
  - lib/desertcart/marketplace/movement/deserializer.rb
57
87
  - lib/desertcart/marketplace/movement/operations/create.rb
88
+ - lib/desertcart/marketplace/movement/operations/update.rb
58
89
  - lib/desertcart/marketplace/movement/serializer.rb
59
90
  - lib/desertcart/marketplace/order_item/deserializer.rb
60
91
  - lib/desertcart/marketplace/order_item/operations/find.rb
@@ -103,7 +134,7 @@ metadata:
103
134
  homepage_uri: https://developer.desertcart.com
104
135
  source_code_uri: https://github.com/desertcart/desertcart-ruby
105
136
  changelog_uri: https://github.com/desertcart/desertcart-ruby/blob/master/CHANGELOG.md
106
- post_install_message:
137
+ post_install_message:
107
138
  rdoc_options: []
108
139
  require_paths:
109
140
  - lib
@@ -111,15 +142,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
142
  requirements:
112
143
  - - ">="
113
144
  - !ruby/object:Gem::Version
114
- version: '3.0'
145
+ version: '2.7'
115
146
  required_rubygems_version: !ruby/object:Gem::Requirement
116
147
  requirements:
117
148
  - - ">="
118
149
  - !ruby/object:Gem::Version
119
150
  version: '0'
120
151
  requirements: []
121
- rubygems_version: 3.2.3
122
- signing_key:
152
+ rubygems_version: 3.2.9
153
+ signing_key:
123
154
  specification_version: 4
124
155
  summary: Communicate with Desertcart API
125
156
  test_files: []
@@ -1,18 +0,0 @@
1
- name: Ruby
2
-
3
- on: [push,pull_request]
4
-
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v2
10
- - name: Set up Ruby
11
- uses: ruby/setup-ruby@v1
12
- with:
13
- ruby-version: 3.0.0
14
- - name: Run the default task
15
- run: |
16
- gem install bundler -v 2.2.15
17
- bundle install
18
- bundle exec rake