pagarme 1.9.9 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/pagarme.rb +1 -0
- data/lib/pagarme/transfer.rb +7 -0
- data/pagarme.gemspec +1 -1
- data/test/pagarme/transfer.rb +35 -0
- data/test/test_helper.rb +6 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02be2895e11b1be63c1febc0746893a96e97733a
|
4
|
+
data.tar.gz: 0c68a40fdbc64a211aadd26d4150c0b90c48717b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e47e2b2466854cac0fbe527a3961d8fe0cc52e760a80089621b5b15196490b2458d1ad470fb91f707a7cecaffc28e7681922fea5b9a7e2cac2f71103a022133
|
7
|
+
data.tar.gz: 859fb27cf080486060f36e74fbcbe17cad835b2eb7f33987a9d3ba95713248071d84b6fbdd674c54e7de998ce059814ba4ba71758882a88aa976dae9f77e2a1b
|
data/README.md
CHANGED
data/lib/pagarme.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative 'pagarme/phone'
|
|
8
8
|
require_relative 'pagarme/address'
|
9
9
|
require_relative 'pagarme/subscription'
|
10
10
|
require_relative 'pagarme/transaction'
|
11
|
+
require_relative 'pagarme/transfer'
|
11
12
|
require_relative 'pagarme/card'
|
12
13
|
require_relative 'pagarme/plan'
|
13
14
|
require_relative 'pagarme/bank_account'
|
data/pagarme.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "pagarme"
|
7
|
-
spec.version = "1.
|
7
|
+
spec.version = "1.10.0"
|
8
8
|
spec.authors = ["Pedro Franceschi", "Henrique Dubugras"]
|
9
9
|
spec.email = ["pedrohfranceschi@gmail.com", "henrique@pagar.me"]
|
10
10
|
spec.description = %q{Pagar.me's ruby gem}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require_relative '../test_helper'
|
3
|
+
|
4
|
+
module PagarMe
|
5
|
+
class TransferTest < Test::Unit::TestCase
|
6
|
+
should 'be able to create a transfer' do
|
7
|
+
bank_account = test_bank_account
|
8
|
+
bank_account.create
|
9
|
+
transfer = test_transfer(bank_account_id: bank_account.id)
|
10
|
+
transfer.create
|
11
|
+
|
12
|
+
assert transfer.id != nil
|
13
|
+
assert transfer.fee != nil
|
14
|
+
assert transfer.object == "transfer"
|
15
|
+
assert %w(doc credito_em_conta ted).include?(transfer.type)
|
16
|
+
assert transfer.bank_account.id.to_i == bank_account.id.to_i
|
17
|
+
end
|
18
|
+
|
19
|
+
should 'be able to find with id' do
|
20
|
+
bank_account = test_bank_account
|
21
|
+
bank_account.create
|
22
|
+
transfer_r = test_transfer(bank_account_id: bank_account.id)
|
23
|
+
transfer_r.create
|
24
|
+
|
25
|
+
transfer = PagarMe::Transfer.find_by_id transfer_r.id
|
26
|
+
|
27
|
+
assert transfer.id != nil
|
28
|
+
assert transfer.fee != nil
|
29
|
+
assert transfer.object == "transfer"
|
30
|
+
assert %w(doc credito_em_conta ted).include?(transfer.type)
|
31
|
+
assert transfer.bank_account.id.to_i == bank_account.id.to_i
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
data/test/test_helper.rb
CHANGED
@@ -13,6 +13,12 @@ def test_transaction(params = {})
|
|
13
13
|
}.merge(params))
|
14
14
|
end
|
15
15
|
|
16
|
+
def test_transfer(params = {})
|
17
|
+
return PagarMe::Transfer.new({
|
18
|
+
amount: 1000,
|
19
|
+
}.merge(params))
|
20
|
+
end
|
21
|
+
|
16
22
|
def test_card(params = {})
|
17
23
|
return PagarMe::Card.new({
|
18
24
|
:card_number => '4111111111111111',
|
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: 1.
|
4
|
+
version: 1.10.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: 2015-
|
12
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/pagarme/subscription.rb
|
124
124
|
- lib/pagarme/transaction.rb
|
125
125
|
- lib/pagarme/transaction_common.rb
|
126
|
+
- lib/pagarme/transfer.rb
|
126
127
|
- lib/pagarme/util.rb
|
127
128
|
- pagarme.gemspec
|
128
129
|
- pagarme.rb
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- test/pagarme/plan.rb
|
134
135
|
- test/pagarme/subscription.rb
|
135
136
|
- test/pagarme/transaction.rb
|
137
|
+
- test/pagarme/transfer.rb
|
136
138
|
- test/test_helper.rb
|
137
139
|
homepage: http://pagar.me/
|
138
140
|
licenses: []
|
@@ -165,4 +167,5 @@ test_files:
|
|
165
167
|
- test/pagarme/plan.rb
|
166
168
|
- test/pagarme/subscription.rb
|
167
169
|
- test/pagarme/transaction.rb
|
170
|
+
- test/pagarme/transfer.rb
|
168
171
|
- test/test_helper.rb
|