catarse_pagarme 3.0.0 → 3.0.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: 2332f6cfdac072a251e551bf613d418bc78b6d3e
4
- data.tar.gz: 69a48d1f6d34d6687fa517e412c2b366a68d1a8b
3
+ metadata.gz: 0e7be854657adedb16a5144be548f82a1d4afb2a
4
+ data.tar.gz: fcc26b9e7c29296a0f0718fb763714446a1b0ad7
5
5
  SHA512:
6
- metadata.gz: 9f3b834d363373059b2be3b0ded2a6fd7853e84f329ad76af15bb705e84209bc79542adcdad44aed2d74b76e442d3e25f3a523b7581bedae13b72844774ea0ed
7
- data.tar.gz: 0f63789a591afc297019d4b3145504a9f93e500fd79ad422af60e618fce79fef278af7f0cf13f812529f8885e1374615c9ec610128fa047737debf834cef8f99
6
+ metadata.gz: be12e118913110b6a09a4003c7e1d7721c78e235b4453868f8b8e2ade9742939999223fb8f4df1e14b7d3714666efd361ebe96089ef3866569fe71c24104a9da
7
+ data.tar.gz: 744fc8c23ccfb2e2e65bc2f21c8ca6a1e43e1a1cdf1309161a1bea1b3b22118d131c258c4436d8c91a1eed9c2f27d769f5456c005f6cf5c1c13c1dce5922aa03
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (3.0.0)
4
+ catarse_pagarme (3.0.1)
5
5
  konduto-ruby (= 2.1.0)
6
6
  pagarme (= 2.1.4)
7
7
  rails
@@ -26,7 +26,7 @@ module CatarsePagarme
26
26
  transfer.create
27
27
  raise "unable to create a transfer" unless transfer.id.present?
28
28
 
29
- balance_transfer.update_attribute(:transfer_id, transfer.id)
29
+ balance_transfer.update(transfer_id: transfer.id)
30
30
  balance_transfer.transition_to(:processing, transfer_data: transfer.to_hash)
31
31
  balance_transfer
32
32
  end
@@ -40,7 +40,7 @@ module CatarsePagarme
40
40
  }.merge(credit_card_identifier)
41
41
  )
42
42
 
43
- unless payment.update_attributes(gateway: 'Pagarme', payment_method: payment_method)
43
+ unless payment.update(gateway: 'Pagarme', payment_method: payment_method)
44
44
  raise ::PagarMe::PagarMeError.new(payment.errors.messages.values.flatten.to_sentence)
45
45
  end
46
46
 
@@ -127,7 +127,7 @@ module CatarsePagarme
127
127
  raise "unable to create a transfer" unless transfer.id.present?
128
128
 
129
129
  #avoid sending notification
130
- payment.update_attributes(state: 'pending_refund')
130
+ payment.update(state: 'pending_refund')
131
131
  payment.payment_transfers.create!({
132
132
  user: payment.user,
133
133
  transfer_id: transfer.id,
@@ -1,9 +1,10 @@
1
1
  module CatarsePagarme
2
2
  class SlipTransaction < TransactionBase
3
3
  def charge!
4
- unless payment.update_attributes({
4
+ unless payment.update(
5
5
  gateway: 'Pagarme',
6
- payment_method: payment_method})
6
+ payment_method: payment_method
7
+ )
7
8
 
8
9
  raise ::PagarMe::PagarMeError.new(
9
10
  payment.errors.messages.values.flatten.to_sentence)
@@ -10,7 +10,7 @@ module CatarsePagarme
10
10
  end
11
11
 
12
12
  def change_payment_state
13
- self.payment.update_attributes(attributes_to_payment)
13
+ self.payment.update(attributes_to_payment)
14
14
  self.payment.save!
15
15
  delegator.update_transaction
16
16
  self.payment.payment_notifications.create(contribution_id: self.payment.contribution_id, extra_data: self.transaction.to_json)
@@ -9,7 +9,7 @@ class CatarsePagarme::VerifyPagarmeWorker
9
9
  raise "payment not found" unless payment.present?
10
10
  raise "source not found" unless source.present? && source.try(:[], "metadata").try(:[], "key") == key
11
11
 
12
- payment.update_attributes({gateway_id: source["id"]})
12
+ payment.update(gateway_id: source["id"])
13
13
  payment.pagarme_delegator.update_transaction
14
14
  payment.pagarme_delegator.change_status_by_transaction source["status"]
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -11,7 +11,7 @@ describe CatarsePagarme::CreditCardsController, type: :controller do
11
11
  let(:payment) do
12
12
  contribution.reload
13
13
  p = contribution.payments.first
14
- #p.update_attributes({ state: 'pending', gateway_id: nil })
14
+ #p.update(state: 'pending', gateway_id: nil)
15
15
  p
16
16
  end
17
17
 
@@ -13,7 +13,7 @@ describe CatarsePagarme::NotificationsController, type: :controller do
13
13
  let(:contribution) { create(:contribution, value: 10, project: project) }
14
14
  let(:payment) {
15
15
  p = contribution.payments.first
16
- p.update_attributes gateway_id: 'abcd'
16
+ p.update gateway_id: 'abcd'
17
17
  p
18
18
  }
19
19
  let(:credit_card) { create(:credit_card, subscription_id: '1542')}
@@ -48,4 +48,3 @@ describe CatarsePagarme::NotificationsController, type: :controller do
48
48
  end
49
49
 
50
50
  end
51
-
@@ -66,7 +66,7 @@ describe CatarsePagarme::SlipTransaction do
66
66
 
67
67
  context "with valid attributes" do
68
68
  before do
69
- payment.should_receive(:update_attributes).at_least(1).and_call_original
69
+ payment.should_receive(:update).at_least(1).and_call_original
70
70
  PagarMe::Transaction.should_receive(:find_by_id).with(pagarme_transaction.id).and_return(pagarme_transaction)
71
71
  CatarsePagarme::PaymentDelegator.any_instance.should_receive(:change_status_by_transaction).with('paid')
72
72
 
@@ -70,7 +70,7 @@ FactoryGirl.define do
70
70
  #after(:create) do |project|
71
71
  # create(:reward, project: project)
72
72
  # if project.state == 'change_to_online_after_create'
73
- # project.update_attributes(state: 'online')
73
+ # project.update(state: 'online')
74
74
  # end
75
75
  #end
76
76
  f.name "Foo bar"
@@ -190,5 +190,3 @@ FactoryGirl.define do
190
190
  f.name "foo"
191
191
  end
192
192
  end
193
-
194
-
@@ -23,7 +23,7 @@ describe CatarsePagarme::VerifyPagarmeWorker do
23
23
  allow_any_instance_of(CatarsePagarme::PaymentDelegator).to receive(:update_transaction)
24
24
  allow_any_instance_of(CatarsePagarme::PaymentDelegator).to receive(:change_status_by_transaction)
25
25
 
26
- expect_any_instance_of(Payment).to receive(:update_attributes).with({gateway_id: fake_transaction["id"]})
26
+ expect_any_instance_of(Payment).to receive(:update).with({gateway_id: fake_transaction["id"]})
27
27
  expect_any_instance_of(CatarsePagarme::PaymentDelegator).to receive(:update_transaction)
28
28
  expect_any_instance_of(CatarsePagarme::PaymentDelegator).to receive(:change_status_by_transaction).with(fake_transaction["status"])
29
29
  end
@@ -65,4 +65,3 @@ describe CatarsePagarme::VerifyPagarmeWorker do
65
65
  end
66
66
  end
67
67
  end
68
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_pagarme
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-12-08 00:00:00.000000000 Z
12
+ date: 2020-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails