class Quickeebooks::Windows::Service::Payment
Public Instance Methods
create(payment)
click to toggle source
# File lib/quickeebooks/windows/service/payment.rb, line 24 def create(payment) raise InvalidModelException unless payment.valid_for_create? # XML is a wrapped 'object' where the type is specified as an attribute # <Object xsi:type="Invoice"> xml_node = payment.to_xml(:name => 'Object') xml_node.set_attribute('xsi:type', 'Payment') xml = Quickeebooks::Shared::Service::OperationNode.new.add do |content| content << "<ExternalRealmId>#{self.realm_id}</ExternalRealmId>#{xml_node}" end perform_write(Quickeebooks::Windows::Model::Payment, xml) end
fetch_by_id(id, idDomain = 'QB', options = {})
click to toggle source
# File lib/quickeebooks/windows/service/payment.rb, line 15 def fetch_by_id(id, idDomain = 'QB', options = {}) url = "#{url_for_resource(Quickeebooks::Windows::Model::Payment::REST_RESOURCE)}/#{id}" fetch_object(Quickeebooks::Windows::Model::Payment, url, { :idDomain => idDomain }) end
list(filters = [], page = 1, per_page = 20, sort = nil, options = {})
click to toggle source
# File lib/quickeebooks/windows/service/payment.rb, line 20 def list(filters = [], page = 1, per_page = 20, sort = nil, options = {}) fetch_collection(Quickeebooks::Windows::Model::Payment, nil, filters, page, per_page, sort, options) end