yoomoney 0.1.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +5 -2
  4. data/lib/yoomoney/client.rb +16 -4
  5. data/lib/yoomoney/internal/transport/base_client.rb +6 -0
  6. data/lib/yoomoney/models/airline.rb +6 -50
  7. data/lib/yoomoney/models/airline_leg.rb +33 -0
  8. data/lib/yoomoney/models/airline_passenger.rb +21 -0
  9. data/lib/yoomoney/models/payment_deal_info.rb +3 -19
  10. data/lib/yoomoney/models/receipt_create_params.rb +2 -120
  11. data/lib/yoomoney/models/receipt_data.rb +3 -123
  12. data/lib/yoomoney/models/receipt_data_item.rb +125 -0
  13. data/lib/yoomoney/models/refund.rb +3 -20
  14. data/lib/yoomoney/models/refund_create_params.rb +3 -20
  15. data/lib/yoomoney/models/settlement_payment_item.rb +21 -0
  16. data/lib/yoomoney/models/settlement_refund_item.rb +21 -0
  17. data/lib/yoomoney/models.rb +10 -0
  18. data/lib/yoomoney/version.rb +1 -1
  19. data/lib/yoomoney.rb +5 -0
  20. data/rbi/yoomoney/client.rbi +11 -4
  21. data/rbi/yoomoney/internal/transport/base_client.rbi +5 -0
  22. data/rbi/yoomoney/models/airline.rbi +8 -84
  23. data/rbi/yoomoney/models/airline_leg.rbi +56 -0
  24. data/rbi/yoomoney/models/airline_passenger.rbi +28 -0
  25. data/rbi/yoomoney/models/payment_deal_info.rbi +3 -45
  26. data/rbi/yoomoney/models/receipt_create_params.rbi +1 -159
  27. data/rbi/yoomoney/models/receipt_data.rbi +3 -185
  28. data/rbi/yoomoney/models/receipt_data_item.rbi +185 -0
  29. data/rbi/yoomoney/models/refund.rbi +3 -44
  30. data/rbi/yoomoney/models/refund_create_params.rbi +3 -52
  31. data/rbi/yoomoney/models/settlement_payment_item.rbi +41 -0
  32. data/rbi/yoomoney/models/settlement_refund_item.rbi +41 -0
  33. data/rbi/yoomoney/models.rbi +10 -0
  34. data/sig/yoomoney/client.rbs +2 -0
  35. data/sig/yoomoney/internal/transport/base_client.rbs +2 -0
  36. data/sig/yoomoney/models/airline.rbs +12 -58
  37. data/sig/yoomoney/models/airline_leg.rbs +37 -0
  38. data/sig/yoomoney/models/airline_passenger.rbs +15 -0
  39. data/sig/yoomoney/models/payment_deal_info.rbs +4 -29
  40. data/sig/yoomoney/models/receipt_create_params.rbs +7 -119
  41. data/sig/yoomoney/models/receipt_data.rbs +4 -128
  42. data/sig/yoomoney/models/receipt_data_item.rbs +127 -0
  43. data/sig/yoomoney/models/refund.rbs +4 -26
  44. data/sig/yoomoney/models/refund_create_params.rbs +4 -28
  45. data/sig/yoomoney/models/settlement_payment_item.rbs +25 -0
  46. data/sig/yoomoney/models/settlement_refund_item.rbs +25 -0
  47. data/sig/yoomoney/models.rbs +10 -0
  48. metadata +17 -2
@@ -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
@@ -145,32 +145,15 @@ module Yoomoney
145
145
  # @!attribute refund_settlements
146
146
  # Данные о распределении денег.
147
147
  #
148
- # @return [Array<Yoomoney::Models::Refund::Deal::RefundSettlement>]
149
- required :refund_settlements,
150
- -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::Refund::Deal::RefundSettlement] }
148
+ # @return [Array<Yoomoney::Models::SettlementRefundItem>]
149
+ required :refund_settlements, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::SettlementRefundItem] }
151
150
 
152
151
  # @!method initialize(id:, refund_settlements:)
153
152
  # Данные о сделке.
154
153
  #
155
154
  # @param id [String] Идентификатор сделки.
156
155
  #
157
- # @param refund_settlements [Array<Yoomoney::Models::Refund::Deal::RefundSettlement>] Данные о распределении денег.
158
-
159
- class RefundSettlement < Yoomoney::Internal::Type::BaseModel
160
- # @!attribute amount
161
- #
162
- # @return [Yoomoney::Models::MonetaryAmount]
163
- required :amount, -> { Yoomoney::MonetaryAmount }
164
-
165
- # @!attribute type
166
- #
167
- # @return [Symbol, Yoomoney::Models::SettlementItemType]
168
- required :type, enum: -> { Yoomoney::SettlementItemType }
169
-
170
- # @!method initialize(amount:, type:)
171
- # @param amount [Yoomoney::Models::MonetaryAmount]
172
- # @param type [Symbol, Yoomoney::Models::SettlementItemType]
173
- end
156
+ # @param refund_settlements [Array<Yoomoney::Models::SettlementRefundItem>] Данные о распределении денег.
174
157
  end
175
158
 
176
159
  # @see Yoomoney::Models::Refund#refund_authorization_details
@@ -91,30 +91,13 @@ module Yoomoney
91
91
  # @!attribute refund_settlements
92
92
  # Данные о распределении денег.
93
93
  #
94
- # @return [Array<Yoomoney::Models::RefundCreateParams::Deal::RefundSettlement>]
95
- required :refund_settlements,
96
- -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::RefundCreateParams::Deal::RefundSettlement] }
94
+ # @return [Array<Yoomoney::Models::SettlementRefundItem>]
95
+ required :refund_settlements, -> { Yoomoney::Internal::Type::ArrayOf[Yoomoney::SettlementRefundItem] }
97
96
 
98
97
  # @!method initialize(refund_settlements:)
99
98
  # Данные о сделке.
100
99
  #
101
- # @param refund_settlements [Array<Yoomoney::Models::RefundCreateParams::Deal::RefundSettlement>] Данные о распределении денег.
102
-
103
- class RefundSettlement < Yoomoney::Internal::Type::BaseModel
104
- # @!attribute amount
105
- #
106
- # @return [Yoomoney::Models::MonetaryAmount]
107
- required :amount, -> { Yoomoney::MonetaryAmount }
108
-
109
- # @!attribute type
110
- #
111
- # @return [Symbol, Yoomoney::Models::SettlementItemType]
112
- required :type, enum: -> { Yoomoney::SettlementItemType }
113
-
114
- # @!method initialize(amount:, type:)
115
- # @param amount [Yoomoney::Models::MonetaryAmount]
116
- # @param type [Symbol, Yoomoney::Models::SettlementItemType]
117
- end
100
+ # @param refund_settlements [Array<Yoomoney::Models::SettlementRefundItem>] Данные о распределении денег.
118
101
  end
119
102
 
120
103
  class RefundMethodData < Yoomoney::Internal::Type::BaseModel
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Yoomoney
4
+ module Models
5
+ class SettlementPaymentItem < Yoomoney::Internal::Type::BaseModel
6
+ # @!attribute amount
7
+ #
8
+ # @return [Yoomoney::Models::MonetaryAmount]
9
+ required :amount, -> { Yoomoney::MonetaryAmount }
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, Yoomoney::Models::SettlementItemType]
14
+ required :type, enum: -> { Yoomoney::SettlementItemType }
15
+
16
+ # @!method initialize(amount:, type:)
17
+ # @param amount [Yoomoney::Models::MonetaryAmount]
18
+ # @param type [Symbol, Yoomoney::Models::SettlementItemType]
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Yoomoney
4
+ module Models
5
+ class SettlementRefundItem < Yoomoney::Internal::Type::BaseModel
6
+ # @!attribute amount
7
+ #
8
+ # @return [Yoomoney::Models::MonetaryAmount]
9
+ required :amount, -> { Yoomoney::MonetaryAmount }
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, Yoomoney::Models::SettlementItemType]
14
+ required :type, enum: -> { Yoomoney::SettlementItemType }
15
+
16
+ # @!method initialize(amount:, type:)
17
+ # @param amount [Yoomoney::Models::MonetaryAmount]
18
+ # @param type [Symbol, Yoomoney::Models::SettlementItemType]
19
+ end
20
+ end
21
+ end
@@ -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
@@ -219,6 +225,10 @@ module Yoomoney
219
225
 
220
226
  SettlementItemType = Yoomoney::Models::SettlementItemType
221
227
 
228
+ SettlementPaymentItem = Yoomoney::Models::SettlementPaymentItem
229
+
230
+ SettlementRefundItem = Yoomoney::Models::SettlementRefundItem
231
+
222
232
  TransferData = Yoomoney::Models::TransferData
223
233
 
224
234
  Webhook = Yoomoney::Models::Webhook
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yoomoney
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
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"
@@ -149,6 +152,8 @@ require_relative "yoomoney/models/sbp_bank_list_params"
149
152
  require_relative "yoomoney/models/sbp_bank_list_response"
150
153
  require_relative "yoomoney/models/settlement"
151
154
  require_relative "yoomoney/models/settlement_item_type"
155
+ require_relative "yoomoney/models/settlement_payment_item"
156
+ require_relative "yoomoney/models/settlement_refund_item"
152
157
  require_relative "yoomoney/models/webhook"
153
158
  require_relative "yoomoney/models/webhook_create_params"
154
159
  require_relative "yoomoney/models/webhook_delete_params"
@@ -10,11 +10,11 @@ module Yoomoney
10
10
 
11
11
  DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float)
12
12
 
13
- # HTTP Basic аутентификация клиента ЮKassa
13
+ # HTTP Basic аутентификация клиента ЮKassa (shopId)
14
14
  sig { returns(T.nilable(String)) }
15
15
  attr_reader :username
16
16
 
17
- # HTTP Basic аутентификация клиента ЮKassa
17
+ # HTTP Basic аутентификация клиента ЮKassa (секретный ключ)
18
18
  sig { returns(T.nilable(String)) }
19
19
  attr_reader :password
20
20
 
@@ -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(
@@ -64,9 +69,11 @@ module Yoomoney
64
69
  ).returns(T.attached_class)
65
70
  end
66
71
  def self.new(
67
- # HTTP Basic аутентификация клиента ЮKassa Defaults to `ENV["YOOMONEY_USERNAME"]`
72
+ # HTTP Basic аутентификация клиента ЮKassa (shopId) Defaults to
73
+ # `ENV["YOOMONEY_USERNAME"]`
68
74
  username: ENV["YOOMONEY_USERNAME"],
69
- # HTTP Basic аутентификация клиента ЮKassa Defaults to `ENV["YOOMONEY_PASSWORD"]`
75
+ # HTTP Basic аутентификация клиента ЮKassa (секретный ключ) Defaults to
76
+ # `ENV["YOOMONEY_PASSWORD"]`
70
77
  password: ENV["YOOMONEY_PASSWORD"],
71
78
  # Override the default base URL for the API, e.g.,
72
79
  # `"https://api.example.com/v2/"`. Defaults to `ENV["YOOMONEY_BASE_URL"]`
@@ -171,6 +171,11 @@ module Yoomoney
171
171
  )
172
172
  end
173
173
 
174
+ # @api private
175
+ sig { overridable.returns(T::Hash[String, String]) }
176
+ private def auth_headers
177
+ end
178
+
174
179
  # @api private
175
180
  sig { returns(String) }
176
181
  private def user_agent
@@ -12,17 +12,17 @@ module Yoomoney
12
12
  sig { params(booking_reference: String).void }
13
13
  attr_writer :booking_reference
14
14
 
15
- sig { returns(T.nilable(T::Array[Yoomoney::Airline::Leg])) }
15
+ sig { returns(T.nilable(T::Array[Yoomoney::AirlineLeg])) }
16
16
  attr_reader :legs
17
17
 
18
- sig { params(legs: T::Array[Yoomoney::Airline::Leg::OrHash]).void }
18
+ sig { params(legs: T::Array[Yoomoney::AirlineLeg::OrHash]).void }
19
19
  attr_writer :legs
20
20
 
21
- sig { returns(T.nilable(T::Array[Yoomoney::Airline::Passenger])) }
21
+ sig { returns(T.nilable(T::Array[Yoomoney::AirlinePassenger])) }
22
22
  attr_reader :passengers
23
23
 
24
24
  sig do
25
- params(passengers: T::Array[Yoomoney::Airline::Passenger::OrHash]).void
25
+ params(passengers: T::Array[Yoomoney::AirlinePassenger::OrHash]).void
26
26
  end
27
27
  attr_writer :passengers
28
28
 
@@ -35,8 +35,8 @@ module Yoomoney
35
35
  sig do
36
36
  params(
37
37
  booking_reference: String,
38
- legs: T::Array[Yoomoney::Airline::Leg::OrHash],
39
- passengers: T::Array[Yoomoney::Airline::Passenger::OrHash],
38
+ legs: T::Array[Yoomoney::AirlineLeg::OrHash],
39
+ passengers: T::Array[Yoomoney::AirlinePassenger::OrHash],
40
40
  ticket_number: String
41
41
  ).returns(T.attached_class)
42
42
  end
@@ -52,90 +52,14 @@ module Yoomoney
52
52
  override.returns(
53
53
  {
54
54
  booking_reference: String,
55
- legs: T::Array[Yoomoney::Airline::Leg],
56
- passengers: T::Array[Yoomoney::Airline::Passenger],
55
+ legs: T::Array[Yoomoney::AirlineLeg],
56
+ passengers: T::Array[Yoomoney::AirlinePassenger],
57
57
  ticket_number: String
58
58
  }
59
59
  )
60
60
  end
61
61
  def to_hash
62
62
  end
63
-
64
- class Leg < Yoomoney::Internal::Type::BaseModel
65
- OrHash =
66
- T.type_alias do
67
- T.any(Yoomoney::Airline::Leg, Yoomoney::Internal::AnyHash)
68
- end
69
-
70
- sig { returns(String) }
71
- attr_accessor :departure_airport
72
-
73
- sig { returns(String) }
74
- attr_accessor :departure_date
75
-
76
- sig { returns(String) }
77
- attr_accessor :destination_airport
78
-
79
- sig { returns(T.nilable(String)) }
80
- attr_reader :carrier_code
81
-
82
- sig { params(carrier_code: String).void }
83
- attr_writer :carrier_code
84
-
85
- sig do
86
- params(
87
- departure_airport: String,
88
- departure_date: String,
89
- destination_airport: String,
90
- carrier_code: String
91
- ).returns(T.attached_class)
92
- end
93
- def self.new(
94
- departure_airport:,
95
- departure_date:,
96
- destination_airport:,
97
- carrier_code: nil
98
- )
99
- end
100
-
101
- sig do
102
- override.returns(
103
- {
104
- departure_airport: String,
105
- departure_date: String,
106
- destination_airport: String,
107
- carrier_code: String
108
- }
109
- )
110
- end
111
- def to_hash
112
- end
113
- end
114
-
115
- class Passenger < Yoomoney::Internal::Type::BaseModel
116
- OrHash =
117
- T.type_alias do
118
- T.any(Yoomoney::Airline::Passenger, Yoomoney::Internal::AnyHash)
119
- end
120
-
121
- sig { returns(String) }
122
- attr_accessor :first_name
123
-
124
- sig { returns(String) }
125
- attr_accessor :last_name
126
-
127
- sig do
128
- params(first_name: String, last_name: String).returns(
129
- T.attached_class
130
- )
131
- end
132
- def self.new(first_name:, last_name:)
133
- end
134
-
135
- sig { override.returns({ first_name: String, last_name: String }) }
136
- def to_hash
137
- end
138
- end
139
63
  end
140
64
  end
141
65
  end
@@ -0,0 +1,56 @@
1
+ # typed: strong
2
+
3
+ module Yoomoney
4
+ module Models
5
+ class AirlineLeg < Yoomoney::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Yoomoney::AirlineLeg, Yoomoney::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :departure_airport
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :departure_date
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :destination_airport
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :carrier_code
22
+
23
+ sig { params(carrier_code: String).void }
24
+ attr_writer :carrier_code
25
+
26
+ sig do
27
+ params(
28
+ departure_airport: String,
29
+ departure_date: String,
30
+ destination_airport: String,
31
+ carrier_code: String
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ departure_airport:,
36
+ departure_date:,
37
+ destination_airport:,
38
+ carrier_code: nil
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ departure_airport: String,
46
+ departure_date: String,
47
+ destination_airport: String,
48
+ carrier_code: String
49
+ }
50
+ )
51
+ end
52
+ def to_hash
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Yoomoney
4
+ module Models
5
+ class AirlinePassenger < Yoomoney::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Yoomoney::AirlinePassenger, Yoomoney::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :first_name
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :last_name
16
+
17
+ sig do
18
+ params(first_name: String, last_name: String).returns(T.attached_class)
19
+ end
20
+ def self.new(first_name:, last_name:)
21
+ end
22
+
23
+ sig { override.returns({ first_name: String, last_name: String }) }
24
+ def to_hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -13,13 +13,13 @@ module Yoomoney
13
13
  attr_accessor :id
14
14
 
15
15
  # Данные о распределении денег.
16
- sig { returns(T::Array[Yoomoney::PaymentDealInfo::Settlement]) }
16
+ sig { returns(T::Array[Yoomoney::SettlementPaymentItem]) }
17
17
  attr_accessor :settlements
18
18
 
19
19
  sig do
20
20
  params(
21
21
  id: String,
22
- settlements: T::Array[Yoomoney::PaymentDealInfo::Settlement::OrHash]
22
+ settlements: T::Array[Yoomoney::SettlementPaymentItem::OrHash]
23
23
  ).returns(T.attached_class)
24
24
  end
25
25
  def self.new(
@@ -32,53 +32,11 @@ module Yoomoney
32
32
 
33
33
  sig do
34
34
  override.returns(
35
- {
36
- id: String,
37
- settlements: T::Array[Yoomoney::PaymentDealInfo::Settlement]
38
- }
35
+ { id: String, settlements: T::Array[Yoomoney::SettlementPaymentItem] }
39
36
  )
40
37
  end
41
38
  def to_hash
42
39
  end
43
-
44
- class Settlement < Yoomoney::Internal::Type::BaseModel
45
- OrHash =
46
- T.type_alias do
47
- T.any(
48
- Yoomoney::PaymentDealInfo::Settlement,
49
- Yoomoney::Internal::AnyHash
50
- )
51
- end
52
-
53
- sig { returns(Yoomoney::MonetaryAmount) }
54
- attr_reader :amount
55
-
56
- sig { params(amount: Yoomoney::MonetaryAmount::OrHash).void }
57
- attr_writer :amount
58
-
59
- sig { returns(Yoomoney::SettlementItemType::OrSymbol) }
60
- attr_accessor :type
61
-
62
- sig do
63
- params(
64
- amount: Yoomoney::MonetaryAmount::OrHash,
65
- type: Yoomoney::SettlementItemType::OrSymbol
66
- ).returns(T.attached_class)
67
- end
68
- def self.new(amount:, type:)
69
- end
70
-
71
- sig do
72
- override.returns(
73
- {
74
- amount: Yoomoney::MonetaryAmount,
75
- type: Yoomoney::SettlementItemType::OrSymbol
76
- }
77
- )
78
- end
79
- def to_hash
80
- end
81
- end
82
40
  end
83
41
  end
84
42
  end