apruve 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/apruve/resources/shipment.rb +4 -2
- data/lib/apruve/version.rb +1 -1
- data/spec/apruve/resources/shipment_spec.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47f7ecc818ee0cf07f527efb91970dcecad9ec29
|
4
|
+
data.tar.gz: 4fce1f67255250ffb15f04f6b2b1fbdd2e811e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 618a2b76d3fe548200eb0c5f041fc340f294bd914a270f25df04c2d0c95b4b1f3c119d85ee7c91a9b4eaf2e42de57a1998c2d4ebf4d50d69f18b0a9df936d526
|
7
|
+
data.tar.gz: 3a29ee9936e59f006df4a007a524fbc7ea1354f9e3f82cc66a2e42171d2b05db74841f736812f915e9fb604db47e94251047354ae9a81a0121a4dc591cebe304
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Apruve
|
2
2
|
class Shipment < Apruve::ApruveObject
|
3
|
-
attr_accessor :id, :invoice_id, :amount_cents, :currency, :shipper, :shipped_at,
|
3
|
+
attr_accessor :id, :invoice_id, :amount_cents, :currency, :shipper, :shipped_at,
|
4
|
+
:tracking_number, :delivered_at, :merchant_notes, :invoice_items,
|
5
|
+
:tax_cents, :shipping_cents, :status, :merchant_shipment_id
|
4
6
|
|
5
7
|
def self.find(invoice_id, id)
|
6
8
|
response = Apruve.get("invoices/#{invoice_id}/shipments/#{id}")
|
@@ -36,7 +38,7 @@ module Apruve
|
|
36
38
|
|
37
39
|
def update!
|
38
40
|
validate
|
39
|
-
|
41
|
+
Apruve.patch("invoices/#{self.invoice_id}/shipments/#{id}", self.to_json)
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
data/lib/apruve/version.rb
CHANGED
@@ -13,6 +13,11 @@ describe Apruve::Shipment do
|
|
13
13
|
let (:shipped_at) { '2016-11-11T00:00:00-06:00' }
|
14
14
|
let (:delivered_at) { '2016-11-11T00:00:00-06:00' }
|
15
15
|
let (:tracking_number) { '1234abcd' }
|
16
|
+
let (:currency) { 'USD' }
|
17
|
+
let (:tax_cents) { 1234 }
|
18
|
+
let (:shipping_cents) { 12345 }
|
19
|
+
let (:status) { 'fulfilled' }
|
20
|
+
let (:merchant_shipment_id) { 'ZZ1234567' }
|
16
21
|
let (:shipment) do
|
17
22
|
Apruve::Shipment.new(
|
18
23
|
amount_cents: amount_cents,
|
@@ -23,6 +28,11 @@ describe Apruve::Shipment do
|
|
23
28
|
shipped_at: shipped_at,
|
24
29
|
delivered_at: delivered_at,
|
25
30
|
tracking_number: tracking_number,
|
31
|
+
currency: currency,
|
32
|
+
tax_cents: tax_cents,
|
33
|
+
shipping_cents: shipping_cents,
|
34
|
+
status: status,
|
35
|
+
merchant_shipment_id: merchant_shipment_id
|
26
36
|
)
|
27
37
|
end
|
28
38
|
subject { shipment }
|
@@ -37,10 +47,14 @@ describe Apruve::Shipment do
|
|
37
47
|
it { should respond_to(:delivered_at) }
|
38
48
|
it { should respond_to(:merchant_notes) }
|
39
49
|
it { should respond_to(:invoice_items) }
|
50
|
+
it { should respond_to(:tax_cents) }
|
51
|
+
it { should respond_to(:shipping_cents) }
|
52
|
+
it { should respond_to(:status) }
|
53
|
+
it { should respond_to(:merchant_shipment_id) }
|
40
54
|
|
41
55
|
describe '#to_json' do
|
42
56
|
let(:expected) do
|
43
|
-
'{"amount_cents":1234578,"merchant_notes":"foo","id":"91ac96c0ffc9577ecb634ad726b1874e","invoice_id":"2d1bd4f93a1b9ed034e36783adb29bed","shipper":"shipper name","shipped_at":"2016-11-11T00:00:00-06:00","delivered_at":"2016-11-11T00:00:00-06:00","tracking_number":"1234abcd","
|
57
|
+
'{"amount_cents":1234578,"merchant_notes":"foo","id":"91ac96c0ffc9577ecb634ad726b1874e","invoice_id":"2d1bd4f93a1b9ed034e36783adb29bed","shipper":"shipper name","shipped_at":"2016-11-11T00:00:00-06:00","delivered_at":"2016-11-11T00:00:00-06:00","tracking_number":"1234abcd","currency":"USD","tax_cents":1234,"shipping_cents":12345,"status":"fulfilled","merchant_shipment_id":"ZZ1234567","invoice_items":[]}'
|
44
58
|
end
|
45
59
|
its(:to_json) { should eq expected }
|
46
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apruve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apruve, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|