paid 1.0.11 → 1.1.0
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/History.txt +7 -0
- data/VERSION +1 -1
- data/lib/paid/api_resource.rb +10 -3
- data/lib/paid/invoice.rb +17 -3
- 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: 5cf60ea77b7acfc99071d6db990d4195175af0ea
|
4
|
+
data.tar.gz: f361f3abfc1f00e8bd74eef54d5580e7430f957c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf6b618afcd7f6fafc04c6e0977dc85882a1cd6720448cb2888e46611c672995d4766290ab9a0b5e04acb8700ff6696059022dc8c2485d8a0aeacaa662356e8a
|
7
|
+
data.tar.gz: 3147c05ee6c18660ae692cef8e6f46fac39f6c74dc6a59ca2309a07763ca74f825d37724c1ba3e80980edde8f2b15bf2c4c08fa68eb29fb955f01aae150cd6c7
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/lib/paid/api_resource.rb
CHANGED
@@ -31,11 +31,12 @@ module Paid
|
|
31
31
|
@api_method = api_method
|
32
32
|
@json = Util.sorta_deep_clone(json)
|
33
33
|
|
34
|
-
# Use json (not
|
34
|
+
# Use json (not @json, the cloned copy)
|
35
35
|
json.each do |k, v|
|
36
|
-
|
37
|
-
|
36
|
+
unless self.class.api_attribute_names.include?(k.to_sym)
|
37
|
+
self.class.add_api_attribute(k.to_sym)
|
38
38
|
end
|
39
|
+
instance_variable_set("@#{k}", determine_api_attribute_value(k, v))
|
39
40
|
end
|
40
41
|
self
|
41
42
|
end
|
@@ -58,6 +59,11 @@ module Paid
|
|
58
59
|
@api_attributes.map(&:first)
|
59
60
|
end
|
60
61
|
|
62
|
+
def self.add_api_attribute(name)
|
63
|
+
attr_accessor name.to_sym
|
64
|
+
@api_attributes[name.to_sym] = {}
|
65
|
+
end
|
66
|
+
|
61
67
|
def api_attributes
|
62
68
|
ret = {}
|
63
69
|
self.class.api_attribute_names.each do |attribute|
|
@@ -107,6 +113,7 @@ module Paid
|
|
107
113
|
raw_value
|
108
114
|
end
|
109
115
|
end
|
116
|
+
|
110
117
|
def determine_api_attribute_value(name, raw_value)
|
111
118
|
self.class.determine_api_attribute_value(name, raw_value)
|
112
119
|
end
|
data/lib/paid/invoice.rb
CHANGED
@@ -2,14 +2,28 @@ module Paid
|
|
2
2
|
class Invoice < APIResource
|
3
3
|
attr_reader :id
|
4
4
|
attr_reader :object
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :amount
|
6
|
+
attr_accessor :amount_string
|
6
7
|
attr_accessor :chase_schedule
|
7
|
-
attr_accessor :
|
8
|
+
attr_accessor :created_at
|
8
9
|
attr_accessor :customer
|
10
|
+
attr_accessor :due_date
|
9
11
|
attr_accessor :issued_at
|
10
|
-
attr_accessor :
|
12
|
+
attr_accessor :last_reminder_on
|
11
13
|
attr_accessor :metadata
|
14
|
+
attr_accessor :next_chase_on
|
15
|
+
attr_accessor :number
|
16
|
+
attr_accessor :next_reminder_on
|
17
|
+
attr_accessor :overdue_amount
|
18
|
+
attr_accessor :paid
|
19
|
+
attr_accessor :payment
|
20
|
+
attr_accessor :status
|
21
|
+
attr_accessor :summary
|
22
|
+
attr_accessor :terms
|
12
23
|
attr_accessor :url
|
24
|
+
attr_accessor :unpaid_amount
|
25
|
+
attr_accessor :views
|
26
|
+
attr_accessor :voided
|
13
27
|
|
14
28
|
def self.all(params={}, headers={})
|
15
29
|
method = APIMethod.new(:get, "/invoices", params, headers, self)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Calhoun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|