bb_payments 0.1.1

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 (140) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +82 -0
  4. data/README.md +391 -0
  5. data/Rakefile +8 -0
  6. data/bb_payments.gemspec +30 -0
  7. data/docs/BankSlipsApi.md +178 -0
  8. data/docs/BarcodeCollectionFormsIDResponseObject.md +6 -0
  9. data/docs/BarcodeCollectionFormsIDResponseObjectListaGuiaCodigoBarra.md +10 -0
  10. data/docs/BarcodeCollectionFormsIDResponseObjectListaOcorrencia.md +9 -0
  11. data/docs/BarcodeCollectionFormsRequestObject.md +12 -0
  12. data/docs/BarcodecollectionformsCollectionFormDetailsList.md +12 -0
  13. data/docs/BatchtransfersPaymentsList.md +22 -0
  14. data/docs/BatchtransferscancelPaymentIds.md +7 -0
  15. data/docs/Body.md +13 -0
  16. data/docs/CancelApi.md +63 -0
  17. data/docs/CollectionFormsApi.md +184 -0
  18. data/docs/Error.md +7 -0
  19. data/docs/ErrorErrors.md +8 -0
  20. data/docs/ErrorOAuthUnauthorized.md +10 -0
  21. data/docs/ErrorOAuthUnauthorizedAttributes.md +7 -0
  22. data/docs/InlineResponse200.md +13 -0
  23. data/docs/InlineResponse2001.md +29 -0
  24. data/docs/InlineResponse2001OcurrencesList.md +9 -0
  25. data/docs/InlineResponse2002.md +12 -0
  26. data/docs/InlineResponse2002PaymentsList.md +26 -0
  27. data/docs/InlineResponse2003.md +26 -0
  28. data/docs/InlineResponse2003ListaBoleto.md +24 -0
  29. data/docs/InlineResponse2003ListaDevolucao.md +9 -0
  30. data/docs/InlineResponse200PaymentsList.md +15 -0
  31. data/docs/InlineResponse201.md +13 -0
  32. data/docs/InlineResponse2011.md +13 -0
  33. data/docs/InlineResponse2011PaymentsList.md +16 -0
  34. data/docs/InlineResponse201PaymentsList.md +26 -0
  35. data/docs/InlineResponse400.md +7 -0
  36. data/docs/InlineResponse401.md +10 -0
  37. data/docs/ReturnedsApi.md +78 -0
  38. data/docs/RootTypeForBankSlipList.md +29 -0
  39. data/docs/RootTypeForBankSlipsBatchPayment.md +12 -0
  40. data/docs/RootTypeForBankSlipsBatchPaymentResponseObject.md +12 -0
  41. data/docs/RootTypeForBatchTransferGETResponseObject.md +9 -0
  42. data/docs/RootTypeForBatchTransferPaymentsListGET.md +21 -0
  43. data/docs/RootTypeForBatchTransfersCancelPaymentsListObject.md +10 -0
  44. data/docs/RootTypeForBatchTransfersCancelRequestObject.md +12 -0
  45. data/docs/RootTypeForBatchTransfersCancelResponseObject.md +7 -0
  46. data/docs/RootTypeForReturnedPaymentsDetails.md +33 -0
  47. data/docs/RootTypeForReturnedPaymentsResponseObject.md +10 -0
  48. data/docs/RootTypeForSlipsDetailsObject.md +23 -0
  49. data/docs/TransfersApi.md +309 -0
  50. data/lib/bb_payments/api/base.rb +10 -0
  51. data/lib/bb_payments/api/base_api.rb +63 -0
  52. data/lib/bb_payments/api/batch_payments_api.rb +50 -0
  53. data/lib/bb_payments/api/payments.rb +114 -0
  54. data/lib/bb_payments/api/transfers.rb +33 -0
  55. data/lib/bb_payments/api/transfers_pix.rb +52 -0
  56. data/lib/bb_payments/api_client.rb +414 -0
  57. data/lib/bb_payments/api_error.rb +57 -0
  58. data/lib/bb_payments/configuration.rb +246 -0
  59. data/lib/bb_payments/models/base_model.rb +177 -0
  60. data/lib/bb_payments/models/batch_pix_body.rb +30 -0
  61. data/lib/bb_payments/models/batch_pix_response.rb +69 -0
  62. data/lib/bb_payments/models/batch_transfers_body.rb +30 -0
  63. data/lib/bb_payments/models/batch_transfers_response.rb +64 -0
  64. data/lib/bb_payments/models/batchtransfers_payments_list.rb +362 -0
  65. data/lib/bb_payments/models/batchtransferscancel_payment_ids.rb +212 -0
  66. data/lib/bb_payments/models/body.rb +274 -0
  67. data/lib/bb_payments/models/error.rb +210 -0
  68. data/lib/bb_payments/models/error_errors.rb +227 -0
  69. data/lib/bb_payments/models/error_o_auth_unauthorized.rb +257 -0
  70. data/lib/bb_payments/models/error_o_auth_unauthorized_attributes.rb +213 -0
  71. data/lib/bb_payments/models/find_batch_payment.rb +93 -0
  72. data/lib/bb_payments/models/find_batch_response.rb +71 -0
  73. data/lib/bb_payments/models/inline_response_200.rb +270 -0
  74. data/lib/bb_payments/models/inline_response_200_1.rb +430 -0
  75. data/lib/bb_payments/models/inline_response_200_1_ocurrences_list.rb +227 -0
  76. data/lib/bb_payments/models/inline_response_200_2.rb +260 -0
  77. data/lib/bb_payments/models/inline_response_200_2_payments_list.rb +399 -0
  78. data/lib/bb_payments/models/inline_response_200_3.rb +487 -0
  79. data/lib/bb_payments/models/inline_response_200_3_lista_boleto.rb +377 -0
  80. data/lib/bb_payments/models/inline_response_200_3_lista_devolucao.rb +227 -0
  81. data/lib/bb_payments/models/inline_response_200_payments_list.rb +289 -0
  82. data/lib/bb_payments/models/inline_response_201.rb +270 -0
  83. data/lib/bb_payments/models/inline_response_201_1.rb +270 -0
  84. data/lib/bb_payments/models/inline_response_201_1_payments_list.rb +299 -0
  85. data/lib/bb_payments/models/inline_response_201_payments_list.rb +399 -0
  86. data/lib/bb_payments/models/inline_response_400.rb +210 -0
  87. data/lib/bb_payments/models/inline_response_401.rb +257 -0
  88. data/lib/bb_payments/models/root_type_for_bank_slip_list.rb +430 -0
  89. data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment.rb +270 -0
  90. data/lib/bb_payments/models/root_type_for_bank_slips_batch_payment_response_object.rb +260 -0
  91. data/lib/bb_payments/models/root_type_for_batch_transfer_get_response_object.rb +230 -0
  92. data/lib/bb_payments/models/root_type_for_batch_transfer_payments_list_get.rb +348 -0
  93. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_payments_list_object.rb +238 -0
  94. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_request_object.rb +275 -0
  95. data/lib/bb_payments/models/root_type_for_batch_transfers_cancel_response_object.rb +210 -0
  96. data/lib/bb_payments/models/root_type_for_returned_payments_details.rb +468 -0
  97. data/lib/bb_payments/models/root_type_for_returned_payments_response_object.rb +240 -0
  98. data/lib/bb_payments/models/root_type_for_slips_details_object.rb +408 -0
  99. data/lib/bb_payments/models/transfer_base.rb +128 -0
  100. data/lib/bb_payments/models/transfer_pix.rb +34 -0
  101. data/lib/bb_payments/models/transfer_pix_base.rb +146 -0
  102. data/lib/bb_payments/version.rb +3 -0
  103. data/lib/bb_payments.rb +85 -0
  104. data/spec/api/batch_payments_api_spec.rb +113 -0
  105. data/spec/api_client_spec.rb +225 -0
  106. data/spec/base_object_spec.rb +109 -0
  107. data/spec/configuration_spec.rb +41 -0
  108. data/spec/models/body_spec.rb +76 -0
  109. data/spec/models/error_errors_spec.rb +46 -0
  110. data/spec/models/error_o_auth_unauthorized_attributes_spec.rb +40 -0
  111. data/spec/models/error_o_auth_unauthorized_spec.rb +58 -0
  112. data/spec/models/error_spec.rb +40 -0
  113. data/spec/models/inline_response_200_1_ocurrences_list_spec.rb +52 -0
  114. data/spec/models/inline_response_200_1_spec.rb +172 -0
  115. data/spec/models/inline_response_200_2_payments_list_spec.rb +154 -0
  116. data/spec/models/inline_response_200_2_spec.rb +70 -0
  117. data/spec/models/inline_response_200_3_lista_boleto_spec.rb +142 -0
  118. data/spec/models/inline_response_200_3_lista_devolucao_spec.rb +52 -0
  119. data/spec/models/inline_response_200_3_spec.rb +154 -0
  120. data/spec/models/inline_response_200_payments_list_spec.rb +88 -0
  121. data/spec/models/inline_response_200_spec.rb +76 -0
  122. data/spec/models/inline_response_201_1_payments_list_spec.rb +94 -0
  123. data/spec/models/inline_response_201_1_spec.rb +76 -0
  124. data/spec/models/inline_response_201_payments_list_spec.rb +154 -0
  125. data/spec/models/inline_response_201_spec.rb +76 -0
  126. data/spec/models/inline_response_400_spec.rb +40 -0
  127. data/spec/models/inline_response_401_spec.rb +58 -0
  128. data/spec/models/root_type_for_bank_slip_list_spec.rb +172 -0
  129. data/spec/models/root_type_for_bank_slips_batch_payment_response_object_spec.rb +70 -0
  130. data/spec/models/root_type_for_bank_slips_batch_payment_spec.rb +70 -0
  131. data/spec/models/root_type_for_batch_transfer_get_response_object_spec.rb +52 -0
  132. data/spec/models/root_type_for_batch_transfer_payments_list_get_spec.rb +124 -0
  133. data/spec/models/root_type_for_batch_transfers_cancel_payments_list_object_spec.rb +58 -0
  134. data/spec/models/root_type_for_batch_transfers_cancel_request_object_spec.rb +70 -0
  135. data/spec/models/root_type_for_batch_transfers_cancel_response_object_spec.rb +40 -0
  136. data/spec/models/root_type_for_returned_payments_details_spec.rb +196 -0
  137. data/spec/models/root_type_for_returned_payments_response_object_spec.rb +58 -0
  138. data/spec/models/root_type_for_slips_details_object_spec.rb +136 -0
  139. data/spec/spec_helper.rb +110 -0
  140. metadata +292 -0
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Payments-VPN
3
+
4
+ #Esta API fornece os serviços de pagamento do Banco do Brasil.
5
+
6
+ OpenAPI spec version: 3.5
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.24
10
+ =end
11
+
12
+ module BancoBrasilPayments
13
+ class Configuration
14
+ # Defines url scheme
15
+ attr_accessor :scheme
16
+
17
+ # Defines url host
18
+ attr_accessor :host
19
+
20
+ # Defines url for oauth
21
+ attr_accessor :oauth_host
22
+
23
+ # Defines url base path
24
+ attr_accessor :base_path
25
+
26
+ # Defines API keys used with API Key authentications.
27
+ #
28
+ # @return [Hash] key: parameter name, value: parameter value (API key)
29
+ #
30
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
31
+ # config.api_key['api_key'] = 'xxx'
32
+ attr_accessor :api_key
33
+
34
+ # Defines API key prefixes used with API Key authentications.
35
+ #
36
+ # @return [Hash] key: parameter name, value: API key prefix
37
+ #
38
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
39
+ # config.api_key_prefix['api_key'] = 'Token'
40
+ attr_accessor :api_key_prefix
41
+
42
+ # Chave de acesso do aplicativo do desenvolvedor.
43
+ # Esta chave é única e obtida no Portal “BB for Developers”
44
+ # Usada para identificar as requisições da aplicação do desenvolvedor.
45
+ attr_accessor :gw_app_key
46
+
47
+ # Defines the username used with HTTP basic authentication.
48
+ #
49
+ # @return [String]
50
+ attr_accessor :username
51
+
52
+ # Defines the password used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :password
56
+
57
+ # Defines the access token (Bearer) used with OAuth2.
58
+ attr_accessor :access_token
59
+
60
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
61
+ # details will be logged with `logger.debug` (see the `logger` attribute).
62
+ # Default to false.
63
+ #
64
+ # @return [true, false]
65
+ attr_accessor :debugging
66
+
67
+ # Defines the logger used for debugging.
68
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
69
+ #
70
+ # @return [#debug]
71
+ attr_accessor :logger
72
+
73
+ # Defines the temporary folder to store downloaded files
74
+ # (for API endpoints that have file response).
75
+ # Default to use `Tempfile`.
76
+ #
77
+ # @return [String]
78
+ attr_accessor :temp_folder_path
79
+
80
+ # The time limit for HTTP request in seconds.
81
+ # Default to 0 (never times out).
82
+ attr_accessor :timeout
83
+
84
+ # Set this to false to skip client side validation in the operation.
85
+ # Default to true.
86
+ # @return [true, false]
87
+ attr_accessor :client_side_validation
88
+
89
+ ### TLS/SSL setting
90
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
91
+ # Default to true.
92
+ #
93
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
94
+ #
95
+ # @return [true, false]
96
+ attr_accessor :verify_ssl
97
+
98
+ ### TLS/SSL setting
99
+ # Set this to false to skip verifying SSL host name
100
+ # Default to true.
101
+ #
102
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
103
+ #
104
+ # @return [true, false]
105
+ attr_accessor :verify_ssl_host
106
+
107
+ ### TLS/SSL setting
108
+ # Set this to customize the certificate file to verify the peer.
109
+ #
110
+ # @return [String] the path to the certificate file
111
+ #
112
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
113
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
114
+ attr_accessor :ssl_ca_cert
115
+
116
+ ### TLS/SSL setting
117
+ # Client certificate file (for client certificate)
118
+ attr_accessor :cert_file
119
+
120
+ ### TLS/SSL setting
121
+ # Client private key file (for client certificate)
122
+ attr_accessor :key_file
123
+
124
+ ### TLS/SSL setting
125
+ # Client private key passphrase (for client certificate)
126
+ attr_accessor :ssl_key_passwd
127
+
128
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
129
+ # Default to nil.
130
+ #
131
+ # @see The params_encoding option of Ethon. Related source code:
132
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
133
+ attr_accessor :params_encoding
134
+
135
+ attr_accessor :inject_format
136
+
137
+ attr_accessor :force_ending_format
138
+
139
+ attr_accessor :access_token_scopes
140
+
141
+ attr_accessor :app_key_name
142
+
143
+ def initialize
144
+ @scheme = 'https'
145
+ @app_key_name = 'gw-app-key'
146
+ @host = 'api-ip.bb.com.br'
147
+ @oauth_host = 'oauth.bb.com.br'
148
+ @base_path = 'pagamentos-lote/v1'
149
+ @api_key = {}
150
+ @api_key_prefix = {}
151
+ @timeout = 0
152
+ @client_side_validation = true
153
+ @verify_ssl = true
154
+ @verify_ssl_host = true
155
+ @params_encoding = nil
156
+ @cert_file = nil
157
+ @key_file = nil
158
+ @debugging = false
159
+ @inject_format = false
160
+ @force_ending_format = false
161
+ @logger = defined?(Jets) ? Jets.logger : Logger.new(STDOUT)
162
+ @access_token_scopes = 'payments.transfers-info payments.transfer-batch-request '\
163
+ 'pagamentos-lote.lotes-requisicao pagamentos-lote.lotes-info '\
164
+ 'pagamentos-lote.transferencias-pix-info pagamentos-lote.transferencias-pix-requisicao '\
165
+ 'pagamentos-lote.cancelar-requisicao pagamentos-lote.transferencias-requisicao'
166
+
167
+ yield(self) if block_given?
168
+ end
169
+
170
+ def client_credentials_api
171
+ @client_credentials_api ||= BancoBrasilClientCredentials::ApiClient.new oauth_config
172
+ end
173
+
174
+ def oauth_config
175
+ oauth_config = BancoBrasilClientCredentials::Configuration.new
176
+ oauth_config.host = oauth_host
177
+ oauth_config.base_path = ''
178
+ oauth_config.logger = logger
179
+ oauth_config.debugging = debugging
180
+ oauth_config.verify_ssl = verify_ssl
181
+ oauth_config.verify_ssl_host = verify_ssl_host
182
+ oauth_config.access_token = access_token
183
+ oauth_config.username = username
184
+ oauth_config.password = password
185
+ oauth_config.ssl_ca_cert = ssl_ca_cert
186
+ oauth_config
187
+ end
188
+
189
+ # The default Configuration object.
190
+ def self.default
191
+ @@default ||= Configuration.new
192
+ end
193
+
194
+ def configure
195
+ yield(self) if block_given?
196
+ end
197
+
198
+ def scheme=(scheme)
199
+ # remove :// from scheme
200
+ @scheme = scheme.sub(/:\/\//, '')
201
+ end
202
+
203
+ def host=(host)
204
+ # remove http(s):// and anything after a slash
205
+ @host = host.sub(/https?:\/\//, '').split('/').first
206
+ end
207
+
208
+ def base_path=(base_path)
209
+ # Add leading and trailing slashes to base_path
210
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
211
+ @base_path = '' if @base_path == '/'
212
+ end
213
+
214
+ def base_url(base_path)
215
+ "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
216
+ end
217
+
218
+ # Gets API key (with prefix if set).
219
+ # @param [String] param_name the parameter name of API key auth
220
+ def api_key_with_prefix(param_name)
221
+ if @api_key_prefix[param_name]
222
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
223
+ else
224
+ @api_key[param_name]
225
+ end
226
+ end
227
+
228
+ # Gets Basic Auth token string
229
+ def basic_auth_token
230
+ 'Basic ' + Base64.encode64("#{username}:#{password}").delete("\r\n")
231
+ end
232
+
233
+ # Returns Auth Settings hash for api client.
234
+ def auth_settings
235
+ {
236
+ 'OAuth2-CC' =>
237
+ {
238
+ type: 'oauth2',
239
+ in: 'header',
240
+ key: 'Authorization',
241
+ value: "Bearer #{access_token}"
242
+ },
243
+ }
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,177 @@
1
+ require 'date'
2
+
3
+ module BancoBrasilPayments
4
+ # Representação dos campos de uma solicitação de transferência em lote.
5
+ class BaseModel
6
+
7
+ # List of attributes with nullable: true
8
+ def self.openapi_nullable
9
+ Set.new([])
10
+ end
11
+ # Initializes the object
12
+ # @param [Hash] attributes Model attributes in the form of hash
13
+ def initialize(attributes = {})
14
+ if (!attributes.is_a?(Hash))
15
+ fail ArgumentError, "The input argument (attributes) must be a hash in `#{self.class.name}` initialize method"
16
+ end
17
+
18
+ # check to see if the attribute exists and convert string to symbol for hash key
19
+ attributes = attributes.each_with_object({}) { |(k, v), h|
20
+ if (!self.class.attribute_map.key?(k.to_sym))
21
+ fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`."\
22
+ ' Please check the name to make sure it\'s valid. List of attributes: '\
23
+ "#{self.class.attribute_map.keys.inspect}"
24
+ end
25
+ h[k.to_sym] = v
26
+ }
27
+
28
+ attributes.each { |key, value| self.send("#{key}=", value) }
29
+ end
30
+
31
+ def list_invalid_properties
32
+ Array.new
33
+ end
34
+
35
+ # Check to see if the all the properties in the model are valid
36
+ # @return true if the model is valid
37
+ def valid?
38
+ list_invalid_properties.empty?
39
+ end
40
+
41
+ # Checks equality by comparing each attribute.
42
+ # @param [Object] Object to be compared
43
+ def ==(o)
44
+ return true if self.equal?(o)
45
+ self.class == o.class && self.class.attribute_map.keys.all? {|attr| self.send(attr) == o.send(attr) }
46
+ end
47
+
48
+ # @see the `==` method
49
+ # @param [Object] Object to be compared
50
+ def eql?(o)
51
+ self == o
52
+ end
53
+
54
+ # Calculates hash code according to all attributes.
55
+ # @return [Integer] Hash code
56
+ def hash
57
+ self.class.attribute_map.keys.map {|attr| self.send(attr) }.hash
58
+ end
59
+
60
+ # Builds the object from hash
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ # @return [Object] Returns the model itself
63
+ def self.build_from_hash(attributes)
64
+ new.build_from_hash(attributes)
65
+ end
66
+
67
+ # Builds the object from hash
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ # @return [Object] Returns the model itself
70
+ def build_from_hash(attributes)
71
+ return nil unless attributes.is_a?(Hash)
72
+ self.class.openapi_types.each_pair do |key, type|
73
+ if type =~ /\AArray<(.*)>/i
74
+ # check to ensure the input is an array given that the attribute
75
+ # is documented as an array but the input is not
76
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
77
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
78
+ end
79
+ elsif !attributes[self.class.attribute_map[key]].nil?
80
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
81
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
82
+ self.send("#{key}=", nil)
83
+ end
84
+ end
85
+
86
+ self
87
+ end
88
+
89
+ # Deserializes the data based on type
90
+ # @param string type Data type
91
+ # @param string value Value to be deserialized
92
+ # @return [Object] Deserialized data
93
+ def _deserialize(type, value)
94
+ case type.to_sym
95
+ when :DateTime
96
+ DateTime.parse(value)
97
+ when :Date
98
+ Date.parse(value)
99
+ when :NumberDate
100
+ Date.strptime(value.to_s.rjust(8, '0'), '%d%m%Y')
101
+ when :String
102
+ value.to_s
103
+ when :Integer
104
+ value.to_i
105
+ when :Float
106
+ value.to_f
107
+ when :Boolean
108
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
109
+ true
110
+ else
111
+ false
112
+ end
113
+ when :Object
114
+ # generic object (usually a Hash), return directly
115
+ value
116
+ when /\AArray<(?<inner_type>.+)>\z/
117
+ inner_type = Regexp.last_match[:inner_type]
118
+ value.map { |v| _deserialize(inner_type, v) }
119
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
120
+ k_type = Regexp.last_match[:k_type]
121
+ v_type = Regexp.last_match[:v_type]
122
+ {}.tap do |hash|
123
+ value.each do |k, v|
124
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
125
+ end
126
+ end
127
+ else # model
128
+ BancoBrasilPayments.const_get(type).build_from_hash(value)
129
+ end
130
+ end
131
+
132
+ # Returns the string representation of the object
133
+ # @return [String] String presentation of the object
134
+ def to_s
135
+ to_hash.to_s
136
+ end
137
+
138
+ # to_body is an alias to to_hash (backward compatibility)
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_body
141
+ to_hash
142
+ end
143
+
144
+ # Returns the object in the form of hash
145
+ # @return [Hash] Returns the object in the form of hash
146
+ def to_hash
147
+ hash = {}
148
+ self.class.attribute_map.each_pair do |attr, param|
149
+ value = self.send(attr)
150
+ if value.nil?
151
+ is_nullable = self.class.openapi_nullable.include?(attr)
152
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
153
+ end
154
+
155
+ hash[param] = _to_hash(value)
156
+ end
157
+ hash
158
+ end
159
+
160
+ # Outputs non-array value in the form of hash
161
+ # For object, use to_hash. Otherwise, just return the value
162
+ # @param [Object] value Any valid value
163
+ # @return [Hash] Returns the value in the form of hash
164
+ def _to_hash(value)
165
+ if value.is_a?(Array)
166
+ value.compact.map { |v| _to_hash(v) }
167
+ elsif value.is_a?(Hash)
168
+ {}.tap do |hash|
169
+ value.each { |k, v| hash[k] = _to_hash(v) }
170
+ end
171
+ elsif value.respond_to? :to_hash
172
+ value.to_hash
173
+ else
174
+ value
175
+ end
176
+ end end
177
+ end
@@ -0,0 +1,30 @@
1
+ module BancoBrasilPayments
2
+ # Objeto de Requisição quando da solicitação para efetuar pagamentos em lote via Transferência PIX.
3
+ class BatchPixBody < Body
4
+ # Attribute mapping from ruby-style variable name to JSON key.
5
+ def self.attribute_map
6
+ {
7
+ request_identification: :numeroRequisicao,
8
+ payment_contract: :numeroContrato,
9
+ debit_branch_office: :agenciaDebito,
10
+ debit_current_account: :contaCorrenteDebito,
11
+ check_digits_debit_current_account: :digitoVerificadorContaCorrente,
12
+ payment_type: :tipoPagamento,
13
+ payments_list: :listaTransferencias
14
+ }
15
+ end
16
+
17
+ # Attribute type mapping.
18
+ def self.openapi_types
19
+ {
20
+ request_identification: :Integer,
21
+ payment_contract: :Integer,
22
+ debit_branch_office: :Integer,
23
+ debit_current_account: :Integer,
24
+ check_digits_debit_current_account: :String,
25
+ payment_type: :Integer,
26
+ payments_list: :'Array<TransferPixBase>'
27
+ }
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,69 @@
1
+ module BancoBrasilPayments
2
+ # Objeto de Requisição quando da solicitação para efetuar pagamentos em lote via Transferência PIX.
3
+ class BatchPixResponse < BaseModel
4
+
5
+ # Identificador da requisição de pagamento em lote. Valor do identificador é controlado pelo cliente.
6
+ attr_accessor :request_identification
7
+
8
+ # Código que identifica o estado da solicitação.
9
+ # 1 - Requisição com todos os lançamentos com dados consistentes;
10
+ # 2 - Requisição com ao menos um dos lançamentos com dados inconsistentes;
11
+ # 3 - Requisição com todos os lançamentos com dados inconsistentes;
12
+ # 4 - Requisição pendente de ação pelo Conveniado - falta autorizar o pagamento;
13
+ # 5 - Requisição em processamento pelo Banco;
14
+ # 6 - Requisição Processada;
15
+ # 7 - Requisição Rejeitada,
16
+ # 8 - Preparando remessa não liberada,
17
+ # 9 - Requisição liberada via API,
18
+ # 10 - Preparando remessa liberada.
19
+ #
20
+ # As situações 1, 2 e 8 são transitórias e não requerem qualquer ação do Cliente Conveniado.
21
+ # situação 3 sempre será migrada para situação 7.
22
+ # A situação 4 Significa que, ao menos um lançamento, depende de ação do Cliente Conveniado, seja liberando ou cancelando os pagamentos.
23
+ # As situações 5, 6, 7, 9 e 10 não requerem qualquer ação do Cliente Conveniado.
24
+ # A situação 5 significa que, ao menos um lançamento, está agendado.
25
+ # As situações 6 e 7 são definitivas não havendo alteração posterior da situação da requisição.
26
+ attr_accessor :request_status
27
+
28
+ # Quantidade total dos lançamentos enviados para pagamento.
29
+ attr_accessor :payments_total_quantity
30
+
31
+ # Valor total dos lançamentos enviados para pagamento.
32
+ attr_accessor :payments_total_value
33
+
34
+ # Quantidade total de lançamentos válidos.
35
+ attr_accessor :valid_payments_total_quantity
36
+
37
+ # Valor total dos lançamentos válidos.
38
+ attr_accessor :valid_payments_total_value
39
+
40
+ # Lista de transferências enviada. Os campos desta lista dizem respeito a crédito a determinado beneficiário.
41
+ attr_accessor :payments_list
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ request_identification: :numeroRequisicao,
47
+ request_status: :estadoRequisicao,
48
+ payments_total_quantity: :quantidadeTransferencias,
49
+ payments_total_value: :valorTransferencias,
50
+ valid_payments_total_quantity: :quantidadeTransferenciasValidas,
51
+ valid_payments_total_value: :valorTransferenciasValidas,
52
+ payments_list: :listaTransferencias
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ request_identification: :Integer,
60
+ request_status: :Integer,
61
+ payments_total_quantity: :Integer,
62
+ payments_total_value: :Float,
63
+ valid_payments_total_quantity: :String,
64
+ valid_payments_total_value: :Float,
65
+ payments_list: :'Array<TransferPix>'
66
+ }
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,30 @@
1
+ module BancoBrasilPayments
2
+ # Objeto de Requisição quando da solicitação para efetuar pagamentos em lote via Transferência PIX.
3
+ class BatchTransfersBody < Body
4
+ # Attribute mapping from ruby-style variable name to JSON key.
5
+ def self.attribute_map
6
+ {
7
+ request_identification: :numeroRequisicao,
8
+ payment_contract: :numeroContratoPagamento,
9
+ debit_branch_office: :agenciaDebito,
10
+ debit_current_account: :contaCorrenteDebito,
11
+ check_digits_debit_current_account: :digitoVerificadorContaCorrente,
12
+ payment_type: :tipoPagamento,
13
+ payments_list: :listaTransferencias
14
+ }
15
+ end
16
+
17
+ # Attribute type mapping.
18
+ def self.openapi_types
19
+ {
20
+ request_identification: :Integer,
21
+ payment_contract: :Integer,
22
+ debit_branch_office: :Integer,
23
+ debit_current_account: :Integer,
24
+ check_digits_debit_current_account: :String,
25
+ payment_type: :Integer,
26
+ payments_list: :'Array<TransferBase>'
27
+ }
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,64 @@
1
+ module BancoBrasilPayments
2
+ # Objeto de Requisição quando da solicitação para efetuar pagamentos em lote via Transferência PIX.
3
+ class BatchTransfersResponse < BaseModel
4
+
5
+ # Código que identifica o estado da solicitação.
6
+ # 1 - Requisição com todos os lançamentos com dados consistentes;
7
+ # 2 - Requisição com ao menos um dos lançamentos com dados inconsistentes;
8
+ # 3 - Requisição com todos os lançamentos com dados inconsistentes;
9
+ # 4 - Requisição pendente de ação pelo Conveniado - falta autorizar o pagamento;
10
+ # 5 - Requisição em processamento pelo Banco;
11
+ # 6 - Requisição Processada;
12
+ # 7 - Requisição Rejeitada,
13
+ # 8 - Preparando remessa não liberada,
14
+ # 9 - Requisição liberada via API,
15
+ # 10 - Preparando remessa liberada.
16
+ #
17
+ # As situações 1, 2 e 8 são transitórias e não requerem qualquer ação do Cliente Conveniado.
18
+ # situação 3 sempre será migrada para situação 7.
19
+ # A situação 4 Significa que, ao menos um lançamento, depende de ação do Cliente Conveniado, seja liberando ou cancelando os pagamentos.
20
+ # As situações 5, 6, 7, 9 e 10 não requerem qualquer ação do Cliente Conveniado.
21
+ # A situação 5 significa que, ao menos um lançamento, está agendado.
22
+ # As situações 6 e 7 são definitivas não havendo alteração posterior da situação da requisição.
23
+ attr_accessor :request_status
24
+
25
+ # Quantidade total dos lançamentos enviados para pagamento.
26
+ attr_accessor :payments_total_quantity
27
+
28
+ # Valor total dos lançamentos enviados para pagamento.
29
+ attr_accessor :payments_total_value
30
+
31
+ # Quantidade total de lançamentos válidos.
32
+ attr_accessor :valid_payments_total_quantity
33
+
34
+ # Valor total dos lançamentos válidos.
35
+ attr_accessor :valid_payments_total_value
36
+
37
+ # Lista de transferências enviada. Os campos desta lista dizem respeito a crédito a determinado beneficiário.
38
+ attr_accessor :payments_list
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ request_status: :estadoRequisicao,
44
+ payments_total_quantity: :quantidadeTransferencias,
45
+ payments_total_value: :valorTransferencias,
46
+ valid_payments_total_quantity: :quantidadeTransferenciasValidas,
47
+ valid_payments_total_value: :valorTransferenciasValidas,
48
+ payments_list: :transferencias
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ request_status: :Integer,
56
+ payments_total_quantity: :Integer,
57
+ payments_total_value: :Float,
58
+ valid_payments_total_quantity: :String,
59
+ valid_payments_total_value: :Float,
60
+ payments_list: :'Object'
61
+ }
62
+ end
63
+ end
64
+ end