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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3307eff83a065d02481db812a81462841b28476b
4
- data.tar.gz: 6ee3484e8b4c3fa2de298ef41ab408548ccb07fa
3
+ metadata.gz: 614d4c58acc67641a1e7bfbda9eccd0236b4113b
4
+ data.tar.gz: 794f70851a0c85480cb9ee45a622cf9f056fe04d
5
5
  SHA512:
6
- metadata.gz: 5a902105387a2f9cc6be3fe04fc88c7f62a7eb2929f9104434c0ad36d4c03920d130665ca675f81725e21bc1a9f2f1b3ee4ae722f3d4311df8debba5275fc90f
7
- data.tar.gz: 6509ccea99f1f77e41523f2aa2fe3a269b8b7a99964ca79ea177e73dd2e6122fa8a6bf8264f38f2073fea4ac89ce611f3f12c33f3da1d8d186ec329c6b2990d2
6
+ metadata.gz: 6d5b35e417e89252742f10d705c647b6184284f4677675a8ab27f3909d2822e4f92e82767c9d4ecf8c0972cdab3b649e47fdae1ba5c684b45373ad74d670d0b9
7
+ data.tar.gz: 6e2d8fe2782449bdface40585cdacbb8f5ee678261a96300a48466feb9ab83089e1d06b62aba5ad6f93af426c6e2eef8e9002d0b60a6cad9f33e955860b65ac5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paid (0.0.7)
4
+ paid (0.0.8)
5
5
  json (~> 1.8.1)
6
6
  mime-types (>= 1.25, < 3.0)
7
7
  rest-client (~> 1.4)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Paid
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -14,7 +14,7 @@ module Paid
14
14
  assert_equal "inv_test_invoice", i.id
15
15
  end
16
16
 
17
- should "charges should be issuable" do
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 "charges should be able to be marked as paid" do
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
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: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Jackson