Method: ProcessOut::Token#save

Defined in:
lib/processout/token.rb

#save(options = {}) ⇒ Object

Save the updated customer attributes. Params:

options

Hash of options



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/processout/token.rb', line 467

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

  request = Request.new(@client)
  path    = "/customers/" + CGI.escape(@customer_id) + "/tokens/" + CGI.escape(@id) + ""
  data    = {
    "source" => options.fetch(:source, nil), 
    "settings" => options.fetch(:settings, nil), 
    "device" => options.fetch(:device, nil), 
    "verify" => options.fetch(:verify, nil), 
    "verify_metadata" => options.fetch(:verify_metadata, nil), 
    "set_default" => options.fetch(:set_default, nil), 
    "verify_statement_descriptor" => options.fetch(:verify_statement_descriptor, nil), 
    "invoice_return_url" => options.fetch(:invoice_return_url, nil), 
    "gateway_configuration_id" => options.fetch(:gateway_configuration_id, nil)
  }

  response = Response.new(request.put(path, data, options))
  return_values = Array.new
  
  return_values.push(response.success)

  
  return_values[0]
end