beyond_api 0.14.0.pre → 0.15.0.pre

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: 7a3232a181c9e98adb48dde14f44f3fbf5cbd148716a4aebfaedd8395f67f1c1
4
- data.tar.gz: 3165b0482c207a611d5b1c1cfe0631a730c7d23774f0551c34c6e29bfb571134
3
+ metadata.gz: 438360193bc7064cbd6591e9dc088aeb81f162aac26bff0ac1f891f45b5b9993
4
+ data.tar.gz: 57f358035cc7aa0ee5ee0795eecb3f887b5f534d470342348d70c6e6c6f1ac48
5
5
  SHA512:
6
- metadata.gz: ba4db6852f6ea76b6b27a5def080dd54b1e2a9767a050cbddfb463eb538deac413b22923f065a1b4da37f828866142acc7173a0242a30ebf80b5e530d0606acf
7
- data.tar.gz: 3f48e09d7f4a934218fefeff168c67a5aaa097dd502fb8080969748dc8ac612ec7f4444596e3b6f73cfc234b37741063103beace5cfa59375eb6b4a689b5e130
6
+ metadata.gz: 284505c3dc6af706bd3851fe62c885ce2aec79c76a997b2c07f20a23d5745c3a7d16c337177de9579b25c0fe9440b2b9e04f5cfdd2ec377362effb2a98df7b0b
7
+ data.tar.gz: eb9168f92793a47673646fcb8ac36bd6c5103596620a1003a143242a938ceba156429fe3760f41672c705a23f367ad2be40d6607c0f112ecdf16be1ead96a0b1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### v0.15.0.pre
2
+
3
+ * features
4
+ * Add pickup options methods
5
+ * `PickupOptions#all`
6
+ * `PickupOptions#create`
7
+
1
8
  ### v0.14.0.pre
2
9
 
3
10
  * deprecations
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.14.0.pre)
4
+ beyond_api (0.15.0.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  coderay (1.1.3)
11
- concurrent-ruby (1.1.8)
11
+ concurrent-ruby (1.1.9)
12
12
  diff-lcs (1.4.4)
13
13
  dotenv (2.7.6)
14
- faker (2.17.0)
14
+ faker (2.18.0)
15
15
  i18n (>= 1.6, < 2)
16
16
  faraday (0.17.4)
17
17
  multipart-post (>= 1.2, < 3)
@@ -19,7 +19,7 @@ GEM
19
19
  concurrent-ruby (~> 1.0)
20
20
  method_source (1.0.0)
21
21
  multipart-post (2.1.1)
22
- pry (0.14.0)
22
+ pry (0.14.1)
23
23
  coderay (~> 1.1)
24
24
  method_source (~> 1.0)
25
25
  rake (10.5.0)
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "beyond_api/utils"
4
+
5
+ module BeyondApi
6
+ class PickupOptions < Base
7
+ include BeyondApi::Utils
8
+
9
+ #
10
+ # A +GET+ request is used to list all pickup options of the shop in a paged way.
11
+ #
12
+ # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options' -i -X GET \
13
+ # -H 'Accept: application/hal+json' \
14
+ # -H 'Authorization: Bearer <Access token>'
15
+ #
16
+ # @option params [Boolean] :paginated
17
+ # @option params [Integer] :size the page size
18
+ # @option params [Integer] :page the page number
19
+ #
20
+ # @return [OpenStruct]
21
+ #
22
+ # @example
23
+ # @pickup_options = session.pickup_options.all(size: 100, page: 0)
24
+ #
25
+ def all(params = {})
26
+ handle_all_request("/pickup-options", :pickup_options, params)
27
+ end
28
+
29
+ #
30
+ # A +POST+ request is used to create a pickup option.
31
+ #
32
+ # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options' -i -X POST \
33
+ # -H 'Content-Type: application/json' \
34
+ # -H 'Authorization: Bearer <Access token>' \
35
+ # -d '{
36
+ # "name" : "My little Cornershop - St.Ives",
37
+ # "description" : "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.",
38
+ # "taxClass" : "REGULAR",
39
+ # "freePickupValue" : {
40
+ # "currency" : "EUR",
41
+ # "amount" : 50
42
+ # },
43
+ # "fixedPrice" : {
44
+ # "taxModel" : "GROSS",
45
+ # "currency" : "EUR",
46
+ # "amount" : 1
47
+ # },
48
+ # "phoneNumberRequired" : true,
49
+ # "locationId" : "cb554eb6-2768-4491-afd2-6bcd0aec0937"
50
+ # }'
51
+ #
52
+ # @beyond_api.scopes +shpz:c+
53
+ #
54
+ # @param body [Hash] the request body
55
+ #
56
+ # @return [OpenStruct]
57
+ #
58
+ # @example
59
+ # body = {
60
+ # name: "My little Cornershop - St.Ives",
61
+ # description: "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.",
62
+ # tax_class: "REGULAR",
63
+ # free_pickup_value: {
64
+ # currency: "EUR",
65
+ # amount: 50
66
+ # },
67
+ # fixed_price: {
68
+ # tax_model: "GROSS",
69
+ # currency: "EUR",
70
+ # amount: 1
71
+ # },
72
+ # phone_number_required: true,
73
+ # location_id: "cb554eb6-2768-4491-afd2-6bcd0aec0937"
74
+ # }
75
+ #
76
+ # @pickup_option = session.pickup_options.create(body)
77
+ #
78
+ def create(body)
79
+ response, status = BeyondApi::Request.post(@session, "/pickup-options", body)
80
+
81
+ handle_response(response, status)
82
+ end
83
+ end
84
+ end
@@ -11,6 +11,7 @@ module BeyondApi
11
11
  autoload :OrderSettings, "beyond_api/resources/order_settings"
12
12
  autoload :Orders, "beyond_api/resources/orders"
13
13
  autoload :PaymentMethodDefinitions, "beyond_api/resources/payment_method_definitions"
14
+ autoload :PickupOptions, "beyond_api/resources/pickup_options"
14
15
  autoload :PaymentMethods, "beyond_api/resources/payment_methods"
15
16
  autoload :ProductAttributeDefinitions, "beyond_api/resources/product_attribute_definitions"
16
17
  autoload :ProductsView, "beyond_api/resources/products_view"
@@ -74,6 +75,10 @@ module BeyondApi
74
75
  BeyondApi::PaymentMethods.new(self)
75
76
  end
76
77
 
78
+ def pickup_options
79
+ BeyondApi::PickupOptions.new(self)
80
+ end
81
+
77
82
  def product_attribute_definitions
78
83
  BeyondApi::ProductAttributeDefinitions.new(self)
79
84
  end
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.14.0.pre".freeze
2
+ VERSION = "0.15.0.pre".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0.pre
4
+ version: 0.15.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-04-06 00:00:00.000000000 Z
13
+ date: 2021-06-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -148,6 +148,7 @@ files:
148
148
  - lib/beyond_api/resources/orders.rb
149
149
  - lib/beyond_api/resources/payment_method_definitions.rb
150
150
  - lib/beyond_api/resources/payment_methods.rb
151
+ - lib/beyond_api/resources/pickup_options.rb
151
152
  - lib/beyond_api/resources/product_attribute_definitions.rb
152
153
  - lib/beyond_api/resources/products.rb
153
154
  - lib/beyond_api/resources/products/attachments.rb