pagarme 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +1 -1
- data/lib/pagarme.rb +11 -4
- data/lib/pagarme/errors.rb +23 -23
- data/lib/pagarme/model.rb +50 -50
- data/lib/pagarme/object.rb +135 -135
- data/lib/pagarme/plan.rb +4 -4
- data/lib/pagarme/request.rb +58 -58
- data/lib/pagarme/subscription.rb +34 -34
- data/lib/pagarme/transaction.rb +15 -8
- data/lib/pagarme/transaction_common.rb +81 -81
- data/lib/pagarme/util.rb +12 -9
- data/pagarme.gemspec +1 -1
- data/test/pagarme/object.rb +17 -17
- data/test/pagarme/plan.rb +9 -9
- data/test/pagarme/subscription.rb +61 -61
- data/test/pagarme/transaction.rb +158 -148
- data/test/test_helper.rb +76 -76
- metadata +2 -2
data/test/test_helper.rb
CHANGED
@@ -4,108 +4,108 @@ require 'shoulda'
|
|
4
4
|
|
5
5
|
def test_transaction(params = {})
|
6
6
|
return PagarMe::Transaction.new({
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
:card_number => "4901720080344448",
|
8
|
+
:card_holder_name => "Jose da Silva",
|
9
|
+
:card_expiration_month => "10",
|
10
|
+
:card_expiration_year => "15",
|
11
|
+
:card_cvv => "314",
|
12
|
+
:amount => 1000
|
13
13
|
}.merge(params))
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_subscription_without_plan(params = {})
|
17
17
|
return PagarMe::Subscription.new({
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
:payment_method => 'credit_card',
|
19
|
+
:card_number => "4901720080344448",
|
20
|
+
:card_holder_name => "Jose da Silva",
|
21
|
+
:card_expiration_month => "10",
|
22
|
+
:card_expiration_year => "15",
|
23
|
+
:card_cvv => "314",
|
24
|
+
:postback_url => "http://test.com/postback",
|
25
|
+
:customer => {
|
26
|
+
:email => 'customer@pagar.me'
|
27
|
+
}
|
28
28
|
}.merge(params))
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_plan(params = {})
|
32
32
|
return PagarMe::Plan.new({
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
:name => "Plano gold",
|
34
|
+
:trial_days => 5,
|
35
|
+
:days => 30,
|
36
|
+
:amount => 3000,
|
37
37
|
}.merge(params))
|
38
38
|
end
|
39
39
|
|
40
40
|
|
41
41
|
def test_subscription(params = {})
|
42
42
|
return PagarMe::Subscription.new({
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
43
|
+
:payment_method => 'credit_card',
|
44
|
+
:card_number => "4901720080344448",
|
45
|
+
:card_holder_name => "Jose da Silva",
|
46
|
+
:card_expiration_month => "10",
|
47
|
+
:card_expiration_year => "15",
|
48
|
+
:card_cvv => "314",
|
49
|
+
:postback_url => "http://test.com/postback",
|
50
|
+
:customer => {
|
51
|
+
email: 'customer@pagar.me'
|
52
|
+
}
|
53
53
|
}.merge(params))
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_transaction_with_customer(params = {})
|
57
57
|
return PagarMe::Transaction.new({
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
58
|
+
:amount => 1000,
|
59
|
+
:card_number => '4901720080344448',
|
60
|
+
:card_holder_name => "Jose da Silva",
|
61
|
+
:card_expiration_month => 11,
|
62
|
+
:card_expiration_year => "14",
|
63
|
+
:card_cvv => 356,
|
64
|
+
:customer => {
|
65
|
+
:name => "Jose da Silva",
|
66
|
+
:document_number => "36433809847",
|
67
|
+
:email => "henrique@pagar.me",
|
68
|
+
:address => {
|
69
|
+
:street => 'Av. Brigadeiro Faria Lima',
|
70
|
+
:neighborhood => 'Itaim bibi',
|
71
|
+
:zipcode => '01452000',
|
72
|
+
:street_number => 2941,
|
73
|
+
},
|
74
|
+
:phone => {
|
75
|
+
:ddd => 12,
|
76
|
+
:number => '981433533',
|
77
|
+
},
|
78
|
+
:sex => 'M',
|
79
|
+
:born_at => '1970-10-11'
|
80
|
+
}
|
81
81
|
}.merge(params))
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_subscription_with_customer(params = {})
|
85
85
|
return PagarMe::Subscription.new({
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
86
|
+
:amount => 1000,
|
87
|
+
:card_number => '4901720080344448',
|
88
|
+
:card_holder_name => "Jose da silva",
|
89
|
+
:card_expiration_month => 11,
|
90
|
+
:card_expiration_year => 14,
|
91
|
+
:card_cvv => 356,
|
92
|
+
:customer => {
|
93
|
+
:name => "Jose da Silva",
|
94
|
+
:document_number => "36433809847",
|
95
|
+
:email => "henrique@pagar.me",
|
96
|
+
:address => {
|
97
|
+
:street => 'Av. Brigadeiro Faria Lima',
|
98
|
+
:neighborhood => 'Itaim bibi',
|
99
|
+
:zipcode => '01452000',
|
100
|
+
:street_number => 1000,
|
101
|
+
} ,
|
102
|
+
:phone => {
|
103
|
+
:ddd => 12,
|
104
|
+
:number => '981444444',
|
105
|
+
} ,
|
106
|
+
:sex => 'M',
|
107
|
+
:born_at => '1970-10-11'
|
108
|
+
}
|
109
109
|
}.merge(params))
|
110
110
|
end
|
111
111
|
|
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.9.
|
4
|
+
version: 1.9.3
|
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: 2014-
|
12
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|