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,240 @@
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 PaymentBeneficiaryRequest
17
+ # The beneficiary number type: iban for IBAN, bban for BBAN (please note that BBAN is not supported by any connector yet).
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
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'scheme_name' => :'scheme_name',
36
+ :'identification' => :'identification',
37
+ :'label' => :'label',
38
+ :'merchant_scheme_name' => :'merchant_scheme_name',
39
+ :'merchant_identification' => :'merchant_identification'
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ :'scheme_name' => :'String',
47
+ :'identification' => :'String',
48
+ :'label' => :'String',
49
+ :'merchant_scheme_name' => :'String',
50
+ :'merchant_identification' => :'String'
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ if attributes.has_key?(:'scheme_name')
63
+ self.scheme_name = attributes[:'scheme_name']
64
+ end
65
+
66
+ if attributes.has_key?(:'identification')
67
+ self.identification = attributes[:'identification']
68
+ end
69
+
70
+ if attributes.has_key?(:'label')
71
+ self.label = attributes[:'label']
72
+ end
73
+
74
+ if attributes.has_key?(:'merchant_scheme_name')
75
+ self.merchant_scheme_name = attributes[:'merchant_scheme_name']
76
+ end
77
+
78
+ if attributes.has_key?(:'merchant_identification')
79
+ self.merchant_identification = attributes[:'merchant_identification']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @scheme_name.nil?
88
+ invalid_properties.push('invalid value for "scheme_name", scheme_name cannot be nil.')
89
+ end
90
+
91
+ if @identification.nil?
92
+ invalid_properties.push('invalid value for "identification", identification cannot be nil.')
93
+ end
94
+
95
+ if @label.nil?
96
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @scheme_name.nil?
106
+ return false if @identification.nil?
107
+ return false if @label.nil?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ scheme_name == o.scheme_name &&
117
+ identification == o.identification &&
118
+ label == o.label &&
119
+ merchant_scheme_name == o.merchant_scheme_name &&
120
+ merchant_identification == o.merchant_identification
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Fixnum] Hash code
131
+ def hash
132
+ [scheme_name, identification, label, merchant_scheme_name, merchant_identification].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ if type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :BOOLEAN
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ temp_model = BudgeaClient.const_get(type).new
193
+ temp_model.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ next if value.nil?
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+
239
+ end
240
+ end
@@ -0,0 +1,246 @@
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 PaymentData
17
+ # ID of the bank connector to use to initiate the payment. The bank connector must be eligible to payments creation. The id_connector can be submitted later on if validated is false when you initiate the payment request.
18
+ attr_accessor :id_connector
19
+
20
+ # The redirect URL to use when building the validation URL. The provided URL must not contain any query parameter, rely on the client_state parameter for state management.
21
+ attr_accessor :client_redirect_uri
22
+
23
+ # Optional value that will be added as a state query parameter to the redirect URL after validation.
24
+ attr_accessor :client_state
25
+
26
+ attr_accessor :beneficiary
27
+
28
+ # The payment information.
29
+ attr_accessor :instructions
30
+
31
+ # Provide true to acknowledge payment validation at once. Otherwise, validation is deferred.
32
+ attr_accessor :validated
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id_connector' => :'id_connector',
38
+ :'client_redirect_uri' => :'client_redirect_uri',
39
+ :'client_state' => :'client_state',
40
+ :'beneficiary' => :'beneficiary',
41
+ :'instructions' => :'instructions',
42
+ :'validated' => :'validated'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ :'id_connector' => :'Integer',
50
+ :'client_redirect_uri' => :'String',
51
+ :'client_state' => :'String',
52
+ :'beneficiary' => :'PaymentBeneficiaryRequest',
53
+ :'instructions' => :'Array<PaymentInstructionRequest>',
54
+ :'validated' => :'BOOLEAN'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
+
66
+ if attributes.has_key?(:'id_connector')
67
+ self.id_connector = attributes[:'id_connector']
68
+ end
69
+
70
+ if attributes.has_key?(:'client_redirect_uri')
71
+ self.client_redirect_uri = attributes[:'client_redirect_uri']
72
+ end
73
+
74
+ if attributes.has_key?(:'client_state')
75
+ self.client_state = attributes[:'client_state']
76
+ end
77
+
78
+ if attributes.has_key?(:'beneficiary')
79
+ self.beneficiary = attributes[:'beneficiary']
80
+ end
81
+
82
+ if attributes.has_key?(:'instructions')
83
+ if (value = attributes[:'instructions']).is_a?(Array)
84
+ self.instructions = value
85
+ end
86
+ end
87
+
88
+ if attributes.has_key?(:'validated')
89
+ self.validated = attributes[:'validated']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if @client_redirect_uri.nil?
98
+ invalid_properties.push('invalid value for "client_redirect_uri", client_redirect_uri cannot be nil.')
99
+ end
100
+
101
+ if @instructions.nil?
102
+ invalid_properties.push('invalid value for "instructions", instructions cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @client_redirect_uri.nil?
112
+ return false if @instructions.nil?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ id_connector == o.id_connector &&
122
+ client_redirect_uri == o.client_redirect_uri &&
123
+ client_state == o.client_state &&
124
+ beneficiary == o.beneficiary &&
125
+ instructions == o.instructions &&
126
+ validated == o.validated
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Fixnum] Hash code
137
+ def hash
138
+ [id_connector, client_redirect_uri, client_state, beneficiary, instructions, validated].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.swagger_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :BOOLEAN
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ temp_model = BudgeaClient.const_get(type).new
199
+ temp_model.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ next if value.nil?
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+
245
+ end
246
+ end