catarse_pagarme 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/catarse_pagarme/payment_slip.js +1 -1
- data/app/controllers/catarse_pagarme/slip_controller.rb +1 -1
- data/app/views/catarse_pagarme/pagarme/review.html.slim +1 -1
- data/lib/catarse_pagarme/version.rb +1 -1
- data/spec/controllers/catarse_pagarme/slip_controller_spec.rb +3 -2
- data/spec/dummy/app/models/bank.rb +2 -0
- data/spec/dummy/app/models/bank_account.rb +2 -1
- data/spec/models/catarse_pagarme/slip_transaction_spec.rb +2 -2
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd54372cd3851a958fdb96641330bf113010abd6
|
4
|
+
data.tar.gz: 4a53093cf2dbd9ba4de19308254f189b45083405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258192985026c1a93e543fe53c1a5a39da1fc8aff3e1750a8755cedd827256189ce3944454713472c184c83e2cde4ba4bf981402611f4674e47c910a0ba22977
|
7
|
+
data.tar.gz: 1a1282bb0256fc83450f7a7b10e7af4ea6cb12145e698252b94f80da20b1ca5b2f15ace5e7a3e890740db788c23891fb69ff28a21ed4da9df0d188674d30c2ed
|
data/Gemfile.lock
CHANGED
@@ -33,7 +33,7 @@ App.views.PagarmeForm.addChild('PaymentSlip', {
|
|
33
33
|
var bankAccountAttributes = {
|
34
34
|
user: {
|
35
35
|
bank_account_attributes: {
|
36
|
-
|
36
|
+
bank_id: that.$('select#user_bank_account_attributes_bank_id').val(),
|
37
37
|
agency: that.$('input#user_bank_account_attributes_agency').val(),
|
38
38
|
agency_digit: that.$('input#user_bank_account_attributes_agency_digit').val(),
|
39
39
|
account: that.$('input#user_bank_account_attributes_account').val(),
|
@@ -33,7 +33,7 @@ module CatarsePagarme
|
|
33
33
|
attrs.permit(:payment_method, :amount, :postback_url, customer: [:name, :email],
|
34
34
|
user: [
|
35
35
|
bank_account_attributes: [
|
36
|
-
:
|
36
|
+
:bank_id, :account, :account_digit, :agency,
|
37
37
|
:agency_digit, :owner_name, :owner_document
|
38
38
|
]
|
39
39
|
])
|
@@ -97,7 +97,7 @@
|
|
97
97
|
= simple_form_for current_user, url: 'javascript:void(0)' do |f|
|
98
98
|
.bank_accounts
|
99
99
|
= f.simple_fields_for :bank_account do |bank_form|
|
100
|
-
= bank_form.input :
|
100
|
+
= bank_form.input :bank_id, as: :select, collection: Bank.all, input_html: { style: 'width: 150px' }
|
101
101
|
= bank_form.input :agency, as: :string
|
102
102
|
= bank_form.input :agency_digit, as: :string
|
103
103
|
= bank_form.input :account, as: :string
|
@@ -4,6 +4,7 @@ describe CatarsePagarme::SlipController do
|
|
4
4
|
before do
|
5
5
|
PaymentEngines.stub(:find_payment).and_return(contribution)
|
6
6
|
controller.stub(:current_user).and_return(user)
|
7
|
+
Bank.create(name: 'foo', code: '123')
|
7
8
|
end
|
8
9
|
|
9
10
|
let(:project) { create(:project, goal: 10_000, state: 'online') }
|
@@ -29,7 +30,7 @@ describe CatarsePagarme::SlipController do
|
|
29
30
|
post :create, {
|
30
31
|
locale: :pt, project_id: project.id, contribution_id: contribution.id, use_route: 'catarse_pagarme',
|
31
32
|
user: { bank_account_attributes: {
|
32
|
-
|
33
|
+
bank_id: Bank.first.id, agency: '1', agency_digit: '1', account: '1', account_digit: '1', owner_name: 'foo', owner_document: '1'
|
33
34
|
} } }
|
34
35
|
end
|
35
36
|
|
@@ -46,7 +47,7 @@ describe CatarsePagarme::SlipController do
|
|
46
47
|
let(:user) { contribution.user }
|
47
48
|
|
48
49
|
before do
|
49
|
-
post :create, { locale: :pt, project_id: project.id, contribution_id: contribution.id, use_route: 'catarse_pagarme', user: { bank_account_attributes: {
|
50
|
+
post :create, { locale: :pt, project_id: project.id, contribution_id: contribution.id, use_route: 'catarse_pagarme', user: { bank_account_attributes: { owner_name: '' } } }
|
50
51
|
end
|
51
52
|
|
52
53
|
it 'boleto_url should be nil' do
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class BankAccount < ActiveRecord::Base
|
2
2
|
belongs_to :user
|
3
|
+
belongs_to :bank
|
3
4
|
|
4
|
-
validates :
|
5
|
+
validates :bank_id, :agency, :agency_digit, :account, :owner_name, :owner_document, :account_digit, presence: true
|
5
6
|
end
|
@@ -19,7 +19,7 @@ describe CatarsePagarme::SlipTransaction do
|
|
19
19
|
postback_url: 'http://test.foo'
|
20
20
|
}, user: {
|
21
21
|
bank_account_attributes: {
|
22
|
-
|
22
|
+
bank_id: 1, agency: '1', agency_digit: '1',
|
23
23
|
account: '1', account_digit: '1', owner_name: 'foo',
|
24
24
|
owner_document: 'bar'
|
25
25
|
}
|
@@ -35,7 +35,7 @@ describe CatarsePagarme::SlipTransaction do
|
|
35
35
|
postback_url: 'http://test.foo'
|
36
36
|
}, user: {
|
37
37
|
bank_account_attributes: {
|
38
|
-
|
38
|
+
owner_name: ''
|
39
39
|
}
|
40
40
|
}
|
41
41
|
}
|
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: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antônio Roberto Silva
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- spec/dummy/app/helpers/application_helper.rb
|
148
148
|
- spec/dummy/app/mailers/.keep
|
149
149
|
- spec/dummy/app/models/.keep
|
150
|
+
- spec/dummy/app/models/bank.rb
|
150
151
|
- spec/dummy/app/models/bank_account.rb
|
151
152
|
- spec/dummy/app/models/category.rb
|
152
153
|
- spec/dummy/app/models/concerns/.keep
|
@@ -232,6 +233,7 @@ test_files:
|
|
232
233
|
- spec/dummy/app/helpers/application_helper.rb
|
233
234
|
- spec/dummy/app/mailers/.keep
|
234
235
|
- spec/dummy/app/models/.keep
|
236
|
+
- spec/dummy/app/models/bank.rb
|
235
237
|
- spec/dummy/app/models/bank_account.rb
|
236
238
|
- spec/dummy/app/models/category.rb
|
237
239
|
- spec/dummy/app/models/concerns/.keep
|