module ActiveZuora::Amend

Public Instance Methods

amend() click to toggle source
# File lib/active_zuora/amend.rb, line 17
def amend
  self.result = self.class.connection.request(:amend) do |soap|
    soap.body do |xml| 
      build_xml(xml, soap, 
        :namespace => soap.namespace,
        :element_name => :requests,
        :force_type => true)
    end
  end[:amend_response][:results]
  if result[:success]
    [result[:amendment_ids]].flatten.compact.each_with_index do |id, i|
      amendments[i].id = id
    end
    clear_changed_attributes
    true
  else
    add_zuora_errors(result[:errors])
    false
  end
end
amend!() click to toggle source
# File lib/active_zuora/amend.rb, line 38
def amend!
  raise "Could not amend: #{errors.full_messages.join ', '}" unless amend
end