budgea_client 5.3.8 → 5.4.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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -10
  3. data/README.md +14 -4
  4. data/budgea_openapi.json +329 -27
  5. data/config.json +1 -1
  6. data/docs/AuthenticationApi.md +62 -0
  7. data/docs/Connector.md +1 -0
  8. data/docs/ConnectorSource.md +7 -0
  9. data/docs/Field.md +2 -1
  10. data/docs/InlineResponse2005.md +1 -3
  11. data/docs/PFMApi.md +9 -12
  12. data/docs/Payment.md +15 -0
  13. data/docs/PaymentBeneficiary.md +13 -0
  14. data/docs/PaymentBeneficiaryRequest.md +12 -0
  15. data/docs/PaymentData.md +13 -0
  16. data/docs/PaymentErrorCode.md +7 -0
  17. data/docs/PaymentInstruction.md +12 -0
  18. data/docs/PaymentInstructionRequest.md +13 -0
  19. data/docs/PaymentRequest.md +13 -0
  20. data/docs/PaymentState.md +7 -0
  21. data/docs/PaymentsApi.md +61 -0
  22. data/lib/budgea_client.rb +9 -0
  23. data/lib/budgea_client/api/authentication_api.rb +60 -0
  24. data/lib/budgea_client/api/payments_api.rb +75 -0
  25. data/lib/budgea_client/api/pfm_api.rb +14 -26
  26. data/lib/budgea_client/models/connection.rb +2 -4
  27. data/lib/budgea_client/models/connector.rb +15 -4
  28. data/lib/budgea_client/models/connector_source.rb +79 -4
  29. data/lib/budgea_client/models/field.rb +18 -5
  30. data/lib/budgea_client/models/inline_response_200_5.rb +7 -37
  31. data/lib/budgea_client/models/payment.rb +255 -0
  32. data/lib/budgea_client/models/payment_beneficiary.rb +235 -0
  33. data/lib/budgea_client/models/payment_beneficiary_request.rb +240 -0
  34. data/lib/budgea_client/models/payment_data.rb +246 -0
  35. data/lib/budgea_client/models/payment_error_code.rb +44 -0
  36. data/lib/budgea_client/models/payment_instruction.rb +224 -0
  37. data/lib/budgea_client/models/payment_instruction_request.rb +254 -0
  38. data/lib/budgea_client/models/payment_request.rb +246 -0
  39. data/lib/budgea_client/models/payment_state.rb +35 -0
  40. data/lib/budgea_client/version.rb +1 -1
  41. data/spec/api/payments_api_spec.rb +46 -0
  42. data/spec/models/payment_beneficiary_request_spec.rb +65 -0
  43. data/spec/models/payment_beneficiary_spec.rb +35 -0
  44. data/spec/models/payment_data_spec.rb +71 -0
  45. data/spec/models/payment_error_code_spec.rb +35 -0
  46. data/spec/models/payment_instruction_request_spec.rb +35 -0
  47. data/spec/models/payment_instruction_spec.rb +35 -0
  48. data/spec/models/payment_request_spec.rb +71 -0
  49. data/spec/models/payment_spec.rb +35 -0
  50. data/spec/models/payment_state_spec.rb +35 -0
  51. metadata +42 -3
  52. data/pkg/budgea_client-5.3.7.gem +0 -0
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #Budgea API Documentation
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module BudgeaClient
16
+ class Payment
17
+ # The ID of the created payment request.
18
+ attr_accessor :id
19
+
20
+ attr_accessor :state
21
+
22
+ attr_accessor :error_code
23
+
24
+ # Error message in case of an error.
25
+ attr_accessor :error_description
26
+
27
+ # ID of the bank connector to use to initiate the payment.
28
+ attr_accessor :id_connector
29
+
30
+ # The URL that must be presented to the PSU to validate the payment request. The URL is only available after the transfer has been validated.
31
+ attr_accessor :validate_uri
32
+
33
+ # The validate_uri callback URL that was provided when configuring the transfer request.
34
+ attr_accessor :client_redirect_uri
35
+
36
+ # The list of payment instructions.
37
+ attr_accessor :instructions
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'id' => :'id',
43
+ :'state' => :'state',
44
+ :'error_code' => :'error_code',
45
+ :'error_description' => :'error_description',
46
+ :'id_connector' => :'id_connector',
47
+ :'validate_uri' => :'validate_uri',
48
+ :'client_redirect_uri' => :'client_redirect_uri',
49
+ :'instructions' => :'instructions'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ :'id' => :'Integer',
57
+ :'state' => :'String',
58
+ :'error_code' => :'String',
59
+ :'error_description' => :'String',
60
+ :'id_connector' => :'Integer',
61
+ :'validate_uri' => :'String',
62
+ :'client_redirect_uri' => :'String',
63
+ :'instructions' => :'Array<PaymentInstruction>'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
74
+
75
+ if attributes.has_key?(:'id')
76
+ self.id = attributes[:'id']
77
+ end
78
+
79
+ if attributes.has_key?(:'state')
80
+ self.state = attributes[:'state']
81
+ end
82
+
83
+ if attributes.has_key?(:'error_code')
84
+ self.error_code = attributes[:'error_code']
85
+ end
86
+
87
+ if attributes.has_key?(:'error_description')
88
+ self.error_description = attributes[:'error_description']
89
+ end
90
+
91
+ if attributes.has_key?(:'id_connector')
92
+ self.id_connector = attributes[:'id_connector']
93
+ end
94
+
95
+ if attributes.has_key?(:'validate_uri')
96
+ self.validate_uri = attributes[:'validate_uri']
97
+ end
98
+
99
+ if attributes.has_key?(:'client_redirect_uri')
100
+ self.client_redirect_uri = attributes[:'client_redirect_uri']
101
+ end
102
+
103
+ if attributes.has_key?(:'instructions')
104
+ if (value = attributes[:'instructions']).is_a?(Array)
105
+ self.instructions = value
106
+ end
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ id == o.id &&
129
+ state == o.state &&
130
+ error_code == o.error_code &&
131
+ error_description == o.error_description &&
132
+ id_connector == o.id_connector &&
133
+ validate_uri == o.validate_uri &&
134
+ client_redirect_uri == o.client_redirect_uri &&
135
+ instructions == o.instructions
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Fixnum] Hash code
146
+ def hash
147
+ [id, state, error_code, error_description, id_connector, validate_uri, client_redirect_uri, instructions].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ self.class.swagger_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !attributes[self.class.attribute_map[key]].nil?
163
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :DateTime
177
+ DateTime.parse(value)
178
+ when :Date
179
+ Date.parse(value)
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :BOOLEAN
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else # model
207
+ temp_model = BudgeaClient.const_get(type).new
208
+ temp_model.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+ end
@@ -0,0 +1,235 @@
1
+ =begin
2
+ #Budgea API Documentation
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module BudgeaClient
16
+ class PaymentBeneficiary
17
+ # The beneficiary number type: iban for IBAN, bban for BBAN.
18
+ attr_accessor :scheme_name
19
+
20
+ # The beneficiary account number, of type matching the scheme_name.
21
+ attr_accessor :identification
22
+
23
+ # Display name of the beneficiary.
24
+ attr_accessor :label
25
+
26
+ # For merchant beneficiaries, the type of identifier: siret, siren, rcs, rna.
27
+ attr_accessor :merchant_scheme_name
28
+
29
+ # For merchant beneficiaries, the identifier, of type matching the merchant_scheme_name.
30
+ attr_accessor :merchant_identification
31
+
32
+ # The BIC of the beneficiary if it could be determined from the IBAN, null otherwise.
33
+ attr_accessor :bic
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'scheme_name' => :'scheme_name',
39
+ :'identification' => :'identification',
40
+ :'label' => :'label',
41
+ :'merchant_scheme_name' => :'merchant_scheme_name',
42
+ :'merchant_identification' => :'merchant_identification',
43
+ :'bic' => :'bic'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'scheme_name' => :'String',
51
+ :'identification' => :'String',
52
+ :'label' => :'String',
53
+ :'merchant_scheme_name' => :'String',
54
+ :'merchant_identification' => :'String',
55
+ :'bic' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'scheme_name')
68
+ self.scheme_name = attributes[:'scheme_name']
69
+ end
70
+
71
+ if attributes.has_key?(:'identification')
72
+ self.identification = attributes[:'identification']
73
+ end
74
+
75
+ if attributes.has_key?(:'label')
76
+ self.label = attributes[:'label']
77
+ end
78
+
79
+ if attributes.has_key?(:'merchant_scheme_name')
80
+ self.merchant_scheme_name = attributes[:'merchant_scheme_name']
81
+ end
82
+
83
+ if attributes.has_key?(:'merchant_identification')
84
+ self.merchant_identification = attributes[:'merchant_identification']
85
+ end
86
+
87
+ if attributes.has_key?(:'bic')
88
+ self.bic = attributes[:'bic']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ scheme_name == o.scheme_name &&
111
+ identification == o.identification &&
112
+ label == o.label &&
113
+ merchant_scheme_name == o.merchant_scheme_name &&
114
+ merchant_identification == o.merchant_identification &&
115
+ bic == o.bic
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Fixnum] Hash code
126
+ def hash
127
+ [scheme_name, identification, label, merchant_scheme_name, merchant_identification, bic].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.swagger_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Deserializes the data based on type
151
+ # @param string type Data type
152
+ # @param string value Value to be deserialized
153
+ # @return [Object] Deserialized data
154
+ def _deserialize(type, value)
155
+ case type.to_sym
156
+ when :DateTime
157
+ DateTime.parse(value)
158
+ when :Date
159
+ Date.parse(value)
160
+ when :String
161
+ value.to_s
162
+ when :Integer
163
+ value.to_i
164
+ when :Float
165
+ value.to_f
166
+ when :BOOLEAN
167
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
168
+ true
169
+ else
170
+ false
171
+ end
172
+ when :Object
173
+ # generic object (usually a Hash), return directly
174
+ value
175
+ when /\AArray<(?<inner_type>.+)>\z/
176
+ inner_type = Regexp.last_match[:inner_type]
177
+ value.map { |v| _deserialize(inner_type, v) }
178
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
179
+ k_type = Regexp.last_match[:k_type]
180
+ v_type = Regexp.last_match[:v_type]
181
+ {}.tap do |hash|
182
+ value.each do |k, v|
183
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
184
+ end
185
+ end
186
+ else # model
187
+ temp_model = BudgeaClient.const_get(type).new
188
+ temp_model.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ next if value.nil?
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+ end