pagarme 2.2.3 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db5b0e92f65d2d065a616357285a3de7b5ec66b5ef991871f9f2c679b29132c3
4
- data.tar.gz: 03bd32113e09fb42c6b4fdba8e39029024888d3cfce904becd6463ebca6b3796
3
+ metadata.gz: 8038539ca34d2ee84026309a4e5b984a928c2ce9fc03c88815d8feb6d78fe2ad
4
+ data.tar.gz: 31a54704b88c6b8cf267230cc2c5c5a7674fd9dc0f20f62e45a1769f8193e1e9
5
5
  SHA512:
6
- metadata.gz: 9896fd9ba0cac786daa28b8849455bf5e8cfde76a9d06333cd9dbfab3f2fae45ee42a292d81baf108fb6ccbf59ff05a02b83da44d22d0796f13b2233b8fc1d70
7
- data.tar.gz: 9bc3cd79018bb639f669cb9ce1f13735830819a5e04a9db0da8b325fb0543482e4140b1d27ee89586635989c4e407bb44231b3f87430403662431ad4831670bf
6
+ metadata.gz: 98e830178072ad3ccbdf999f60909bd09c5a2cbdf02ee37e3387aec815b11266e3fbfa43929d986408700eaee3a6c0d01c635c00b5e2659abada0ddff2ac2af2
7
+ data.tar.gz: e2d01c0b5ac463233b538908eadbac7ede42b8c1c32c4ea7eceb3187224ff4cd142dffc2446e01a02cd3d7f7e322021d332728abba07b14553957c1a5ea31e0b
@@ -0,0 +1,7 @@
1
+ module PagarMe
2
+ class PaymentLink < Model
3
+ def cancel()
4
+ update PagarMe::Request.post(url('cancel')).run
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module PagarMe
2
- VERSION = '2.2.3'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -0,0 +1,26 @@
1
+ require_relative '../../test_helper'
2
+
3
+ module PagarMe
4
+ class PaymentLinkTest < PagarMeTestCase
5
+ should 'be able to create a payment_link' do
6
+ payment_link = PagarMe::PaymentLink.create payment_link_params
7
+ assert_equal payment_link.amount, 1000
8
+ end
9
+
10
+ should 'be able to cancel a payment_link' do
11
+ payment_link = PagarMe::PaymentLink.create payment_link_params
12
+ payment_link.cancel
13
+ assert_equal payment_link.status, 'canceled'
14
+ end
15
+
16
+ should 'be able to search by short_id' do
17
+ pl = PagarMe::PaymentLink.create payment_link_params
18
+ payment_links = PagarMe::PaymentLink.find short_id: pl.short_id
19
+
20
+ assert payment_links.size > 0
21
+ payment_links.each do |payment_link|
22
+ assert_equal payment_link.short_id, pl.short_id
23
+ end
24
+ end
25
+ end
26
+ 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.2.3
4
+ version: 2.3.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: 2018-07-20 00:00:00.000000000 Z
12
+ date: 2018-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -200,6 +200,7 @@ files:
200
200
  - lib/pagarme/resources/fee_collection.rb
201
201
  - lib/pagarme/resources/item.rb
202
202
  - lib/pagarme/resources/payable.rb
203
+ - lib/pagarme/resources/payment_link.rb
203
204
  - lib/pagarme/resources/phone.rb
204
205
  - lib/pagarme/resources/plan.rb
205
206
  - lib/pagarme/resources/postal_code.rb
@@ -223,6 +224,7 @@ files:
223
224
  - test/pagarme/resources/bulk_anticipation_test.rb
224
225
  - test/pagarme/resources/card_test.rb
225
226
  - test/pagarme/resources/payable_test.rb
227
+ - test/pagarme/resources/payment_link.rb
226
228
  - test/pagarme/resources/plan_test.rb
227
229
  - test/pagarme/resources/postback_test.rb
228
230
  - test/pagarme/resources/recipient_test.rb
@@ -250,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
252
  version: '0'
251
253
  requirements: []
252
254
  rubyforge_project:
253
- rubygems_version: 2.7.3
255
+ rubygems_version: 2.7.6
254
256
  signing_key:
255
257
  specification_version: 4
256
258
  summary: Allows integration with Pagar.me
@@ -264,6 +266,7 @@ test_files:
264
266
  - test/pagarme/resources/bulk_anticipation_test.rb
265
267
  - test/pagarme/resources/card_test.rb
266
268
  - test/pagarme/resources/payable_test.rb
269
+ - test/pagarme/resources/payment_link.rb
267
270
  - test/pagarme/resources/plan_test.rb
268
271
  - test/pagarme/resources/postback_test.rb
269
272
  - test/pagarme/resources/recipient_test.rb