lib/lipseys/invoice.rb in lipseys-0.1.1 vs lib/lipseys/invoice.rb in lipseys-0.2.0
- old
+ new
@@ -1,8 +1,33 @@
module Lipseys
# In addition to the `:email` and `:password` options, finding invoices requires
# either an `:order_number` **OR** a `:purchase_order`.
+ #
+ # 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: "..."
+ # }
+ # }
+ # }
+ # }
+ # }
+ # }
class Invoice < SoapClient
def initialize(options = {})
requires!(options, :email, :password)
@email = options[:email]
@@ -16,33 +41,9 @@
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)