catarse_pagarme 2.0.0 → 2.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: ea2622f55d3204092b95029e30222ee11d53ef09
4
- data.tar.gz: db723fbfa732d4415e27ac35f277aebc5bfe8435
3
+ metadata.gz: bd1c38dbfedfe7811ad3ce48e7f4f1a47d5b58d1
4
+ data.tar.gz: 774cd6aa399b49b02d556860666f05fd1a9ce882
5
5
  SHA512:
6
- metadata.gz: 959cc0e8544a66213446bf515ab834087d1ac24750aa8eb8ed400db618261e7406fb20eaf55ab2bf31a9e9c4b2a58536d8516f11c9d19698fc0880aca35b8f8b
7
- data.tar.gz: 53922520a96378bc0387cfdccbadbba0e00e6bc68c00cf79f25d6972850d13216dcb53e06e9035963868ee43cf8254002dbe04db7b3241e2307514040eead0ff
6
+ metadata.gz: 6c8c380fe5c5289fb83a2c1843bb4457fa76dd03a8440b6cad776e778d800cd9a9c9e1edf1ae3e1551eeb5661874e3f72c47b921e5c7b308704eebe49cf3cb9c
7
+ data.tar.gz: fcab2bcc585f6b081ff2fa9bb1eb4037d7ec90f1e04531342ccf680200770098288b01d0ffc7271a1c5f54c669f14a7fa979d77859fa14ed2f5d37f272af130c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.0.0)
4
+ catarse_pagarme (2.0.1)
5
5
  pagarme (~> 1.9.5)
6
6
  rails (~> 4.0)
7
7
 
@@ -36,9 +36,9 @@ module CatarsePagarme
36
36
  card_expiration_year: splited_month_and_year[1],
37
37
  card_cvv: params[:payment_card_source],
38
38
  amount: delegator.value_with_installment_tax(get_installment),
39
- postback_url: ipn_pagarme_url(contribution, host: CatarsePagarme.configuration.host,
40
- subdomain: CatarsePagarme.configuration.subdomain,
41
- protocol: CatarsePagarme.configuration.protocol),
39
+ postback_url: ipn_pagarme_index_url(host: CatarsePagarme.configuration.host,
40
+ subdomain: CatarsePagarme.configuration.subdomain,
41
+ protocol: CatarsePagarme.configuration.protocol),
42
42
  installments: get_installment,
43
43
  customer: {
44
44
  email: contribution.user.email,
@@ -15,5 +15,11 @@ module CatarsePagarme
15
15
 
16
16
  render nothing: true, status: 404
17
17
  end
18
+
19
+ protected
20
+
21
+ def contribution
22
+ @contribution ||= PaymentEngines.find_payment({ payment_id: params[:id] })
23
+ end
18
24
  end
19
25
  end
@@ -21,9 +21,9 @@ module CatarsePagarme
21
21
  payment_method: 'boleto',
22
22
  boleto_expiration_date: 2.days.from_now,
23
23
  amount: delegator.value_for_transaction,
24
- postback_url: ipn_pagarme_url(contribution, host: CatarsePagarme.configuration.host,
25
- subdomain: CatarsePagarme.configuration.subdomain,
26
- protocol: CatarsePagarme.configuration.protocol),
24
+ postback_url: ipn_pagarme_index_url(host: CatarsePagarme.configuration.host,
25
+ subdomain: CatarsePagarme.configuration.subdomain,
26
+ protocol: CatarsePagarme.configuration.protocol),
27
27
  customer: {
28
28
  email: contribution.user.email,
29
29
  name: contribution.user.name
data/config/routes.rb CHANGED
@@ -4,12 +4,15 @@ CatarsePagarme::Engine.routes.draw do
4
4
  member do
5
5
  get :review
6
6
  put :second_slip, to: 'slip#update'
7
- post :ipn, to: 'notifications#create'
8
7
  post :pay_credit_card, to: 'credit_cards#create'
9
8
  post :pay_slip, to: 'slip#create'
10
9
  post :pay_with_subscription, to: 'subscriptions#create'
11
10
  put :pay_with_subscription, to: 'subscriptions#update'
12
11
  end
13
12
 
13
+ collection do
14
+ post :ipn, to: 'notifications#create'
15
+ end
16
+
14
17
  end
15
18
  end
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -6,7 +6,7 @@ describe CatarsePagarme::NotificationsController do
6
6
  end
7
7
 
8
8
  let(:project) { create(:project, goal: 10_000, state: 'online') }
9
- let(:contribution) { create(:contribution, value: 10, project: project) }
9
+ let(:contribution) { create(:contribution, value: 10, project: project, payment_id: 'abcd') }
10
10
  let(:credit_card) { create(:credit_card, subscription_id: '1542')}
11
11
 
12
12
  describe 'CREATE' do
@@ -24,7 +24,7 @@ describe CatarsePagarme::NotificationsController do
24
24
  context "with valid contribution" do
25
25
  before do
26
26
  PaymentEngines.stub(:find_payment).and_return(contribution)
27
- post :create, { locale: :pt, id: contribution.id, use_route: 'catarse_pagarme' }
27
+ post :create, { locale: :pt, id: 'abcd', use_route: 'catarse_pagarme' }
28
28
  end
29
29
 
30
30
  it "should save an extra_data into payment_notifications" do
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: 2.0.0
4
+ version: 2.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: 2014-10-10 00:00:00.000000000 Z
12
+ date: 2014-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails