yoomoney 0.2.0 → 0.3.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/CHANGELOG.md +9 -0
- data/README.md +5 -2
- data/lib/yoomoney/client.rb +10 -0
- data/lib/yoomoney/internal/transport/base_client.rb +6 -0
- data/lib/yoomoney/models/airline.rb +6 -50
- data/lib/yoomoney/models/airline_leg.rb +33 -0
- data/lib/yoomoney/models/airline_passenger.rb +21 -0
- data/lib/yoomoney/models/receipt_create_params.rb +2 -120
- data/lib/yoomoney/models/receipt_data.rb +3 -123
- data/lib/yoomoney/models/receipt_data_item.rb +125 -0
- data/lib/yoomoney/models.rb +6 -0
- data/lib/yoomoney/version.rb +1 -1
- data/lib/yoomoney.rb +3 -0
- data/rbi/yoomoney/client.rbi +5 -0
- data/rbi/yoomoney/internal/transport/base_client.rbi +5 -0
- data/rbi/yoomoney/models/airline.rbi +8 -84
- data/rbi/yoomoney/models/airline_leg.rbi +56 -0
- data/rbi/yoomoney/models/airline_passenger.rbi +28 -0
- data/rbi/yoomoney/models/receipt_create_params.rbi +1 -159
- data/rbi/yoomoney/models/receipt_data.rbi +3 -185
- data/rbi/yoomoney/models/receipt_data_item.rbi +185 -0
- data/rbi/yoomoney/models.rbi +6 -0
- data/sig/yoomoney/client.rbs +2 -0
- data/sig/yoomoney/internal/transport/base_client.rbs +2 -0
- data/sig/yoomoney/models/airline.rbs +12 -58
- data/sig/yoomoney/models/airline_leg.rbs +37 -0
- data/sig/yoomoney/models/airline_passenger.rbs +15 -0
- data/sig/yoomoney/models/receipt_create_params.rbs +7 -119
- data/sig/yoomoney/models/receipt_data.rbs +4 -128
- data/sig/yoomoney/models/receipt_data_item.rbs +127 -0
- data/sig/yoomoney/models.rbs +6 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a8c0d19b753c15f1a35d09005b4802fa18675662c632968f6d2089b217df3c1
|
|
4
|
+
data.tar.gz: b2a4b06cfc640d396a251baec125b60eeb9ab68328177b169353d8a2ad51e323
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72ec1d4c85653a922dff564453b8163f048254a5cd3759e13694f9af98864202ae650ced15543a21604408baa7f5570aa22c181c08391c47f35a8b9514d05720
|
|
7
|
+
data.tar.gz: e378220ca735b248a46055d4ca0cd87e99b409f09bfedefc7ff30a6ff74f61ba71f8d2f3d321c2f02b832f53fb9ed62e5a3a60e6f32bf7b035eeaef7863205e5
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2026-02-19)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/Hexlet/yoomoney-ruby/compare/v0.2.0...v0.3.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([b75593c](https://github.com/Hexlet/yoomoney-ruby/commit/b75593cad51a278a820e8835964c489af6bbf25a))
|
|
10
|
+
* **api:** manual updates ([75047a6](https://github.com/Hexlet/yoomoney-ruby/commit/75047a6b38457301fa731534c18d49393af80be0))
|
|
11
|
+
|
|
3
12
|
## 0.2.0 (2026-02-14)
|
|
4
13
|
|
|
5
14
|
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Hexlet/yoomoney-ruby/compare/v0.1.0...v0.2.0)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "yoomoney", "~> 0.
|
|
18
|
+
gem "yoomoney", "~> 0.3.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -26,7 +26,10 @@ gem "yoomoney", "~> 0.2.0"
|
|
|
26
26
|
require "bundler/setup"
|
|
27
27
|
require "yoomoney"
|
|
28
28
|
|
|
29
|
-
yoomoney = Yoomoney::Client.new
|
|
29
|
+
yoomoney = Yoomoney::Client.new(
|
|
30
|
+
username: ENV["YOOMONEY_USERNAME"], # This is the default and can be omitted
|
|
31
|
+
password: ENV["YOOMONEY_PASSWORD"] # This is the default and can be omitted
|
|
32
|
+
)
|
|
30
33
|
|
|
31
34
|
payment = yoomoney.payments.create(amount: {currency: "RUB", value: "value"}, idempotence_key: "Idempotence-Key")
|
|
32
35
|
|
data/lib/yoomoney/client.rb
CHANGED
|
@@ -56,6 +56,16 @@ module Yoomoney
|
|
|
56
56
|
# @return [Yoomoney::Resources::Me]
|
|
57
57
|
attr_reader :me
|
|
58
58
|
|
|
59
|
+
# @api private
|
|
60
|
+
#
|
|
61
|
+
# @return [Hash{String=>String}]
|
|
62
|
+
private def auth_headers
|
|
63
|
+
return {} if @username.nil? || @password.nil?
|
|
64
|
+
|
|
65
|
+
base64_credentials = ["#{@username}:#{@password}"].pack("m0")
|
|
66
|
+
{"authorization" => "Basic #{base64_credentials}"}
|
|
67
|
+
end
|
|
68
|
+
|
|
59
69
|
# Creates and returns a new client for interacting with the API.
|
|
60
70
|
#
|
|
61
71
|
# @param username [String, nil] HTTP Basic аутентификация клиента ЮKassa (shopId) Defaults to
|
|
@@ -215,6 +215,11 @@ module Yoomoney
|
|
|
215
215
|
@max_retry_delay = max_retry_delay
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
+
# @api private
|
|
219
|
+
#
|
|
220
|
+
# @return [Hash{String=>String}]
|
|
221
|
+
private def auth_headers = {}
|
|
222
|
+
|
|
218
223
|
# @api private
|
|
219
224
|
#
|
|
220
225
|
# @return [String]
|
|
@@ -271,6 +276,7 @@ module Yoomoney
|
|
|
271
276
|
|
|
272
277
|
headers = Yoomoney::Internal::Util.normalized_headers(
|
|
273
278
|
@headers,
|
|
279
|
+
auth_headers,
|
|
274
280
|
req[:headers].to_h,
|
|
275
281
|
opts[:extra_headers].to_h
|
|
276
282
|
)
|
|
@@ -10,13 +10,13 @@ module Yoomoney
|
|
|
10
10
|
|
|
11
11
|
# @!attribute legs
|
|
12
12
|
#
|
|
13
|
-
# @return [Array<Yoomoney::Models::
|
|
14
|
-
optional :legs, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::
|
|
13
|
+
# @return [Array<Yoomoney::Models::AirlineLeg>, nil]
|
|
14
|
+
optional :legs, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::AirlineLeg] }
|
|
15
15
|
|
|
16
16
|
# @!attribute passengers
|
|
17
17
|
#
|
|
18
|
-
# @return [Array<Yoomoney::Models::
|
|
19
|
-
optional :passengers, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::
|
|
18
|
+
# @return [Array<Yoomoney::Models::AirlinePassenger>, nil]
|
|
19
|
+
optional :passengers, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::AirlinePassenger] }
|
|
20
20
|
|
|
21
21
|
# @!attribute ticket_number
|
|
22
22
|
#
|
|
@@ -25,53 +25,9 @@ module Yoomoney
|
|
|
25
25
|
|
|
26
26
|
# @!method initialize(booking_reference: nil, legs: nil, passengers: nil, ticket_number: nil)
|
|
27
27
|
# @param booking_reference [String]
|
|
28
|
-
# @param legs [Array<Yoomoney::Models::
|
|
29
|
-
# @param passengers [Array<Yoomoney::Models::
|
|
28
|
+
# @param legs [Array<Yoomoney::Models::AirlineLeg>]
|
|
29
|
+
# @param passengers [Array<Yoomoney::Models::AirlinePassenger>]
|
|
30
30
|
# @param ticket_number [String]
|
|
31
|
-
|
|
32
|
-
class Leg < Yoomoney::Internal::Type::BaseModel
|
|
33
|
-
# @!attribute departure_airport
|
|
34
|
-
#
|
|
35
|
-
# @return [String]
|
|
36
|
-
required :departure_airport, String
|
|
37
|
-
|
|
38
|
-
# @!attribute departure_date
|
|
39
|
-
#
|
|
40
|
-
# @return [String]
|
|
41
|
-
required :departure_date, String
|
|
42
|
-
|
|
43
|
-
# @!attribute destination_airport
|
|
44
|
-
#
|
|
45
|
-
# @return [String]
|
|
46
|
-
required :destination_airport, String
|
|
47
|
-
|
|
48
|
-
# @!attribute carrier_code
|
|
49
|
-
#
|
|
50
|
-
# @return [String, nil]
|
|
51
|
-
optional :carrier_code, String
|
|
52
|
-
|
|
53
|
-
# @!method initialize(departure_airport:, departure_date:, destination_airport:, carrier_code: nil)
|
|
54
|
-
# @param departure_airport [String]
|
|
55
|
-
# @param departure_date [String]
|
|
56
|
-
# @param destination_airport [String]
|
|
57
|
-
# @param carrier_code [String]
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
class Passenger < Yoomoney::Internal::Type::BaseModel
|
|
61
|
-
# @!attribute first_name
|
|
62
|
-
#
|
|
63
|
-
# @return [String]
|
|
64
|
-
required :first_name, String
|
|
65
|
-
|
|
66
|
-
# @!attribute last_name
|
|
67
|
-
#
|
|
68
|
-
# @return [String]
|
|
69
|
-
required :last_name, String
|
|
70
|
-
|
|
71
|
-
# @!method initialize(first_name:, last_name:)
|
|
72
|
-
# @param first_name [String]
|
|
73
|
-
# @param last_name [String]
|
|
74
|
-
end
|
|
75
31
|
end
|
|
76
32
|
end
|
|
77
33
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Yoomoney
|
|
4
|
+
module Models
|
|
5
|
+
class AirlineLeg < Yoomoney::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute departure_airport
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :departure_airport, String
|
|
10
|
+
|
|
11
|
+
# @!attribute departure_date
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :departure_date, String
|
|
15
|
+
|
|
16
|
+
# @!attribute destination_airport
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :destination_airport, String
|
|
20
|
+
|
|
21
|
+
# @!attribute carrier_code
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :carrier_code, String
|
|
25
|
+
|
|
26
|
+
# @!method initialize(departure_airport:, departure_date:, destination_airport:, carrier_code: nil)
|
|
27
|
+
# @param departure_airport [String]
|
|
28
|
+
# @param departure_date [String]
|
|
29
|
+
# @param destination_airport [String]
|
|
30
|
+
# @param carrier_code [String]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Yoomoney
|
|
4
|
+
module Models
|
|
5
|
+
class AirlinePassenger < Yoomoney::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute first_name
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :first_name, String
|
|
10
|
+
|
|
11
|
+
# @!attribute last_name
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :last_name, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(first_name:, last_name:)
|
|
17
|
+
# @param first_name [String]
|
|
18
|
+
# @param last_name [String]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -129,31 +129,7 @@ module Yoomoney
|
|
|
129
129
|
#
|
|
130
130
|
# @param request_options [Yoomoney::RequestOptions, Hash{Symbol=>Object}]
|
|
131
131
|
|
|
132
|
-
class Item < Yoomoney::
|
|
133
|
-
# @!attribute amount
|
|
134
|
-
# Сумма.
|
|
135
|
-
#
|
|
136
|
-
# @return [Yoomoney::Models::MonetaryAmount]
|
|
137
|
-
required :amount, -> { Yoomoney::MonetaryAmount }
|
|
138
|
-
|
|
139
|
-
# @!attribute description
|
|
140
|
-
# Название товара.
|
|
141
|
-
#
|
|
142
|
-
# @return [String]
|
|
143
|
-
required :description, String
|
|
144
|
-
|
|
145
|
-
# @!attribute quantity
|
|
146
|
-
# Количество.
|
|
147
|
-
#
|
|
148
|
-
# @return [Float]
|
|
149
|
-
required :quantity, Float
|
|
150
|
-
|
|
151
|
-
# @!attribute vat_code
|
|
152
|
-
# Ставка НДС.
|
|
153
|
-
#
|
|
154
|
-
# @return [Integer]
|
|
155
|
-
required :vat_code, Integer
|
|
156
|
-
|
|
132
|
+
class Item < Yoomoney::Models::ReceiptDataItem
|
|
157
133
|
# @!attribute additional_payment_subject_props
|
|
158
134
|
# Дополнительный реквизит предмета расчета.
|
|
159
135
|
#
|
|
@@ -165,112 +141,18 @@ module Yoomoney
|
|
|
165
141
|
# @return [Symbol, Yoomoney::Models::ReceiptItemAgentType, nil]
|
|
166
142
|
optional :agent_type, enum: -> { Yoomoney::ReceiptItemAgentType }
|
|
167
143
|
|
|
168
|
-
# @!attribute country_of_origin_code
|
|
169
|
-
#
|
|
170
|
-
# @return [String, nil]
|
|
171
|
-
optional :country_of_origin_code, String
|
|
172
|
-
|
|
173
|
-
# @!attribute customs_declaration_number
|
|
174
|
-
#
|
|
175
|
-
# @return [String, nil]
|
|
176
|
-
optional :customs_declaration_number, String
|
|
177
|
-
|
|
178
|
-
# @!attribute excise
|
|
179
|
-
#
|
|
180
|
-
# @return [String, nil]
|
|
181
|
-
optional :excise, String
|
|
182
|
-
|
|
183
|
-
# @!attribute mark_code_info
|
|
184
|
-
#
|
|
185
|
-
# @return [Yoomoney::Models::MarkCodeInfo, nil]
|
|
186
|
-
optional :mark_code_info, -> { Yoomoney::MarkCodeInfo }
|
|
187
|
-
|
|
188
|
-
# @!attribute mark_mode
|
|
189
|
-
#
|
|
190
|
-
# @return [String, nil]
|
|
191
|
-
optional :mark_mode, String
|
|
192
|
-
|
|
193
|
-
# @!attribute mark_quantity
|
|
194
|
-
#
|
|
195
|
-
# @return [Yoomoney::Models::MarkQuantity, nil]
|
|
196
|
-
optional :mark_quantity, -> { Yoomoney::MarkQuantity }
|
|
197
|
-
|
|
198
|
-
# @!attribute measure
|
|
199
|
-
#
|
|
200
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemMeasure, nil]
|
|
201
|
-
optional :measure, enum: -> { Yoomoney::ReceiptItemMeasure }
|
|
202
|
-
|
|
203
|
-
# @!attribute payment_mode
|
|
204
|
-
#
|
|
205
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentMode, nil]
|
|
206
|
-
optional :payment_mode, enum: -> { Yoomoney::ReceiptItemPaymentMode }
|
|
207
|
-
|
|
208
|
-
# @!attribute payment_subject
|
|
209
|
-
#
|
|
210
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject, nil]
|
|
211
|
-
optional :payment_subject, enum: -> { Yoomoney::ReceiptItemPaymentSubject }
|
|
212
|
-
|
|
213
|
-
# @!attribute payment_subject_industry_details
|
|
214
|
-
#
|
|
215
|
-
# @return [Array<Yoomoney::Models::IndustryDetails>, nil]
|
|
216
|
-
optional :payment_subject_industry_details,
|
|
217
|
-
-> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::IndustryDetails] }
|
|
218
|
-
|
|
219
|
-
# @!attribute planned_status
|
|
220
|
-
#
|
|
221
|
-
# @return [Integer, nil]
|
|
222
|
-
optional :planned_status, Integer
|
|
223
|
-
|
|
224
|
-
# @!attribute product_code
|
|
225
|
-
#
|
|
226
|
-
# @return [String, nil]
|
|
227
|
-
optional :product_code, String
|
|
228
|
-
|
|
229
144
|
# @!attribute supplier
|
|
230
145
|
#
|
|
231
146
|
# @return [Yoomoney::Models::ReceiptCreateParams::Item::Supplier, nil]
|
|
232
147
|
optional :supplier, -> { Yoomoney::ReceiptCreateParams::Item::Supplier }
|
|
233
148
|
|
|
234
|
-
# @!method initialize(
|
|
235
|
-
# @param amount [Yoomoney::Models::MonetaryAmount] Сумма.
|
|
236
|
-
#
|
|
237
|
-
# @param description [String] Название товара.
|
|
238
|
-
#
|
|
239
|
-
# @param quantity [Float] Количество.
|
|
240
|
-
#
|
|
241
|
-
# @param vat_code [Integer] Ставка НДС.
|
|
242
|
-
#
|
|
149
|
+
# @!method initialize(additional_payment_subject_props: nil, agent_type: nil, supplier: nil)
|
|
243
150
|
# @param additional_payment_subject_props [String] Дополнительный реквизит предмета расчета.
|
|
244
151
|
#
|
|
245
152
|
# @param agent_type [Symbol, Yoomoney::Models::ReceiptItemAgentType]
|
|
246
153
|
#
|
|
247
|
-
# @param country_of_origin_code [String]
|
|
248
|
-
#
|
|
249
|
-
# @param customs_declaration_number [String]
|
|
250
|
-
#
|
|
251
|
-
# @param excise [String]
|
|
252
|
-
#
|
|
253
|
-
# @param mark_code_info [Yoomoney::Models::MarkCodeInfo]
|
|
254
|
-
#
|
|
255
|
-
# @param mark_mode [String]
|
|
256
|
-
#
|
|
257
|
-
# @param mark_quantity [Yoomoney::Models::MarkQuantity]
|
|
258
|
-
#
|
|
259
|
-
# @param measure [Symbol, Yoomoney::Models::ReceiptItemMeasure]
|
|
260
|
-
#
|
|
261
|
-
# @param payment_mode [Symbol, Yoomoney::Models::ReceiptItemPaymentMode]
|
|
262
|
-
#
|
|
263
|
-
# @param payment_subject [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject]
|
|
264
|
-
#
|
|
265
|
-
# @param payment_subject_industry_details [Array<Yoomoney::Models::IndustryDetails>]
|
|
266
|
-
#
|
|
267
|
-
# @param planned_status [Integer]
|
|
268
|
-
#
|
|
269
|
-
# @param product_code [String]
|
|
270
|
-
#
|
|
271
154
|
# @param supplier [Yoomoney::Models::ReceiptCreateParams::Item::Supplier]
|
|
272
155
|
|
|
273
|
-
# @see Yoomoney::Models::ReceiptCreateParams::Item#supplier
|
|
274
156
|
class Supplier < Yoomoney::Models::ReceiptItemSupplier
|
|
275
157
|
# @!attribute inn
|
|
276
158
|
#
|
|
@@ -5,8 +5,8 @@ module Yoomoney
|
|
|
5
5
|
class ReceiptData < Yoomoney::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute items
|
|
7
7
|
#
|
|
8
|
-
# @return [Array<Yoomoney::Models::
|
|
9
|
-
required :items, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::
|
|
8
|
+
# @return [Array<Yoomoney::Models::ReceiptDataItem>]
|
|
9
|
+
required :items, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::ReceiptDataItem] }
|
|
10
10
|
|
|
11
11
|
# @!attribute customer
|
|
12
12
|
#
|
|
@@ -39,133 +39,13 @@ module Yoomoney
|
|
|
39
39
|
optional :timezone, String
|
|
40
40
|
|
|
41
41
|
# @!method initialize(items:, customer: nil, internet: nil, receipt_industry_details: nil, receipt_operational_details: nil, tax_system_code: nil, timezone: nil)
|
|
42
|
-
# @param items [Array<Yoomoney::Models::
|
|
42
|
+
# @param items [Array<Yoomoney::Models::ReceiptDataItem>]
|
|
43
43
|
# @param customer [Yoomoney::Models::ReceiptDataCustomer]
|
|
44
44
|
# @param internet [Boolean]
|
|
45
45
|
# @param receipt_industry_details [Array<Yoomoney::Models::IndustryDetails>]
|
|
46
46
|
# @param receipt_operational_details [Yoomoney::Models::OperationalDetails]
|
|
47
47
|
# @param tax_system_code [Integer]
|
|
48
48
|
# @param timezone [String]
|
|
49
|
-
|
|
50
|
-
class Item < Yoomoney::Internal::Type::BaseModel
|
|
51
|
-
# @!attribute amount
|
|
52
|
-
# Сумма.
|
|
53
|
-
#
|
|
54
|
-
# @return [Yoomoney::Models::MonetaryAmount]
|
|
55
|
-
required :amount, -> { Yoomoney::MonetaryAmount }
|
|
56
|
-
|
|
57
|
-
# @!attribute description
|
|
58
|
-
# Название товара.
|
|
59
|
-
#
|
|
60
|
-
# @return [String]
|
|
61
|
-
required :description, String
|
|
62
|
-
|
|
63
|
-
# @!attribute quantity
|
|
64
|
-
# Количество.
|
|
65
|
-
#
|
|
66
|
-
# @return [Float]
|
|
67
|
-
required :quantity, Float
|
|
68
|
-
|
|
69
|
-
# @!attribute vat_code
|
|
70
|
-
# Ставка НДС.
|
|
71
|
-
#
|
|
72
|
-
# @return [Integer]
|
|
73
|
-
required :vat_code, Integer
|
|
74
|
-
|
|
75
|
-
# @!attribute country_of_origin_code
|
|
76
|
-
#
|
|
77
|
-
# @return [String, nil]
|
|
78
|
-
optional :country_of_origin_code, String
|
|
79
|
-
|
|
80
|
-
# @!attribute customs_declaration_number
|
|
81
|
-
#
|
|
82
|
-
# @return [String, nil]
|
|
83
|
-
optional :customs_declaration_number, String
|
|
84
|
-
|
|
85
|
-
# @!attribute excise
|
|
86
|
-
#
|
|
87
|
-
# @return [String, nil]
|
|
88
|
-
optional :excise, String
|
|
89
|
-
|
|
90
|
-
# @!attribute mark_code_info
|
|
91
|
-
#
|
|
92
|
-
# @return [Yoomoney::Models::MarkCodeInfo, nil]
|
|
93
|
-
optional :mark_code_info, -> { Yoomoney::MarkCodeInfo }
|
|
94
|
-
|
|
95
|
-
# @!attribute mark_mode
|
|
96
|
-
#
|
|
97
|
-
# @return [String, nil]
|
|
98
|
-
optional :mark_mode, String
|
|
99
|
-
|
|
100
|
-
# @!attribute mark_quantity
|
|
101
|
-
#
|
|
102
|
-
# @return [Yoomoney::Models::MarkQuantity, nil]
|
|
103
|
-
optional :mark_quantity, -> { Yoomoney::MarkQuantity }
|
|
104
|
-
|
|
105
|
-
# @!attribute measure
|
|
106
|
-
#
|
|
107
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemMeasure, nil]
|
|
108
|
-
optional :measure, enum: -> { Yoomoney::ReceiptItemMeasure }
|
|
109
|
-
|
|
110
|
-
# @!attribute payment_mode
|
|
111
|
-
#
|
|
112
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentMode, nil]
|
|
113
|
-
optional :payment_mode, enum: -> { Yoomoney::ReceiptItemPaymentMode }
|
|
114
|
-
|
|
115
|
-
# @!attribute payment_subject
|
|
116
|
-
#
|
|
117
|
-
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject, nil]
|
|
118
|
-
optional :payment_subject, enum: -> { Yoomoney::ReceiptItemPaymentSubject }
|
|
119
|
-
|
|
120
|
-
# @!attribute payment_subject_industry_details
|
|
121
|
-
#
|
|
122
|
-
# @return [Array<Yoomoney::Models::IndustryDetails>, nil]
|
|
123
|
-
optional :payment_subject_industry_details,
|
|
124
|
-
-> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::IndustryDetails] }
|
|
125
|
-
|
|
126
|
-
# @!attribute planned_status
|
|
127
|
-
#
|
|
128
|
-
# @return [Integer, nil]
|
|
129
|
-
optional :planned_status, Integer
|
|
130
|
-
|
|
131
|
-
# @!attribute product_code
|
|
132
|
-
#
|
|
133
|
-
# @return [String, nil]
|
|
134
|
-
optional :product_code, String
|
|
135
|
-
|
|
136
|
-
# @!method initialize(amount:, description:, quantity:, vat_code:, country_of_origin_code: nil, customs_declaration_number: nil, excise: nil, mark_code_info: nil, mark_mode: nil, mark_quantity: nil, measure: nil, payment_mode: nil, payment_subject: nil, payment_subject_industry_details: nil, planned_status: nil, product_code: nil)
|
|
137
|
-
# @param amount [Yoomoney::Models::MonetaryAmount] Сумма.
|
|
138
|
-
#
|
|
139
|
-
# @param description [String] Название товара.
|
|
140
|
-
#
|
|
141
|
-
# @param quantity [Float] Количество.
|
|
142
|
-
#
|
|
143
|
-
# @param vat_code [Integer] Ставка НДС.
|
|
144
|
-
#
|
|
145
|
-
# @param country_of_origin_code [String]
|
|
146
|
-
#
|
|
147
|
-
# @param customs_declaration_number [String]
|
|
148
|
-
#
|
|
149
|
-
# @param excise [String]
|
|
150
|
-
#
|
|
151
|
-
# @param mark_code_info [Yoomoney::Models::MarkCodeInfo]
|
|
152
|
-
#
|
|
153
|
-
# @param mark_mode [String]
|
|
154
|
-
#
|
|
155
|
-
# @param mark_quantity [Yoomoney::Models::MarkQuantity]
|
|
156
|
-
#
|
|
157
|
-
# @param measure [Symbol, Yoomoney::Models::ReceiptItemMeasure]
|
|
158
|
-
#
|
|
159
|
-
# @param payment_mode [Symbol, Yoomoney::Models::ReceiptItemPaymentMode]
|
|
160
|
-
#
|
|
161
|
-
# @param payment_subject [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject]
|
|
162
|
-
#
|
|
163
|
-
# @param payment_subject_industry_details [Array<Yoomoney::Models::IndustryDetails>]
|
|
164
|
-
#
|
|
165
|
-
# @param planned_status [Integer]
|
|
166
|
-
#
|
|
167
|
-
# @param product_code [String]
|
|
168
|
-
end
|
|
169
49
|
end
|
|
170
50
|
end
|
|
171
51
|
end
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Yoomoney
|
|
4
|
+
module Models
|
|
5
|
+
class ReceiptDataItem < Yoomoney::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute amount
|
|
7
|
+
# Сумма.
|
|
8
|
+
#
|
|
9
|
+
# @return [Yoomoney::Models::MonetaryAmount]
|
|
10
|
+
required :amount, -> { Yoomoney::MonetaryAmount }
|
|
11
|
+
|
|
12
|
+
# @!attribute description
|
|
13
|
+
# Название товара.
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :description, String
|
|
17
|
+
|
|
18
|
+
# @!attribute quantity
|
|
19
|
+
# Количество.
|
|
20
|
+
#
|
|
21
|
+
# @return [Float]
|
|
22
|
+
required :quantity, Float
|
|
23
|
+
|
|
24
|
+
# @!attribute vat_code
|
|
25
|
+
# Ставка НДС.
|
|
26
|
+
#
|
|
27
|
+
# @return [Integer]
|
|
28
|
+
required :vat_code, Integer
|
|
29
|
+
|
|
30
|
+
# @!attribute country_of_origin_code
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :country_of_origin_code, String
|
|
34
|
+
|
|
35
|
+
# @!attribute customs_declaration_number
|
|
36
|
+
#
|
|
37
|
+
# @return [String, nil]
|
|
38
|
+
optional :customs_declaration_number, String
|
|
39
|
+
|
|
40
|
+
# @!attribute excise
|
|
41
|
+
#
|
|
42
|
+
# @return [String, nil]
|
|
43
|
+
optional :excise, String
|
|
44
|
+
|
|
45
|
+
# @!attribute mark_code_info
|
|
46
|
+
#
|
|
47
|
+
# @return [Yoomoney::Models::MarkCodeInfo, nil]
|
|
48
|
+
optional :mark_code_info, -> { Yoomoney::MarkCodeInfo }
|
|
49
|
+
|
|
50
|
+
# @!attribute mark_mode
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :mark_mode, String
|
|
54
|
+
|
|
55
|
+
# @!attribute mark_quantity
|
|
56
|
+
#
|
|
57
|
+
# @return [Yoomoney::Models::MarkQuantity, nil]
|
|
58
|
+
optional :mark_quantity, -> { Yoomoney::MarkQuantity }
|
|
59
|
+
|
|
60
|
+
# @!attribute measure
|
|
61
|
+
#
|
|
62
|
+
# @return [Symbol, Yoomoney::Models::ReceiptItemMeasure, nil]
|
|
63
|
+
optional :measure, enum: -> { Yoomoney::ReceiptItemMeasure }
|
|
64
|
+
|
|
65
|
+
# @!attribute payment_mode
|
|
66
|
+
#
|
|
67
|
+
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentMode, nil]
|
|
68
|
+
optional :payment_mode, enum: -> { Yoomoney::ReceiptItemPaymentMode }
|
|
69
|
+
|
|
70
|
+
# @!attribute payment_subject
|
|
71
|
+
#
|
|
72
|
+
# @return [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject, nil]
|
|
73
|
+
optional :payment_subject, enum: -> { Yoomoney::ReceiptItemPaymentSubject }
|
|
74
|
+
|
|
75
|
+
# @!attribute payment_subject_industry_details
|
|
76
|
+
#
|
|
77
|
+
# @return [Array<Yoomoney::Models::IndustryDetails>, nil]
|
|
78
|
+
optional :payment_subject_industry_details,
|
|
79
|
+
-> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::IndustryDetails] }
|
|
80
|
+
|
|
81
|
+
# @!attribute planned_status
|
|
82
|
+
#
|
|
83
|
+
# @return [Integer, nil]
|
|
84
|
+
optional :planned_status, Integer
|
|
85
|
+
|
|
86
|
+
# @!attribute product_code
|
|
87
|
+
#
|
|
88
|
+
# @return [String, nil]
|
|
89
|
+
optional :product_code, String
|
|
90
|
+
|
|
91
|
+
# @!method initialize(amount:, description:, quantity:, vat_code:, country_of_origin_code: nil, customs_declaration_number: nil, excise: nil, mark_code_info: nil, mark_mode: nil, mark_quantity: nil, measure: nil, payment_mode: nil, payment_subject: nil, payment_subject_industry_details: nil, planned_status: nil, product_code: nil)
|
|
92
|
+
# @param amount [Yoomoney::Models::MonetaryAmount] Сумма.
|
|
93
|
+
#
|
|
94
|
+
# @param description [String] Название товара.
|
|
95
|
+
#
|
|
96
|
+
# @param quantity [Float] Количество.
|
|
97
|
+
#
|
|
98
|
+
# @param vat_code [Integer] Ставка НДС.
|
|
99
|
+
#
|
|
100
|
+
# @param country_of_origin_code [String]
|
|
101
|
+
#
|
|
102
|
+
# @param customs_declaration_number [String]
|
|
103
|
+
#
|
|
104
|
+
# @param excise [String]
|
|
105
|
+
#
|
|
106
|
+
# @param mark_code_info [Yoomoney::Models::MarkCodeInfo]
|
|
107
|
+
#
|
|
108
|
+
# @param mark_mode [String]
|
|
109
|
+
#
|
|
110
|
+
# @param mark_quantity [Yoomoney::Models::MarkQuantity]
|
|
111
|
+
#
|
|
112
|
+
# @param measure [Symbol, Yoomoney::Models::ReceiptItemMeasure]
|
|
113
|
+
#
|
|
114
|
+
# @param payment_mode [Symbol, Yoomoney::Models::ReceiptItemPaymentMode]
|
|
115
|
+
#
|
|
116
|
+
# @param payment_subject [Symbol, Yoomoney::Models::ReceiptItemPaymentSubject]
|
|
117
|
+
#
|
|
118
|
+
# @param payment_subject_industry_details [Array<Yoomoney::Models::IndustryDetails>]
|
|
119
|
+
#
|
|
120
|
+
# @param planned_status [Integer]
|
|
121
|
+
#
|
|
122
|
+
# @param product_code [String]
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
data/lib/yoomoney/models.rb
CHANGED
|
@@ -41,6 +41,10 @@ module Yoomoney
|
|
|
41
41
|
|
|
42
42
|
Airline = Yoomoney::Models::Airline
|
|
43
43
|
|
|
44
|
+
AirlineLeg = Yoomoney::Models::AirlineLeg
|
|
45
|
+
|
|
46
|
+
AirlinePassenger = Yoomoney::Models::AirlinePassenger
|
|
47
|
+
|
|
44
48
|
B2bSberbankCalculatedVatData = Yoomoney::Models::B2bSberbankCalculatedVatData
|
|
45
49
|
|
|
46
50
|
B2bSberbankMixedVatData = Yoomoney::Models::B2bSberbankMixedVatData
|
|
@@ -171,6 +175,8 @@ module Yoomoney
|
|
|
171
175
|
|
|
172
176
|
ReceiptDataCustomer = Yoomoney::Models::ReceiptDataCustomer
|
|
173
177
|
|
|
178
|
+
ReceiptDataItem = Yoomoney::Models::ReceiptDataItem
|
|
179
|
+
|
|
174
180
|
ReceiptItemAgentType = Yoomoney::Models::ReceiptItemAgentType
|
|
175
181
|
|
|
176
182
|
ReceiptItemMeasure = Yoomoney::Models::ReceiptItemMeasure
|
data/lib/yoomoney/version.rb
CHANGED
data/lib/yoomoney.rb
CHANGED
|
@@ -64,8 +64,11 @@ require_relative "yoomoney/models/confirmation_data"
|
|
|
64
64
|
require_relative "yoomoney/models/payout_destination"
|
|
65
65
|
require_relative "yoomoney/models/payout_destination_data"
|
|
66
66
|
require_relative "yoomoney/models/receipt_item_supplier"
|
|
67
|
+
require_relative "yoomoney/models/receipt_data_item"
|
|
67
68
|
require_relative "yoomoney/models/refund_method"
|
|
68
69
|
require_relative "yoomoney/models/airline"
|
|
70
|
+
require_relative "yoomoney/models/airline_leg"
|
|
71
|
+
require_relative "yoomoney/models/airline_passenger"
|
|
69
72
|
require_relative "yoomoney/models/b2b_sberbank_calculated_vat_data"
|
|
70
73
|
require_relative "yoomoney/models/b2b_sberbank_mixed_vat_data"
|
|
71
74
|
require_relative "yoomoney/models/b2b_sberbank_untaxed_vat_data"
|
data/rbi/yoomoney/client.rbi
CHANGED
|
@@ -51,6 +51,11 @@ module Yoomoney
|
|
|
51
51
|
sig { returns(Yoomoney::Resources::Me) }
|
|
52
52
|
attr_reader :me
|
|
53
53
|
|
|
54
|
+
# @api private
|
|
55
|
+
sig { override.returns(T::Hash[String, String]) }
|
|
56
|
+
private def auth_headers
|
|
57
|
+
end
|
|
58
|
+
|
|
54
59
|
# Creates and returns a new client for interacting with the API.
|
|
55
60
|
sig do
|
|
56
61
|
params(
|