Class: DwollaSwagger::CustomersApi
- Defined in:
- lib/dwolla_swagger/api/customers_api.rb
Class Method Summary collapse
-
.create(opts = {}) ⇒ Unit
Create a new customer.
-
.create_funding_sources_token_for_customer(id, opts = {}) ⇒ CustomerOAuthToken
Create an OAuth token that is capable of adding a financial institution for the given customer.
-
.get_customer(id, opts = {}) ⇒ Customer
Get a customer by id.
-
.get_customer_documents(id, opts = {}) ⇒ DocumentListResponse
Get documents uploaded for customer.
-
.get_customer_iav_token(id, opts = {}) ⇒ IavToken
Get iav token for customer.
-
.list(opts = {}) ⇒ CustomerListResponse
Get a list of customers.
-
.update_customer(id, opts = {}) ⇒ Customer
Update customer record.
-
.upload_document(opts = {}) ⇒ Unit
Upload a verification document.
Class Method Details
.create(opts = {}) ⇒ Unit
Create a new customer.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 60 def self.create(opts = {}) # resource path path = "/customers".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = Swagger::Request.object_to_http_body(opts[:'body']) response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Unit.new() and obj.build_from_hash(response.body)) end |
.create_funding_sources_token_for_customer(id, opts = {}) ⇒ CustomerOAuthToken
Create an OAuth token that is capable of adding a financial institution for the given customer.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 278 def self.create_funding_sources_token_for_customer(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling create_funding_sources_token_for_customer" if id.nil? # resource path path = "/customers/{id}/funding-sources-token".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = CustomerOAuthToken.new() and obj.build_from_hash(response.body)) end |
.get_customer(id, opts = {}) ⇒ Customer
Get a customer by id
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 100 def self.get_customer(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_customer" if id.nil? # resource path path = "/customers/{id}".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Customer.new() and obj.build_from_hash(response.body)) end |
.get_customer_documents(id, opts = {}) ⇒ DocumentListResponse
Get documents uploaded for customer.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 193 def self.get_customer_documents(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_customer_documents" if id.nil? # resource path path = "/customers/{id}/documents".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = DocumentListResponse.new() and obj.build_from_hash(response.body)) end |
.get_customer_iav_token(id, opts = {}) ⇒ IavToken
Get iav token for customer.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 324 def self.get_customer_iav_token(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_customer_iav_token" if id.nil? # resource path path = "/customers/{id}/iav-token".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = IavToken.new() and obj.build_from_hash(response.body)) end |
.list(opts = {}) ⇒ CustomerListResponse
Get a list of customers.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 17 def self.list(opts = {}) # resource path path = "/customers".sub('{format}','json') # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] query_params[:'search'] = opts[:'search'] if opts[:'search'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = CustomerListResponse.new() and obj.build_from_hash(response.body)) end |
.update_customer(id, opts = {}) ⇒ Customer
Update customer record. Personal customer records are re-verified upon update.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 147 def self.update_customer(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling update_customer" if id.nil? # resource path path = "/customers/{id}".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = Swagger::Request.object_to_http_body(opts[:'body']) response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Customer.new() and obj.build_from_hash(response.body)) end |
.upload_document(opts = {}) ⇒ Unit
Upload a verification document.
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/dwolla_swagger/api/customers_api.rb', line 238 def self.upload_document(opts = {}) # resource path path = "/customers/{id}/documents".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['multipart/form-data'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Unit.new() and obj.build_from_hash(response.body)) end |