lightspeed_restaurant 3.3.3 → 3.5.0
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 +4 -4
- data/.github/workflows/ci.yml +10 -10
- data/.rubocop.yml +67 -18
- data/.ruby-version +1 -1
- data/CHANGELOG.md +11 -1
- data/README.md +26 -12
- data/lib/lightspeed_restaurant/company.rb +1 -0
- data/lib/lightspeed_restaurant/errors/lightspeed_restaurant_error.rb +1 -6
- data/lib/lightspeed_restaurant/external_payment_provider.rb +22 -0
- data/lib/lightspeed_restaurant/inventory_product.rb +18 -0
- data/lib/lightspeed_restaurant/operations/create.rb +3 -2
- data/lib/lightspeed_restaurant/operations/find.rb +9 -1
- data/lib/lightspeed_restaurant/operations/list.rb +1 -1
- data/lib/lightspeed_restaurant/operations/renew.rb +12 -0
- data/lib/lightspeed_restaurant/request.rb +6 -5
- data/lib/lightspeed_restaurant/version.rb +1 -1
- data/lib/lightspeed_restaurant/webhook.rb +24 -0
- data/lib/lightspeed_restaurant.rb +10 -8
- data/lightspeed_restaurant.gemspec +2 -2
- data/logo.png +0 -0
- metadata +12 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 819c48f8c7338828400e8fd788fa7f5d51951c8e71bd1cd86337dc329a666990
|
|
4
|
+
data.tar.gz: 4ad3e802b271568b2724c8a0a18e66a56c2dbe076f7c6a7efd6fbde14f27fd40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d0e9268772e1021354f60fc515f400d23dff8ea135c6ab5185d35dd2989695f08d52dc94fd8e1fe6003f5b7789e7f358cc043833701a40b523f25fdb783ca7d
|
|
7
|
+
data.tar.gz: 9f53439e6203bfe3ea7426fb44f5c1fc29db25f1c7956221190b99c28a702bb7d572672b213b271250e4df9ded357beea9d0ff02415ec20c4ed7890e2ed8ba2b
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -7,18 +7,19 @@ jobs:
|
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
strategy:
|
|
9
9
|
matrix:
|
|
10
|
-
ruby: [
|
|
10
|
+
ruby: ['3.3', '3.4.0-preview2']
|
|
11
11
|
|
|
12
12
|
steps:
|
|
13
13
|
- uses: actions/checkout@master
|
|
14
14
|
|
|
15
15
|
- name: Set up the Ruby version
|
|
16
|
-
uses:
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
17
|
with:
|
|
18
|
-
ruby-version:
|
|
18
|
+
ruby-version: '3.3'
|
|
19
|
+
bundler-cache: true
|
|
19
20
|
|
|
20
21
|
- name: Ruby gem cache
|
|
21
|
-
uses: actions/cache@
|
|
22
|
+
uses: actions/cache@v4
|
|
22
23
|
with:
|
|
23
24
|
path: vendor/bundle
|
|
24
25
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
@@ -27,7 +28,6 @@ jobs:
|
|
|
27
28
|
|
|
28
29
|
- name: Set up the environment
|
|
29
30
|
run: |
|
|
30
|
-
gem install bundler
|
|
31
31
|
bundle config path vendor/bundle
|
|
32
32
|
bundle install --jobs 4 --retry 3
|
|
33
33
|
|
|
@@ -38,18 +38,19 @@ jobs:
|
|
|
38
38
|
runs-on: ubuntu-latest
|
|
39
39
|
strategy:
|
|
40
40
|
matrix:
|
|
41
|
-
ruby: [
|
|
41
|
+
ruby: ['3.3', '3.4.0-preview2']
|
|
42
42
|
|
|
43
43
|
steps:
|
|
44
44
|
- uses: actions/checkout@master
|
|
45
45
|
|
|
46
46
|
- name: Set up the Ruby version
|
|
47
|
-
uses:
|
|
47
|
+
uses: ruby/setup-ruby@v1
|
|
48
48
|
with:
|
|
49
|
-
ruby-version:
|
|
49
|
+
ruby-version: '3.3'
|
|
50
|
+
bundler-cache: true
|
|
50
51
|
|
|
51
52
|
- name: Ruby gem cache
|
|
52
|
-
uses: actions/cache@
|
|
53
|
+
uses: actions/cache@v4
|
|
53
54
|
with:
|
|
54
55
|
path: vendor/bundle
|
|
55
56
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
@@ -58,7 +59,6 @@ jobs:
|
|
|
58
59
|
|
|
59
60
|
- name: Set up the environment
|
|
60
61
|
run: |
|
|
61
|
-
gem install bundler
|
|
62
62
|
bundle config path vendor/bundle
|
|
63
63
|
bundle install --jobs 4 --retry 3
|
|
64
64
|
|
data/.rubocop.yml
CHANGED
|
@@ -1,44 +1,87 @@
|
|
|
1
1
|
require: rubocop-rspec
|
|
2
2
|
|
|
3
|
+
Gemspec/RequiredRubyVersion:
|
|
4
|
+
Enabled: false
|
|
5
|
+
|
|
3
6
|
Layout/LineLength:
|
|
4
|
-
|
|
7
|
+
Enabled: false
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
Layout/MultilineMethodCallIndentation:
|
|
10
|
+
Enabled: false
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
Lint/ConstantDefinitionInBlock:
|
|
13
|
+
Enabled: false
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
Lint/MissingSuper:
|
|
16
|
+
Enabled: false
|
|
17
|
+
|
|
18
|
+
Lint/NonDeterministicRequireOrder:
|
|
19
|
+
Enabled: false
|
|
20
|
+
|
|
21
|
+
Lint/SuppressedException:
|
|
22
|
+
Enabled: false
|
|
23
|
+
|
|
24
|
+
Lint/ToJSON:
|
|
25
|
+
Enabled: false
|
|
26
|
+
|
|
27
|
+
Lint/UselessMethodDefinition:
|
|
28
|
+
Enabled: false
|
|
29
|
+
|
|
30
|
+
Metrics/AbcSize:
|
|
31
|
+
Enabled: false
|
|
18
32
|
|
|
19
33
|
Metrics/BlockLength:
|
|
20
34
|
Severity: warning
|
|
21
35
|
Exclude:
|
|
22
36
|
- spec/**/*
|
|
23
37
|
|
|
24
|
-
|
|
38
|
+
Metrics/ClassLength:
|
|
39
|
+
Max: 200
|
|
40
|
+
Severity: warning
|
|
41
|
+
|
|
42
|
+
Metrics/ParameterLists:
|
|
43
|
+
Max: 6
|
|
44
|
+
MaxOptionalParameters: 6
|
|
45
|
+
|
|
46
|
+
Metrics/MethodLength:
|
|
47
|
+
Max: 15
|
|
48
|
+
|
|
49
|
+
Naming/BinaryOperatorParameterName:
|
|
50
|
+
Enabled: false
|
|
51
|
+
|
|
52
|
+
RSpec/ContextWording:
|
|
53
|
+
Enabled: false
|
|
54
|
+
|
|
55
|
+
RSpec/InstanceVariable:
|
|
56
|
+
Enabled: false
|
|
57
|
+
|
|
58
|
+
RSpec/LeakyConstantDeclaration:
|
|
25
59
|
Enabled: false
|
|
26
60
|
|
|
27
61
|
RSpec/MultipleExpectations:
|
|
28
62
|
Max: 3
|
|
29
63
|
|
|
30
|
-
|
|
64
|
+
RSpec/MessageSpies:
|
|
31
65
|
Enabled: false
|
|
32
66
|
|
|
33
|
-
|
|
67
|
+
RSpec/NoExpectationExample:
|
|
34
68
|
Enabled: false
|
|
35
69
|
|
|
36
|
-
|
|
70
|
+
RSpec/StubbedMock:
|
|
71
|
+
Enabled: false
|
|
72
|
+
|
|
73
|
+
RSpec/ExampleLength:
|
|
37
74
|
Enabled: false
|
|
38
75
|
|
|
39
76
|
Style/ClassAndModuleChildren:
|
|
40
77
|
Enabled: false
|
|
41
78
|
|
|
79
|
+
Style/Documentation:
|
|
80
|
+
Enabled: false
|
|
81
|
+
|
|
82
|
+
Style/NumericLiterals:
|
|
83
|
+
Enabled: false
|
|
84
|
+
|
|
42
85
|
Style/PercentLiteralDelimiters:
|
|
43
86
|
PreferredDelimiters:
|
|
44
87
|
default: ()
|
|
@@ -48,6 +91,12 @@ Style/PercentLiteralDelimiters:
|
|
|
48
91
|
'%w': '[]'
|
|
49
92
|
'%W': '[]'
|
|
50
93
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
94
|
+
Style/StringLiterals:
|
|
95
|
+
EnforcedStyle: single_quotes
|
|
96
|
+
SupportedStyles:
|
|
97
|
+
- single_quotes
|
|
98
|
+
- double_quotes
|
|
99
|
+
ConsistentQuotesInMultiline: false
|
|
100
|
+
|
|
101
|
+
Security/YAMLLoad:
|
|
102
|
+
Enabled: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby-
|
|
1
|
+
ruby-3.3.6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.5.0 / 2024-12-10
|
|
4
|
+
|
|
5
|
+
- Add `externalPaymentProvider` resource endpoints
|
|
6
|
+
- Add `webhook` resource endpoints
|
|
7
|
+
- Upgrade ruby version to 3.3.6
|
|
8
|
+
|
|
9
|
+
## 3.4.0 / 2021-04-08
|
|
10
|
+
|
|
11
|
+
- Add `find` endpoint for the InventoryProduct
|
|
12
|
+
|
|
3
13
|
## 3.3.3 / 2021-04-08
|
|
4
14
|
|
|
5
|
-
- Add `find` endpoint for the company
|
|
15
|
+
- Add `find` endpoint for the company
|
|
6
16
|
|
|
7
17
|
## 3.3.2 / 2020-03-20
|
|
8
18
|
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://codeclimate.com/github/chronogolf/lightspeed_restaurant) [](https://badge.fury.io/rb/lightspeed_restaurant)
|
|
4
4
|
|
|
5
|
-
[Lightspeed Restaurant API Client](https://github.com/chronogolf/lightspeed_restaurant) is a gem for interacting with [Lightspeed Restaurant](https://www.lightspeedhq.com/
|
|
5
|
+
[Lightspeed Restaurant API Client](https://github.com/chronogolf/lightspeed_restaurant) is a gem for interacting with [Lightspeed Restaurant](https://www.lightspeedhq.com/pos/restaurant/) API.
|
|
6
6
|
Lightspeed Restaurant is point of sale that helps bars, restaurants, and cafés deliver a better customer experience and run a more profitable business.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
@@ -10,7 +10,7 @@ Lightspeed Restaurant is point of sale that helps bars, restaurants, and cafés
|
|
|
10
10
|
Add this line to your application's Gemfile:
|
|
11
11
|
|
|
12
12
|
```ruby
|
|
13
|
-
gem
|
|
13
|
+
gem "lightspeed_restaurant"
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
And then execute:
|
|
@@ -26,23 +26,29 @@ Or install it yourself as:
|
|
|
26
26
|
### Basic Usage
|
|
27
27
|
|
|
28
28
|
First, set your api token:
|
|
29
|
+
|
|
29
30
|
```ruby
|
|
30
31
|
LightspeedRestaurantClient.api_token = "YOUR_API_TOKEN_HERE"
|
|
31
32
|
```
|
|
33
|
+
|
|
32
34
|
Next, make requests using the resource class you need:
|
|
35
|
+
|
|
33
36
|
```ruby
|
|
34
37
|
customers = LightspeedRestaurantClient::Customer.all
|
|
35
38
|
customer = customers.first
|
|
36
|
-
customer.firstName =
|
|
39
|
+
customer.firstName = "Tom"
|
|
37
40
|
customer.save
|
|
38
41
|
```
|
|
39
|
-
|
|
42
|
+
|
|
43
|
+
That"s it!
|
|
40
44
|
|
|
41
45
|
### Using a custom API configuration per action
|
|
46
|
+
|
|
42
47
|
Each action support a configuration object as the last param, allows you to setup `api_token`, `base_uri`
|
|
43
48
|
Sample usage:
|
|
49
|
+
|
|
44
50
|
```ruby
|
|
45
|
-
LightspeedRestaurantClient::Customer.all(LightspeedRestaurantClient.default_configuration.with(api_token:
|
|
51
|
+
LightspeedRestaurantClient::Customer.all(LightspeedRestaurantClient.default_configuration.with(api_token: "MY_OTHER_TOKEN", base_uri: "other_ls_resto_uri"))
|
|
46
52
|
```
|
|
47
53
|
|
|
48
54
|
### Available operations
|
|
@@ -54,28 +60,33 @@ LightspeedRestaurantClient::Customer.all
|
|
|
54
60
|
```
|
|
55
61
|
|
|
56
62
|
#### Find
|
|
63
|
+
|
|
57
64
|
```ruby
|
|
58
65
|
LightspeedRestaurantClient::Customer.find(123)
|
|
59
66
|
```
|
|
60
67
|
|
|
61
68
|
#### Create
|
|
69
|
+
|
|
62
70
|
```ruby
|
|
63
|
-
LightspeedRestaurantClient::Customer.create(...firstName:
|
|
71
|
+
LightspeedRestaurantClient::Customer.create(...firstName: "Tom", email: "tom@brady.com"...)
|
|
64
72
|
```
|
|
65
73
|
|
|
66
74
|
#### Update
|
|
75
|
+
|
|
67
76
|
```ruby
|
|
68
|
-
LightspeedRestaurantClient::Customer.update(123, { email:
|
|
77
|
+
LightspeedRestaurantClient::Customer.update(123, { email: "tom@brady.com" })
|
|
69
78
|
```
|
|
70
79
|
|
|
71
80
|
#### Save
|
|
81
|
+
|
|
72
82
|
```ruby
|
|
73
83
|
customer = LightspeedRestaurantClient::Customer.find(123)
|
|
74
|
-
customer.firstName =
|
|
84
|
+
customer.firstName = "Micheal"
|
|
75
85
|
customer.save
|
|
76
86
|
```
|
|
77
87
|
|
|
78
88
|
#### Destroy
|
|
89
|
+
|
|
79
90
|
```ruby
|
|
80
91
|
customer = LightspeedRestaurantClient::Customer.find(123)
|
|
81
92
|
customer.destroy
|
|
@@ -85,6 +96,7 @@ customer.destroy
|
|
|
85
96
|
|
|
86
97
|
By default the logs are done on STDOUT.
|
|
87
98
|
You can specify your own logger (it has to respond to info and error methods, like the Rails logger) :
|
|
99
|
+
|
|
88
100
|
```ruby
|
|
89
101
|
LightspeedRestaurantClient.logger = "YOUR_LOGGER"
|
|
90
102
|
```
|
|
@@ -94,13 +106,15 @@ LightspeedRestaurantClient.logger = "YOUR_LOGGER"
|
|
|
94
106
|
Pull requests are welcome on GitHub at https://github.com/chronogolf/lightspeed_restaurant.
|
|
95
107
|
|
|
96
108
|
## About Us
|
|
97
|
-
[![Chronogolf][crest]](https://www.chronogolf.com)
|
|
98
109
|
|
|
99
|
-
[Chronogolf](https://www.
|
|
110
|
+
[![Chronogolf by Lightspeed][crest]](https://www.lightspeedhq.com)
|
|
111
|
+
|
|
112
|
+
[Chronogolf by Lightspeed](https://www.lightspeedhq.com/golf/)'s mission is to facilitate the interactions between golf managers and golf players. We are building software that allows golf directors to better manage their course, together with a marketplace to find & book games in real-time. We are constantly innovating and trying to challenge the status quo.
|
|
100
113
|
|
|
101
|
-
|
|
114
|
+
Learn more at [https://www.lightspeedhq.com/golf/](https://www.lightspeedhq.com/golf/)
|
|
102
115
|
|
|
103
116
|
## Future Improvements
|
|
117
|
+
|
|
104
118
|
- Improve destroy operation to handle destroy by passing an ID (or an array of IDs)
|
|
105
119
|
- Add missing resources (Company, Reservation, Floor, Table...)
|
|
106
120
|
- Improve test coverage
|
|
@@ -109,4 +123,4 @@ Find more informations at https://pro.chronogolf.com
|
|
|
109
123
|
|
|
110
124
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
111
125
|
|
|
112
|
-
[crest]:
|
|
126
|
+
[crest]: ./logo.png
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module LightspeedRestaurantClient
|
|
4
4
|
class LightspeedRestaurantClientError < StandardError
|
|
5
|
-
attr_reader :message
|
|
6
|
-
attr_reader :http_status
|
|
7
|
-
attr_reader :http_body
|
|
8
|
-
attr_reader :http_headers
|
|
9
|
-
attr_reader :request_id
|
|
10
|
-
attr_reader :json_body
|
|
5
|
+
attr_reader :message, :http_status, :http_body, :http_headers, :request_id, :json_body
|
|
11
6
|
|
|
12
7
|
def initialize(message = nil, http_status = nil, http_body = nil, http_headers = nil)
|
|
13
8
|
@message = message
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'lightspeed_restaurant/base'
|
|
4
|
+
require 'lightspeed_restaurant/operations/list'
|
|
5
|
+
require 'lightspeed_restaurant/operations/find'
|
|
6
|
+
require 'lightspeed_restaurant/operations/create'
|
|
7
|
+
|
|
8
|
+
module LightspeedRestaurantClient
|
|
9
|
+
class ExternalPaymentProvider < LightspeedRestaurantClient::Base
|
|
10
|
+
extend Operations::Create
|
|
11
|
+
extend Operations::Find
|
|
12
|
+
extend Operations::List
|
|
13
|
+
|
|
14
|
+
def self.resource_name
|
|
15
|
+
'externalPaymentProvider'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.default_resource_path
|
|
19
|
+
"/rest/partner/v1/#{resource_name}/"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'lightspeed_restaurant/base'
|
|
4
|
+
require 'lightspeed_restaurant/operations/find'
|
|
5
|
+
|
|
6
|
+
module LightspeedRestaurantClient
|
|
7
|
+
class InventoryProduct < LightspeedRestaurantClient::Base
|
|
8
|
+
extend Operations::Find
|
|
9
|
+
|
|
10
|
+
def self.resource_name
|
|
11
|
+
'Inventory/Product'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.default_resource_path
|
|
15
|
+
"/rest/#{resource_name.downcase}"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -14,9 +14,10 @@ module LightspeedRestaurantClient
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
16
|
def handle_create_response(response, attributes)
|
|
17
|
-
|
|
18
|
-
when Numeric
|
|
17
|
+
if response.is_a?(Numeric)
|
|
19
18
|
attributes.merge(id: response)
|
|
19
|
+
elsif self == LightspeedRestaurantClient::ExternalPaymentProvider
|
|
20
|
+
response.merge(id: response['data']['id'])
|
|
20
21
|
else
|
|
21
22
|
response
|
|
22
23
|
end
|
|
@@ -4,9 +4,17 @@ module LightspeedRestaurantClient
|
|
|
4
4
|
module Operations
|
|
5
5
|
module Find
|
|
6
6
|
def find(id, configuration = nil)
|
|
7
|
-
response = JSON.parse(LightspeedRestaurantClient.get(default_resource_path +
|
|
7
|
+
response = JSON.parse(LightspeedRestaurantClient.get(default_resource_path + id_path(id), {}, configuration))
|
|
8
8
|
new(response)
|
|
9
9
|
end
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
def id_path(id)
|
|
14
|
+
return id.to_s if self == LightspeedRestaurantClient::ExternalPaymentProvider
|
|
15
|
+
|
|
16
|
+
"/#{id}"
|
|
17
|
+
end
|
|
10
18
|
end
|
|
11
19
|
end
|
|
12
20
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LightspeedRestaurantClient
|
|
4
|
+
module Operations
|
|
5
|
+
module Renew
|
|
6
|
+
def renew(id, configuration = nil)
|
|
7
|
+
response = JSON.parse(LightspeedRestaurantClient.post("#{default_resource_path}/#{id}/renew", {}, {}, configuration))
|
|
8
|
+
new(response)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -6,6 +6,7 @@ require 'lightspeed_restaurant/errors/authentication_error'
|
|
|
6
6
|
require 'lightspeed_restaurant/errors/invalid_request_error'
|
|
7
7
|
require 'lightspeed_restaurant/errors/not_found_error'
|
|
8
8
|
require 'lightspeed_restaurant/errors/rate_limit_error'
|
|
9
|
+
require 'lightspeed_restaurant/errors/unauthorized_error'
|
|
9
10
|
require 'uri'
|
|
10
11
|
|
|
11
12
|
module LightspeedRestaurantClient
|
|
@@ -19,7 +20,7 @@ module LightspeedRestaurantClient
|
|
|
19
20
|
@headers = { 'Content-Type' => 'application/json', 'X-Auth-Token' => token }
|
|
20
21
|
@body = body.to_json
|
|
21
22
|
@query = query
|
|
22
|
-
@path =
|
|
23
|
+
@path = "/PosServer#{path}"
|
|
23
24
|
@connection = Excon.new(@base_uri)
|
|
24
25
|
@logger = logger || begin
|
|
25
26
|
require 'logger'
|
|
@@ -73,22 +74,22 @@ module LightspeedRestaurantClient
|
|
|
73
74
|
|
|
74
75
|
def response_object_error(response)
|
|
75
76
|
APIError.new("Invalid response object from API: #{JSON.parse(response.body)['description']}",
|
|
76
|
-
|
|
77
|
+
response.status, response.body, response.headers)
|
|
77
78
|
end
|
|
78
79
|
|
|
79
80
|
def invalid_request_error(response)
|
|
80
81
|
InvalidRequestError.new(JSON.parse(response.body)['description'],
|
|
81
|
-
|
|
82
|
+
response.status, response.body, response.headers)
|
|
82
83
|
end
|
|
83
84
|
|
|
84
85
|
def authentication_error(response)
|
|
85
86
|
AuthenticationError.new(JSON.parse(response.body)['description'],
|
|
86
|
-
|
|
87
|
+
response.status, response.body, response.headers)
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
def rate_limit_error(response)
|
|
90
91
|
RateLimitError.new(JSON.parse(response.body)['description'],
|
|
91
|
-
|
|
92
|
+
response.status, response.body, response.headers)
|
|
92
93
|
end
|
|
93
94
|
end
|
|
94
95
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'lightspeed_restaurant/base'
|
|
4
|
+
require 'lightspeed_restaurant/operations/list'
|
|
5
|
+
require 'lightspeed_restaurant/operations/find'
|
|
6
|
+
require 'lightspeed_restaurant/operations/create'
|
|
7
|
+
require 'lightspeed_restaurant/operations/renew'
|
|
8
|
+
|
|
9
|
+
module LightspeedRestaurantClient
|
|
10
|
+
class Webhook < LightspeedRestaurantClient::Base
|
|
11
|
+
extend Operations::Create
|
|
12
|
+
extend Operations::List
|
|
13
|
+
extend Operations::Find
|
|
14
|
+
extend Operations::Renew
|
|
15
|
+
|
|
16
|
+
def self.resource_name
|
|
17
|
+
'Webhooks'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.default_resource_path
|
|
21
|
+
"/rest/v1/#{resource_name.downcase}/subscriptions"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -6,19 +6,21 @@
|
|
|
6
6
|
require 'excon'
|
|
7
7
|
require 'json'
|
|
8
8
|
|
|
9
|
-
require 'lightspeed_restaurant/
|
|
10
|
-
require 'lightspeed_restaurant/request'
|
|
9
|
+
require 'lightspeed_restaurant/company'
|
|
11
10
|
require 'lightspeed_restaurant/configuration'
|
|
12
|
-
|
|
13
|
-
require 'lightspeed_restaurant/customer'
|
|
14
11
|
require 'lightspeed_restaurant/customer_credit_change'
|
|
15
|
-
require 'lightspeed_restaurant/customer_loyalty_card'
|
|
16
12
|
require 'lightspeed_restaurant/customer_establishment_order'
|
|
17
|
-
require 'lightspeed_restaurant/
|
|
18
|
-
require 'lightspeed_restaurant/
|
|
13
|
+
require 'lightspeed_restaurant/customer_loyalty_card'
|
|
14
|
+
require 'lightspeed_restaurant/customer'
|
|
15
|
+
require 'lightspeed_restaurant/external_payment_provider'
|
|
16
|
+
require 'lightspeed_restaurant/inventory_product'
|
|
19
17
|
require 'lightspeed_restaurant/payment_type'
|
|
20
|
-
require 'lightspeed_restaurant/product_group'
|
|
21
18
|
require 'lightspeed_restaurant/product_group_product'
|
|
19
|
+
require 'lightspeed_restaurant/product_group'
|
|
20
|
+
require 'lightspeed_restaurant/receipt'
|
|
21
|
+
require 'lightspeed_restaurant/request'
|
|
22
|
+
require 'lightspeed_restaurant/version'
|
|
23
|
+
require 'lightspeed_restaurant/webhook'
|
|
22
24
|
|
|
23
25
|
module LightspeedRestaurantClient
|
|
24
26
|
class << self
|
|
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_dependency('excon', '~> 0.
|
|
26
|
-
spec.add_dependency('json', '~> 2.
|
|
25
|
+
spec.add_dependency('excon', '~> 0.91.0')
|
|
26
|
+
spec.add_dependency('json', '~> 2.6.1')
|
|
27
27
|
|
|
28
28
|
spec.add_development_dependency('pry')
|
|
29
29
|
spec.add_development_dependency('rake')
|
data/logo.png
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lightspeed_restaurant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Olivier Buffon, Laurent Cobos, Sybil Deboin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: excon
|
|
@@ -16,28 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
19
|
+
version: 0.91.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.
|
|
26
|
+
version: 0.91.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: json
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 2.6.1
|
|
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:
|
|
40
|
+
version: 2.6.1
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: pry
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -173,10 +173,13 @@ files:
|
|
|
173
173
|
- lib/lightspeed_restaurant/errors/not_found_error.rb
|
|
174
174
|
- lib/lightspeed_restaurant/errors/rate_limit_error.rb
|
|
175
175
|
- lib/lightspeed_restaurant/errors/unauthorized_error.rb
|
|
176
|
+
- lib/lightspeed_restaurant/external_payment_provider.rb
|
|
177
|
+
- lib/lightspeed_restaurant/inventory_product.rb
|
|
176
178
|
- lib/lightspeed_restaurant/operations/create.rb
|
|
177
179
|
- lib/lightspeed_restaurant/operations/destroy.rb
|
|
178
180
|
- lib/lightspeed_restaurant/operations/find.rb
|
|
179
181
|
- lib/lightspeed_restaurant/operations/list.rb
|
|
182
|
+
- lib/lightspeed_restaurant/operations/renew.rb
|
|
180
183
|
- lib/lightspeed_restaurant/operations/save.rb
|
|
181
184
|
- lib/lightspeed_restaurant/operations/update.rb
|
|
182
185
|
- lib/lightspeed_restaurant/payment_type.rb
|
|
@@ -185,7 +188,9 @@ files:
|
|
|
185
188
|
- lib/lightspeed_restaurant/receipt.rb
|
|
186
189
|
- lib/lightspeed_restaurant/request.rb
|
|
187
190
|
- lib/lightspeed_restaurant/version.rb
|
|
191
|
+
- lib/lightspeed_restaurant/webhook.rb
|
|
188
192
|
- lightspeed_restaurant.gemspec
|
|
193
|
+
- logo.png
|
|
189
194
|
homepage: https://github.com/chronogolf/lightspeed_restaurant
|
|
190
195
|
licenses:
|
|
191
196
|
- MIT
|
|
@@ -205,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
205
210
|
- !ruby/object:Gem::Version
|
|
206
211
|
version: '0'
|
|
207
212
|
requirements: []
|
|
208
|
-
rubygems_version: 3.
|
|
213
|
+
rubygems_version: 3.5.11
|
|
209
214
|
signing_key:
|
|
210
215
|
specification_version: 4
|
|
211
216
|
summary: Ruby bindings for the Lightspeed Restaurant API
|