Method: ProcessOut::Invoice#increment_authorization

Defined in:
lib/processout/invoice.rb

#increment_authorization(amount, options = {}) ⇒ Object

Create an incremental authorization Params:

amount

Amount to increment authorization by

options

Hash of options



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
# File 'lib/processout/invoice.rb', line 817

def increment_authorization(amount, options = {})
  self.prefill(options)

  request = Request.new(@client)
  path    = "/invoices/" + CGI.escape(@id) + "/increment_authorization"
  data    = {
    "metadata" => options.fetch(:metadata, nil), 
    "amount" => amount
  }

  response = Response.new(request.post(path, data, options))
  return_values = Array.new
  
  body = response.body
  body = body["transaction"]
  transaction = Transaction.new(@client)
  return_values.push(transaction.fill_with_data(body))

  
  return_values[0]
end