parking_ticket 1.0.49 → 1.0.51
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/Gemfile.lock +17 -18
- data/lib/clients/pay_by_phone/adapter.rb +4 -4
- data/lib/clients/pay_by_phone/client.rb +30 -6
- data/lib/parking_ticket/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ae8a15d87b12cb8459a1c661fa420bb5bbca1aa7c228180efbb8d40e5b03b8b
|
|
4
|
+
data.tar.gz: 98356fdebb298798239e45df890bccc1ebcae34b949e71923bfe4de3cc031889
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ced6ff95178bb462c8923aa024d01ffe462a6b63c8f32fc25a843e37825cbe624748dadc3a2c85b182b1f77ad58fbfd7c89ae1ce096a4e2bc10781e9308afcd1
|
|
7
|
+
data.tar.gz: bb5cd1c63d9db6774818415186c3d2c5ee76d30f631088b6e2f05030ecff5d0ef6d8ea1b512ae9a34bd34d2c7fc6f81b03284c5c4ccb06ed8a5c7adb2307ba0e
|
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
parking_ticket (1.0.
|
|
4
|
+
parking_ticket (1.0.50)
|
|
5
5
|
faraday (>= 2.7.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
addressable (2.8.
|
|
10
|
+
addressable (2.8.4)
|
|
11
11
|
public_suffix (>= 2.0.2, < 6.0)
|
|
12
12
|
amazing_print (1.4.0)
|
|
13
13
|
ast (2.4.2)
|
|
@@ -42,23 +42,23 @@ GEM
|
|
|
42
42
|
rspec-core (~> 3.12.0)
|
|
43
43
|
rspec-expectations (~> 3.12.0)
|
|
44
44
|
rspec-mocks (~> 3.12.0)
|
|
45
|
-
rspec-core (3.12.
|
|
45
|
+
rspec-core (3.12.1)
|
|
46
46
|
rspec-support (~> 3.12.0)
|
|
47
|
-
rspec-expectations (3.12.
|
|
47
|
+
rspec-expectations (3.12.2)
|
|
48
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
49
49
|
rspec-support (~> 3.12.0)
|
|
50
|
-
rspec-mocks (3.12.
|
|
50
|
+
rspec-mocks (3.12.5)
|
|
51
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
52
52
|
rspec-support (~> 3.12.0)
|
|
53
53
|
rspec-support (3.12.0)
|
|
54
|
-
rubocop (1.
|
|
54
|
+
rubocop (1.49.0)
|
|
55
55
|
json (~> 2.3)
|
|
56
56
|
parallel (~> 1.10)
|
|
57
57
|
parser (>= 3.2.0.0)
|
|
58
58
|
rainbow (>= 2.2.2, < 4.0)
|
|
59
59
|
regexp_parser (>= 1.8, < 3.0)
|
|
60
60
|
rexml (>= 3.2.5, < 4.0)
|
|
61
|
-
rubocop-ast (>= 1.
|
|
61
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
|
62
62
|
ruby-progressbar (~> 1.7)
|
|
63
63
|
unicode-display_width (>= 2.4.0, < 3.0)
|
|
64
64
|
rubocop-ast (1.28.0)
|
|
@@ -67,13 +67,14 @@ GEM
|
|
|
67
67
|
rubocop (>= 0.90.0)
|
|
68
68
|
ruby-progressbar (1.13.0)
|
|
69
69
|
ruby2_keywords (0.0.5)
|
|
70
|
-
sorbet (0.5.
|
|
71
|
-
sorbet-static (= 0.5.
|
|
72
|
-
sorbet-runtime (0.5.
|
|
73
|
-
sorbet-static (0.5.
|
|
74
|
-
sorbet-static
|
|
75
|
-
|
|
76
|
-
sorbet
|
|
70
|
+
sorbet (0.5.10767)
|
|
71
|
+
sorbet-static (= 0.5.10767)
|
|
72
|
+
sorbet-runtime (0.5.10767)
|
|
73
|
+
sorbet-static (0.5.10767-universal-darwin-20)
|
|
74
|
+
sorbet-static (0.5.10767-x86_64-linux)
|
|
75
|
+
sorbet-static-and-runtime (0.5.10767)
|
|
76
|
+
sorbet (= 0.5.10767)
|
|
77
|
+
sorbet-runtime (= 0.5.10767)
|
|
77
78
|
spoom (1.2.1)
|
|
78
79
|
sorbet (>= 0.5.10187)
|
|
79
80
|
sorbet-runtime (>= 0.5.9204)
|
|
@@ -97,10 +98,8 @@ GEM
|
|
|
97
98
|
addressable (>= 2.8.0)
|
|
98
99
|
crack (>= 0.3.2)
|
|
99
100
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
100
|
-
|
|
101
|
-
yard (0.
|
|
102
|
-
webrick (~> 1.7.0)
|
|
103
|
-
yard-sorbet (0.8.0)
|
|
101
|
+
yard (0.9.32)
|
|
102
|
+
yard-sorbet (0.8.1)
|
|
104
103
|
sorbet-runtime (>= 0.5)
|
|
105
104
|
yard (>= 0.9)
|
|
106
105
|
|
|
@@ -101,11 +101,11 @@ module ParkingTicket
|
|
|
101
101
|
end
|
|
102
102
|
def payment_methods
|
|
103
103
|
raise_invalid_credentials! unless @valid_credentials
|
|
104
|
-
@client.payment_methods.fetch('
|
|
104
|
+
@client.payment_methods.fetch('paymentCards').map do |payment_method|
|
|
105
105
|
ParkingTicket::Clients::Models::PaymentMethod.new(
|
|
106
|
-
client_internal_id: payment_method['
|
|
106
|
+
client_internal_id: payment_method['paymentAccountId'],
|
|
107
107
|
anonymised_card_number: payment_method['maskedCardNumber'][-4..],
|
|
108
|
-
payment_card_type: PAYMENT_CARD_TYPE_MAPPER.fetch(payment_method['
|
|
108
|
+
payment_card_type: PAYMENT_CARD_TYPE_MAPPER.fetch(payment_method['cardType'])
|
|
109
109
|
)
|
|
110
110
|
end
|
|
111
111
|
end
|
|
@@ -147,7 +147,7 @@ module ParkingTicket
|
|
|
147
147
|
quantity: quantity,
|
|
148
148
|
time_unit: mapped_time_unit,
|
|
149
149
|
quote_client_internal_id: quote.client_internal_id,
|
|
150
|
-
starts_on: quote.starts_on
|
|
150
|
+
starts_on: quote.starts_on,
|
|
151
151
|
payment_method_id: payment_method_id
|
|
152
152
|
)
|
|
153
153
|
end
|
|
@@ -14,7 +14,9 @@ module ParkingTicket
|
|
|
14
14
|
def auth(username, password)
|
|
15
15
|
conn = Faraday.new('https://auth.paybyphoneapis.com') do |f|
|
|
16
16
|
f.response :json
|
|
17
|
+
f.response :raise_error
|
|
17
18
|
end
|
|
19
|
+
|
|
18
20
|
conn.post(
|
|
19
21
|
'/token',
|
|
20
22
|
URI.encode_www_form({
|
|
@@ -105,7 +107,7 @@ module ParkingTicket
|
|
|
105
107
|
licensePlate: license_plate,
|
|
106
108
|
locationId: zipcode,
|
|
107
109
|
rateOptionId: rate_option_client_internal_id,
|
|
108
|
-
startTime: starts_on,
|
|
110
|
+
startTime: starts_on.to_s,
|
|
109
111
|
quoteId: quote_client_internal_id,
|
|
110
112
|
parkingAccountId: account_id
|
|
111
113
|
}
|
|
@@ -139,21 +141,43 @@ module ParkingTicket
|
|
|
139
141
|
|
|
140
142
|
sig { params(token: String).returns(T::Hash[String, T::Array[T::Hash[String, T.untyped]]]) }
|
|
141
143
|
def payment_methods(token)
|
|
142
|
-
connection
|
|
144
|
+
connection = Faraday.new(
|
|
145
|
+
url: 'https://payments.paybyphoneapis.com',
|
|
146
|
+
headers: {
|
|
147
|
+
accept: 'application/json, text/plain, */*',
|
|
148
|
+
'accept-language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',
|
|
149
|
+
authorization: "Bearer #{token}",
|
|
150
|
+
'content-type': 'application/json',
|
|
151
|
+
'sec-fetch-dest': 'empty',
|
|
152
|
+
'sec-fetch-mode': 'cors',
|
|
153
|
+
'sec-fetch-site': 'cross-site',
|
|
154
|
+
'x-api-key': 'zZ4ePLvoBBD1YwBGCo6P5DiPLDjSss3j',
|
|
155
|
+
'x-pbp-clienttype': 'WebApp',
|
|
156
|
+
Referer: 'https://m2.paybyphone.fr/',
|
|
157
|
+
'Referrer-Policy': 'strict-origin-when-cross-origin'
|
|
158
|
+
}
|
|
159
|
+
) do |f|
|
|
160
|
+
f.response :json
|
|
161
|
+
f.response :raise_error
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
connection.get('/v1/accounts').body
|
|
143
165
|
end
|
|
144
166
|
|
|
145
167
|
private
|
|
146
168
|
|
|
147
|
-
sig { params(token: String).returns(Faraday::Connection) }
|
|
148
|
-
def connection(token)
|
|
169
|
+
sig { params(token: String, subdomain: T.nilable(String)).returns(Faraday::Connection) }
|
|
170
|
+
def connection(token, subdomain: 'consumer')
|
|
149
171
|
Faraday.new(
|
|
150
|
-
url:
|
|
172
|
+
url: "https://#{subdomain}.paybyphoneapis.com",
|
|
151
173
|
headers: {
|
|
152
174
|
'Content-Type' => 'application/json',
|
|
153
|
-
'Authorization' => "Bearer #{token}"
|
|
175
|
+
'Authorization' => "Bearer #{token}",
|
|
176
|
+
'Referer' => 'https://m2.paybyphone.fr/'
|
|
154
177
|
}
|
|
155
178
|
) do |f|
|
|
156
179
|
f.response :json
|
|
180
|
+
f.response :raise_error
|
|
157
181
|
end
|
|
158
182
|
end
|
|
159
183
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parking_ticket
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.51
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Ecrepont
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-04-
|
|
11
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|