paid 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/paid/customer.rb +15 -0
- data/lib/paid/version.rb +1 -1
- data/pkg/paid-0.0.2.gem +0 -0
- data/test/paid/customer_test.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d1bce0b8dfa8caf72176df4abcdfd7be9b30262
|
4
|
+
data.tar.gz: 1000696410a8767e4389df95c9e0caa93b8b9e41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e2274c632fc723c6302c2a61c90e3be32dfdbb0279761c404cc72c76058099c1ce6a45c201b207025c953bfda16e8458716a57c33378d5528cb5731f1f974d
|
7
|
+
data.tar.gz: 6a1eac1770128a35eee7602396a33f2466bba79e3442390b302f6817582767eaea24de8045dff5278df111493637ee1115ff81cd9e9a30f1555415ca5e911fb8
|
data/Gemfile.lock
CHANGED
data/lib/paid/customer.rb
CHANGED
@@ -5,6 +5,15 @@ module Paid
|
|
5
5
|
include Paid::APIOperations::Update
|
6
6
|
include Paid::APIOperations::List
|
7
7
|
|
8
|
+
def generate_invoice(params={}, opts={})
|
9
|
+
api_key, headers = Util.parse_opts(opts)
|
10
|
+
response, api_key = Paid.request(
|
11
|
+
:post, generate_invoice_url, api_key || @api_key, params, headers)
|
12
|
+
# refresh_from(response, api_key)
|
13
|
+
refresh_from({ :invoice => response }, api_key, true)
|
14
|
+
invoice
|
15
|
+
end
|
16
|
+
|
8
17
|
def invoices
|
9
18
|
Invoice.all({ :customer => id }, @api_key)
|
10
19
|
end
|
@@ -12,5 +21,11 @@ module Paid
|
|
12
21
|
def transactions
|
13
22
|
Transaction.all({ :customer => id }, @api_key)
|
14
23
|
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def generate_invoice_url
|
28
|
+
url + '/generate_invoice'
|
29
|
+
end
|
15
30
|
end
|
16
31
|
end
|
data/lib/paid/version.rb
CHANGED
data/pkg/paid-0.0.2.gem
ADDED
Binary file
|
data/test/paid/customer_test.rb
CHANGED
@@ -31,5 +31,14 @@ module Paid
|
|
31
31
|
c = Paid::Customer.create
|
32
32
|
assert_equal "c_test_customer", c.id
|
33
33
|
end
|
34
|
+
|
35
|
+
should "be able to generate invoice" do
|
36
|
+
@mock.expects(:get).never
|
37
|
+
@mock.expects(:post).once.returns(test_response(test_customer))
|
38
|
+
c = Paid::Customer.create
|
39
|
+
@mock.expects(:post).once.returns(test_response(test_invoice))
|
40
|
+
i = c.generate_invoice
|
41
|
+
assert i.kind_of?(Paid::Invoice)
|
42
|
+
end
|
34
43
|
end
|
35
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- lib/tasks/paid_tasks.rake
|
155
155
|
- paid.gemspec
|
156
156
|
- pkg/paid-0.0.1.gem
|
157
|
+
- pkg/paid-0.0.2.gem
|
157
158
|
- test/paid/account_test.rb
|
158
159
|
- test/paid/alias_test.rb
|
159
160
|
- test/paid/api_resource_test.rb
|