Method: ProcessOut::Project#create_supervised

Defined in:
lib/processout/project.rb

#create_supervised(options = {}) ⇒ Object

Create a new supervised project. Params:

options

Hash of options



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
# File 'lib/processout/project.rb', line 324

def create_supervised(options = {})
  self.prefill(options)

  request = Request.new(@client)
  path    = "/supervised-projects"
  data    = {
    "id" => @id, 
    "name" => @name, 
    "default_currency" => @default_currency, 
    "dunning_configuration" => @dunning_configuration, 
    "applepay_settings" => options.fetch(:applepay_settings, nil), 
    "public_metadata" => options.fetch(:public_metadata, nil)
  }

  response = Response.new(request.post(path, data, options))
  return_values = Array.new
  
  body = response.body
  body = body["project"]
  
  
  return_values.push(self.fill_with_data(body))
  

  
  return_values[0]
end