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,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 PaymentRequest
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
@@ -0,0 +1,35 @@
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 PaymentState
17
+
18
+ CREATED = 'created'.freeze
19
+ VALIDATING = 'validating'.freeze
20
+ ERROR = 'error'.freeze
21
+ PENDING = 'pending'.freeze
22
+ REJECTED = 'rejected'.freeze
23
+ DONE = 'done'.freeze
24
+ EXPIRED = 'expired'.freeze
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def build_from_hash(value)
30
+ constantValues = PaymentState.constants.select { |c| PaymentState::const_get(c) == value }
31
+ raise "Invalid ENUM value #{value} for class #PaymentState" if constantValues.empty?
32
+ value
33
+ end
34
+ end
35
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.19
11
11
  =end
12
12
 
13
13
  module BudgeaClient
14
- VERSION = '5.3.8'
14
+ VERSION = '5.4.0'
15
15
  end
@@ -0,0 +1,46 @@
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 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for BudgeaClient::PaymentsApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'PaymentsApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = BudgeaClient::PaymentsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of PaymentsApi' do
30
+ it 'should create an instance of PaymentsApi' do
31
+ expect(@instance).to be_instance_of(BudgeaClient::PaymentsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for payments_post
36
+ # Create and validate a payment request
37
+ # @param payment_data
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Payment]
40
+ describe 'payments_post test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ end
@@ -0,0 +1,65 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for BudgeaClient::PaymentBeneficiaryRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'PaymentBeneficiaryRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = BudgeaClient::PaymentBeneficiaryRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of PaymentBeneficiaryRequest' do
31
+ it 'should create an instance of PaymentBeneficiaryRequest' do
32
+ expect(@instance).to be_instance_of(BudgeaClient::PaymentBeneficiaryRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "scheme_name"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "identification"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "label"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "merchant_scheme_name"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "merchant_identification"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,35 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for BudgeaClient::PaymentBeneficiary
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'PaymentBeneficiary' do
21
+ before do
22
+ # run before each test
23
+ @instance = BudgeaClient::PaymentBeneficiary.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of PaymentBeneficiary' do
31
+ it 'should create an instance of PaymentBeneficiary' do
32
+ expect(@instance).to be_instance_of(BudgeaClient::PaymentBeneficiary)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,71 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for BudgeaClient::PaymentData
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'PaymentData' do
21
+ before do
22
+ # run before each test
23
+ @instance = BudgeaClient::PaymentData.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of PaymentData' do
31
+ it 'should create an instance of PaymentData' do
32
+ expect(@instance).to be_instance_of(BudgeaClient::PaymentData)
33
+ end
34
+ end
35
+ describe 'test attribute "id_connector"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "client_redirect_uri"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "client_state"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "beneficiary"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "instructions"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "validated"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ end