paid 0.0.7 → 0.0.8
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/paid/transaction.rb +13 -0
- data/lib/paid/version.rb +1 -1
- data/test/paid/invoice_test.rb +2 -2
- data/test/paid/transaction_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 614d4c58acc67641a1e7bfbda9eccd0236b4113b
|
4
|
+
data.tar.gz: 794f70851a0c85480cb9ee45a622cf9f056fe04d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d5b35e417e89252742f10d705c647b6184284f4677675a8ab27f3909d2822e4f92e82767c9d4ecf8c0972cdab3b649e47fdae1ba5c684b45373ad74d670d0b9
|
7
|
+
data.tar.gz: 6e2d8fe2782449bdface40585cdacbb8f5ee678261a96300a48466feb9ab83089e1d06b62aba5ad6f93af426c6e2eef8e9002d0b60a6cad9f33e955860b65ac5
|
data/Gemfile.lock
CHANGED
data/lib/paid/transaction.rb
CHANGED
@@ -3,5 +3,18 @@ module Paid
|
|
3
3
|
include Paid::APIOperations::List
|
4
4
|
include Paid::APIOperations::Create
|
5
5
|
include Paid::APIOperations::Update
|
6
|
+
|
7
|
+
def mark_as_paid(params={}, opts={})
|
8
|
+
api_key, headers = Util.parse_opts(opts)
|
9
|
+
response, api_key = Paid.request(
|
10
|
+
:post, mark_as_paid_url, api_key || @api_key, params, headers)
|
11
|
+
refresh_from(response, api_key)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def mark_as_paid_url
|
17
|
+
api_url + '/mark_as_paid'
|
18
|
+
end
|
6
19
|
end
|
7
20
|
end
|
data/lib/paid/version.rb
CHANGED
data/test/paid/invoice_test.rb
CHANGED
@@ -14,7 +14,7 @@ module Paid
|
|
14
14
|
assert_equal "inv_test_invoice", i.id
|
15
15
|
end
|
16
16
|
|
17
|
-
should "
|
17
|
+
should "invoices should be issuable" do
|
18
18
|
@mock.expects(:get).never
|
19
19
|
@mock.expects(:post).once.returns(test_response({:id => "inv_test_invoice", :issued_at => 123467890}))
|
20
20
|
i = Paid::Invoice.new("test_invoice")
|
@@ -22,7 +22,7 @@ module Paid
|
|
22
22
|
assert !i.issued_at.nil?
|
23
23
|
end
|
24
24
|
|
25
|
-
should "
|
25
|
+
should "invoices should be able to be marked as paid" do
|
26
26
|
@mock.expects(:get).never
|
27
27
|
@mock.expects(:post).once.returns(test_response({:id => "inv_test_invoice", :paid => true}))
|
28
28
|
i = Paid::Invoice.new("test_invoice")
|
@@ -45,5 +45,13 @@ module Paid
|
|
45
45
|
|
46
46
|
assert !c.paid
|
47
47
|
end
|
48
|
+
|
49
|
+
should "transactions should be able to be marked as paid" do
|
50
|
+
@mock.expects(:get).never
|
51
|
+
@mock.expects(:post).once.returns(test_response({:id => "tr_test_transaction", :paid => true}))
|
52
|
+
t = Paid::Invoice.new("test_transaction")
|
53
|
+
t.mark_as_paid
|
54
|
+
assert t.paid
|
55
|
+
end
|
48
56
|
end
|
49
57
|
end
|