lipseys 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/lipseys.rb +1 -0
- data/lib/lipseys/invoice.rb +25 -24
- data/lib/lipseys/user.rb +18 -0
- data/lib/lipseys/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e73d539a08d177d8953cb9cc81e547a7388bcc
|
4
|
+
data.tar.gz: 4d3da1b7c3d6188cb01d4e9fcf0ee722c4d6b89b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86e95eab22c39310eb8146767d1d994584f39d939ee0f4ec6d3ede17a7f804f4ea0d1f02626b1c3be9850da86b8e3b655c5dd1ce5ed73c9295e4ee1b7a094167
|
7
|
+
data.tar.gz: 384b2a7372ddd071307e5af8f561d66b7d90fafcf4288ebf8010e7abccfc844f15d52124aed4fb287af77632f9919687ea5dd0d45b514fc52a6749968e3e57f1
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ options = {
|
|
32
32
|
### Lipseys::Catalog
|
33
33
|
|
34
34
|
There are several methods you can use to fetch different kinds (or all) items in the catalog.
|
35
|
-
All of the listed methods return the same response structure. See Lipseys::Catalog for details.
|
35
|
+
All of the listed methods return the same response structure. See `Lipseys::Catalog` for details.
|
36
36
|
|
37
37
|
```ruby
|
38
38
|
# All items
|
@@ -54,7 +54,7 @@ accessories = Lipseys::Catalog.accessories(options)
|
|
54
54
|
### Lipseys::Inventory
|
55
55
|
|
56
56
|
There are similar methods for getting your account's inventory (availability, price, etc.).
|
57
|
-
All methods return the same response structure. See Lipseys::Inventory for details.
|
57
|
+
All methods return the same response structure. See `Lipseys::Inventory` for details.
|
58
58
|
|
59
59
|
```ruby
|
60
60
|
inventory = Lipseys::Inventory.all(options)
|
@@ -89,7 +89,7 @@ options = {
|
|
89
89
|
response = Lipseys::Order.submit!(options)
|
90
90
|
```
|
91
91
|
|
92
|
-
The response will have this structure: (See Lipseys::Order for more details)
|
92
|
+
The response will have this structure: (See `Lipseys::Order` for more details)
|
93
93
|
|
94
94
|
```ruby
|
95
95
|
{
|
@@ -119,7 +119,7 @@ options = {
|
|
119
119
|
invoice = Lipseys::Invoice.all(options)
|
120
120
|
```
|
121
121
|
|
122
|
-
See Lipseys::Invoice for the response structure details.
|
122
|
+
See `Lipseys::Invoice` for the response structure details.
|
123
123
|
|
124
124
|
## Development
|
125
125
|
|
data/lib/lipseys.rb
CHANGED
data/lib/lipseys/invoice.rb
CHANGED
@@ -1,6 +1,31 @@
|
|
1
1
|
module Lipseys
|
2
2
|
# In addition to the `:email` and `:password` options, finding invoices requires
|
3
3
|
# either an `:order_number` **OR** a `:purchase_order`.
|
4
|
+
#
|
5
|
+
# The response structure will look like this:
|
6
|
+
#
|
7
|
+
# {
|
8
|
+
# invoices_found: 1,
|
9
|
+
# description: "1 Invoice(s) found.",
|
10
|
+
# invoices: {
|
11
|
+
# invoice_detail: {
|
12
|
+
# invoice_no: "...",
|
13
|
+
# ship_to_location: "...",
|
14
|
+
# tracking_no: "...",
|
15
|
+
# line_items: {
|
16
|
+
# item_detail: {
|
17
|
+
# item_no: "...",
|
18
|
+
# upc: "...",
|
19
|
+
# qty: "...",
|
20
|
+
# serialized_item: "...",
|
21
|
+
# serial_numbers: {
|
22
|
+
# string: "..."
|
23
|
+
# }
|
24
|
+
# }
|
25
|
+
# }
|
26
|
+
# }
|
27
|
+
# }
|
28
|
+
# }
|
4
29
|
class Invoice < SoapClient
|
5
30
|
|
6
31
|
def initialize(options = {})
|
@@ -18,30 +43,6 @@ module Lipseys
|
|
18
43
|
new(*args).all
|
19
44
|
end
|
20
45
|
|
21
|
-
# The response structure will look like this:
|
22
|
-
#
|
23
|
-
# {
|
24
|
-
# invoices_found: 1,
|
25
|
-
# description: "1 Invoice(s) found.",
|
26
|
-
# invoices: {
|
27
|
-
# invoice_detail: {
|
28
|
-
# invoice_no: "...",
|
29
|
-
# ship_to_location: "...",
|
30
|
-
# tracking_no: "...",
|
31
|
-
# line_items: {
|
32
|
-
# item_detail: {
|
33
|
-
# item_no: "...",
|
34
|
-
# upc: "...",
|
35
|
-
# qty: "...",
|
36
|
-
# serialized_item: "...",
|
37
|
-
# serial_numbers: {
|
38
|
-
# string: "..."
|
39
|
-
# }
|
40
|
-
# }
|
41
|
-
# }
|
42
|
-
# }
|
43
|
-
# }
|
44
|
-
# }
|
45
46
|
def all
|
46
47
|
response = soap_client.call(:get_invoices, message: build_inquiry_data)
|
47
48
|
|
data/lib/lipseys/user.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Lipseys
|
2
|
+
class User < Base
|
3
|
+
|
4
|
+
def initialize(options = {})
|
5
|
+
requires!(options, :email, :password)
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
|
9
|
+
def authenticated?
|
10
|
+
# As an auth check, just try to get invoices with a bogus order number.
|
11
|
+
Lipseys::Invoice.all(@options.merge(order_number: 'abc'))
|
12
|
+
true
|
13
|
+
rescue Lipseys::NotAuthenticated
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/lipseys/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lipseys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/lipseys/invoice.rb
|
106
106
|
- lib/lipseys/order.rb
|
107
107
|
- lib/lipseys/soap_client.rb
|
108
|
+
- lib/lipseys/user.rb
|
108
109
|
- lib/lipseys/version.rb
|
109
110
|
- lipseys.gemspec
|
110
111
|
homepage: ''
|