pagarme 2.2.0 → 2.2.1

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
  SHA1:
3
- metadata.gz: fa7618dbed41921964204454e2f5e568f9b0fb7a
4
- data.tar.gz: b6d6bb41a4596ff19aede42f71d161722e24ba72
3
+ metadata.gz: 36d2fe66777a388468cb31c9bc02079de172905a
4
+ data.tar.gz: de0576a6dc2742182decc10c4e0213d823e2f47d
5
5
  SHA512:
6
- metadata.gz: dee689b807add92e702f32fef9e444cf0380489683ed3643bab7e82167532075a81f2dada3dbbf8c76498818999e5b9ac7605d35b2d78e5313eb11708cffc7cf
7
- data.tar.gz: 6fd043d99737320357be4f098acf4b89e0a235c51e0c9d8162f3e5f50cc6953a4ad5abb7c0564e87251bf726d5adca9375e364c21e322fd3745321452b644c88
6
+ metadata.gz: 3827f3a0412367c196da58878633f5543845050996526c264834c0826284af8a7706b47530747ec87efb4627fcdc18651e829e37b3bcaf01fb6b93363a2a48c1
7
+ data.tar.gz: 6f1a9f211f73e59ab447de74268c693c53b875367241d23b5c80f36a3f972e8f0780ad0a3fdf846fb9713a1e0dcbb2b712cdffce38ce968eb7ad1ffeb98b9be0
@@ -2,11 +2,13 @@ module PagarMe
2
2
  class BalanceOperation < PagarMeObject
3
3
 
4
4
  def method_missing(name, *args, &block)
5
+ super name, *args, &block
6
+ rescue NameError
5
7
  if @attributes['movement_object'] && @attributes['movement_object'].respond_to?(name)
6
- return movement_object.public_send(name, *args, &block)
8
+ return @attributes['movement_object'].public_send(name, *args, &block)
7
9
  end
8
10
 
9
- super name, *args, &block
11
+ raise $!
10
12
  end
11
13
 
12
14
  class << self
@@ -0,0 +1,4 @@
1
+ module PagarMe
2
+ class FeeCollection < PagarMeObject
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module PagarMe
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  class Fixtures
2
3
  def transaction
3
4
  { amount: 1000 }
@@ -47,6 +48,10 @@ class Fixtures
47
48
  }
48
49
  end
49
50
 
51
+ def invalid_card_number
52
+ card.merge card_number: '4043405'
53
+ end
54
+
50
55
  def refused_card
51
56
  # In test environment CVV's that starts with digit 6 are refused by acquirer
52
57
  card.merge card_cvv: '600'
@@ -138,10 +138,9 @@ module PagarMe
138
138
  end
139
139
 
140
140
  should 'validate transaction with invalid card_number' do
141
- exception = assert_raises PagarMe::ValidationError do
142
- PagarMe::Transaction.charge transaction_with_card_params(card_number: '123456')
143
- end
144
- assert exception.errors.any?{ |error| error.parameter_name == 'card_number' }
141
+ transaction = PagarMe::Transaction.new transaction_with_customer_with_invalid_card_number_params
142
+ transaction.charge
143
+ assert_equal transaction.status, 'refused'
145
144
  end
146
145
 
147
146
  should 'validate transaction missing card_holder_name' do
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.0
4
+ version: 2.2.1
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: 2017-06-27 00:00:00.000000000 Z
12
+ date: 2017-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -196,6 +196,7 @@ files:
196
196
  - lib/pagarme/resources/card.rb
197
197
  - lib/pagarme/resources/company.rb
198
198
  - lib/pagarme/resources/customer.rb
199
+ - lib/pagarme/resources/fee_collection.rb
199
200
  - lib/pagarme/resources/payable.rb
200
201
  - lib/pagarme/resources/phone.rb
201
202
  - lib/pagarme/resources/plan.rb