pagarme 2.1.4 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 578deddbc00fc81efa0bfd3bc0c2d76503346933
4
- data.tar.gz: c1448b5d1f4d746bd67e3c1718b75fecf524194d
3
+ metadata.gz: fa7618dbed41921964204454e2f5e568f9b0fb7a
4
+ data.tar.gz: b6d6bb41a4596ff19aede42f71d161722e24ba72
5
5
  SHA512:
6
- metadata.gz: 683f3c56c311fc53eedc8bf3888e8a48daf08aa6210e01146d707d06c0fa9f33f13cd6131a2f28d3b71a31a4cea1510c9195854d7dbee60da7ee130dd99b1a13
7
- data.tar.gz: 80585f459e4bd2dee596ad344a6004b12d36961ba7488897b5a979cf778fd7875309500a29798886d3ad21a5afa3d0bfaebb458db91f7af561e33485e8a1202b
6
+ metadata.gz: dee689b807add92e702f32fef9e444cf0380489683ed3643bab7e82167532075a81f2dada3dbbf8c76498818999e5b9ac7605d35b2d78e5313eb11708cffc7cf
7
+ data.tar.gz: 6fd043d99737320357be4f098acf4b89e0a235c51e0c9d8162f3e5f50cc6953a4ad5abb7c0564e87251bf726d5adca9375e364c21e322fd3745321452b644c88
@@ -19,6 +19,10 @@ module PagarMe
19
19
  update PagarMe::Request.post( url 'cancel' ).run
20
20
  end
21
21
 
22
+ def settle_charge
23
+ update PagarMe::Request.post( url 'settle_charge' ).run
24
+ end
25
+
22
26
  def transactions
23
27
  PagarMe::Request.get( url 'transactions' ).call
24
28
  end
@@ -1,3 +1,3 @@
1
1
  module PagarMe
2
- VERSION = '2.1.4'
2
+ VERSION = '2.2.0'
3
3
  end
@@ -41,12 +41,12 @@ module PagarMe
41
41
  assert_equal anticipation.id, anticipation.confirm.id
42
42
  end
43
43
 
44
- should 'create a building anticipation an later delete it' do
44
+ should 'create a building anticipation and later delete it' do
45
45
  recipient = PagarMe::Recipient.default
46
46
  anticipation = recipient.bulk_anticipate anticipation_params(build: true)
47
47
 
48
48
  assert_equal anticipation.id, PagarMe::BulkAnticipation.find(recipient.id, anticipation.id).id
49
- PagarMe::BulkAnticipation.delete(recipient.id, anticipation.id).id
49
+ PagarMe::BulkAnticipation.delete(recipient.id, anticipation.id)
50
50
  assert_raises PagarMe::NotFound do
51
51
  PagarMe::BulkAnticipation.find recipient.id, anticipation.id
52
52
  end
@@ -96,5 +96,14 @@ module PagarMe
96
96
  subscription.cancel
97
97
  assert_equal subscription.status, 'canceled'
98
98
  end
99
+
100
+ should 'be able to settle_charge a subscription' do
101
+ plan = PagarMe::Plan.create no_trial_plan_params
102
+ subscription = PagarMe::Subscription.create boleto_with_customer_params(plan: plan)
103
+ assert_equal subscription.status, 'unpaid'
104
+
105
+ subscription.settle_charge
106
+ assert_equal subscription.status, 'paid'
107
+ end
99
108
  end
100
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagarme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Franceschi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-29 00:00:00.000000000 Z
12
+ date: 2017-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project:
249
- rubygems_version: 2.5.1
249
+ rubygems_version: 2.6.8
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Allows integration with Pagar.me