lib/lipseys/invoice.rb in lipseys-0.1.0 vs lib/lipseys/invoice.rb in lipseys-0.1.1
- old
+ new
@@ -1,6 +1,8 @@
module Lipseys
+ # In addition to the `:email` and `:password` options, finding invoices requires
+ # either an `:order_number` **OR** a `:purchase_order`.
class Invoice < SoapClient
def initialize(options = {})
requires!(options, :email, :password)
@email = options[:email]
@@ -14,9 +16,33 @@
def self.all(*args)
new(*args).all
end
+ # The response structure will look like this:
+ #
+ # {
+ # invoices_found: 1,
+ # description: "1 Invoice(s) found.",
+ # invoices: {
+ # invoice_detail: {
+ # invoice_no: "...",
+ # ship_to_location: "...",
+ # tracking_no: "...",
+ # line_items: {
+ # item_detail: {
+ # item_no: "...",
+ # upc: "...",
+ # qty: "...",
+ # serialized_item: "...",
+ # serial_numbers: {
+ # string: "..."
+ # }
+ # }
+ # }
+ # }
+ # }
+ # }
def all
response = soap_client.call(:get_invoices, message: build_inquiry_data)
raise Lipseys::NotAuthenticated if not_authenticated?(response)