spree_api 4.1.3 → 4.1.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree_api might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/v2/base_controller.rb +5 -0
- data/app/controllers/spree/api/v2/storefront/checkout_controller.rb +5 -1
- data/app/serializers/spree/v2/storefront/cart_serializer.rb +6 -4
- data/app/serializers/spree/v2/storefront/taxon_serializer.rb +1 -1
- data/docs/v2/storefront/index.yaml +1 -1
- data/spree_api.gemspec +10 -3
- metadata +13 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ce01ac97150e84ad430f83628328fa2b07a18166ad6d819a5143be5792a042c
|
4
|
+
data.tar.gz: 3f04100734efc0d0c88e8c58d7ae481a3158f46292144712cccd9fdea806fc24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd83e6d0bae731fd7291905cf90de9da31a77d1b086cbbcbddc98030d395fb86f859b2b1a76ea6dd1132e0d30dd2b3f58b4c99b0809e6b6d44ab6396f834d5ed
|
7
|
+
data.tar.gz: 5c604cf0684a2589d054966bd5a6b4e1a215d21b0e5731a48c91718934e05bef3eb8783d1ddbc559ac258d2a3184445b0362341ecb4aeb451923f388726df2c8
|
@@ -7,6 +7,7 @@ module Spree
|
|
7
7
|
include Spree::Core::ControllerHelpers::Store
|
8
8
|
rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
|
9
9
|
rescue_from CanCan::AccessDenied, with: :access_denied
|
10
|
+
rescue_from Spree::Core::GatewayError, with: :gateway_error
|
10
11
|
|
11
12
|
def content_type
|
12
13
|
Spree::Api::Config[:api_v2_content_type]
|
@@ -108,6 +109,10 @@ module Spree
|
|
108
109
|
def access_denied(exception)
|
109
110
|
render_error_payload(exception.message, 403)
|
110
111
|
end
|
112
|
+
|
113
|
+
def gateway_error(exception)
|
114
|
+
render_error_payload(exception.message)
|
115
|
+
end
|
111
116
|
end
|
112
117
|
end
|
113
118
|
end
|
@@ -65,7 +65,11 @@ module Spree
|
|
65
65
|
def shipping_rates
|
66
66
|
result = shipping_rates_service.call(order: spree_current_order)
|
67
67
|
|
68
|
-
|
68
|
+
if result.success?
|
69
|
+
render_serialized_payload { serialize_shipping_rates(result.value) }
|
70
|
+
else
|
71
|
+
render_error_payload(result.error)
|
72
|
+
end
|
69
73
|
end
|
70
74
|
|
71
75
|
def payment_methods
|
@@ -20,12 +20,14 @@ module Spree
|
|
20
20
|
|
21
21
|
belongs_to :user
|
22
22
|
belongs_to :billing_address,
|
23
|
-
|
24
|
-
|
23
|
+
id_method_name: :bill_address_id,
|
24
|
+
serializer: :address,
|
25
|
+
record_type: :address
|
25
26
|
|
26
27
|
belongs_to :shipping_address,
|
27
|
-
|
28
|
-
|
28
|
+
id_method_name: :ship_address_id,
|
29
|
+
serializer: :address,
|
30
|
+
record_type: :address
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -4,7 +4,7 @@ module Spree
|
|
4
4
|
class TaxonSerializer < BaseSerializer
|
5
5
|
set_type :taxon
|
6
6
|
|
7
|
-
attributes :name, :pretty_name, :permalink, :seo_title, :meta_title, :meta_description,
|
7
|
+
attributes :name, :pretty_name, :permalink, :seo_title, :description, :meta_title, :meta_description,
|
8
8
|
:meta_keywords, :left, :right, :position, :depth, :updated_at
|
9
9
|
|
10
10
|
attribute :is_root, &:root?
|
@@ -774,7 +774,7 @@ paths:
|
|
774
774
|
description: >-
|
775
775
|
Returns a list of available Shipping Rates for Checkout.
|
776
776
|
Shipping Rates are grouped against Shipments.
|
777
|
-
Each checkout
|
777
|
+
Each checkout can have multiple Shipments eg. some products are available
|
778
778
|
in stock and will be send out instantly and some needs to be backordered.
|
779
779
|
tags:
|
780
780
|
- Checkout
|
data/spree_api.gemspec
CHANGED
@@ -2,20 +2,27 @@
|
|
2
2
|
require_relative '../core/lib/spree/core/version.rb'
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
|
+
s.name = "spree_api"
|
6
|
+
s.version = Spree.version
|
5
7
|
s.authors = ["Ryan Bigg"]
|
6
8
|
s.email = ["ryan@spreecommerce.com"]
|
7
|
-
s.description = %q{Spree's API}
|
8
9
|
s.summary = %q{Spree's API}
|
10
|
+
s.description = %q{Spree's API}
|
9
11
|
s.homepage = 'http://spreecommerce.org'
|
10
12
|
s.license = 'BSD-3-Clause'
|
11
13
|
|
14
|
+
s.metadata = {
|
15
|
+
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
|
16
|
+
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
|
17
|
+
"documentation_uri" => "https://guides.spreecommerce.org/",
|
18
|
+
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
|
19
|
+
}
|
20
|
+
|
12
21
|
s.required_ruby_version = '>= 2.5.0'
|
13
22
|
|
14
23
|
s.files = `git ls-files`.split($\).reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
15
24
|
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
16
|
-
s.name = "spree_api"
|
17
25
|
s.require_paths = ["lib"]
|
18
|
-
s.version = Spree.version
|
19
26
|
|
20
27
|
s.add_development_dependency 'jsonapi-rspec'
|
21
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-rspec
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.1.
|
33
|
+
version: 4.1.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.1.
|
40
|
+
version: 4.1.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rabl
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,8 +300,12 @@ files:
|
|
300
300
|
homepage: http://spreecommerce.org
|
301
301
|
licenses:
|
302
302
|
- BSD-3-Clause
|
303
|
-
metadata:
|
304
|
-
|
303
|
+
metadata:
|
304
|
+
bug_tracker_uri: https://github.com/spree/spree/issues
|
305
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.1.8
|
306
|
+
documentation_uri: https://guides.spreecommerce.org/
|
307
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.1.8
|
308
|
+
post_install_message:
|
305
309
|
rdoc_options: []
|
306
310
|
require_paths:
|
307
311
|
- lib
|
@@ -316,8 +320,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
320
|
- !ruby/object:Gem::Version
|
317
321
|
version: '0'
|
318
322
|
requirements: []
|
319
|
-
rubygems_version: 3.
|
320
|
-
signing_key:
|
323
|
+
rubygems_version: 3.1.2
|
324
|
+
signing_key:
|
321
325
|
specification_version: 4
|
322
326
|
summary: Spree's API
|
323
327
|
test_files: []
|