catarse_pagarme 2.9.13 → 2.10.0

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: e89fa1f29aece060a0dbd5d4df8c86665754f9e4
4
- data.tar.gz: e5599584d466cc9d731b23fa94a6d431799e1ac4
3
+ metadata.gz: 13e41e1042979996f70a541f6ebcc6dabee702a3
4
+ data.tar.gz: 62be8eafb67cf278a86d3be55497518cee52a74f
5
5
  SHA512:
6
- metadata.gz: 7c433264f3666fd1c2eb4c09221711a693aac5cad37c211b46d0c8ba3856cde74c33abaf38ccd72e755e744d0d2173dded98e5db93d7ba5b863fed57136249a9
7
- data.tar.gz: 4f1a7b424910186c7236a6aa37ac6a12f19cc6c3cc916c033f04149a27985787fbd8b77b50693ba495e45518047140b8e2c699b9dbe682e5444c487fa7ab00fa
6
+ metadata.gz: 73f97f1552fb136a88597ed1e76edb8bc561a7b9af6c539c4c9f804b0c48c58b630ea057971aed3d777ee5d9effecddaf34f9bc48783157baf26e22eb5ea6d10
7
+ data.tar.gz: 0bb4d97849fbdb658bd7358b0418d643d8dac3fc89c5bb3b2b2c03af5e59e1a1379c412f4daad5d6b63a05fbd04570646f2fb834fd5c69a2c24c67d2436dcc8e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.9.13)
4
+ catarse_pagarme (2.10.0)
5
5
  pagarme (= 2.1.4)
6
6
  rails (~> 4.0)
7
7
  sidekiq
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module CatarsePagarme
2
3
  class CreditCardsController < CatarsePagarme::ApplicationController
3
4
  MAX_SOFT_DESCRIPTOR_LENGTH = 13
@@ -34,8 +35,8 @@ module CatarsePagarme
34
35
  soft_descriptor: payment.project.permalink.gsub(/[\W\_]/, ' ')[0, MAX_SOFT_DESCRIPTOR_LENGTH],
35
36
  installments: get_installment,
36
37
  customer: {
37
- email: contribution.payer_email,
38
- name: contribution.payer_name,
38
+ email: contribution.user.email,
39
+ name: contribution.user.name,
39
40
  document_number: document_number,
40
41
  address: {
41
42
  street: contribution.address_street,
@@ -52,7 +53,8 @@ module CatarsePagarme
52
53
  number: phone_matches.try(:[], 2)
53
54
  }
54
55
  },
55
- metadata: metadata_attributes
56
+ metadata: metadata_attributes,
57
+ antifraud_metadata: af_metadata
56
58
  }
57
59
 
58
60
  if params[:card_hash].present?
@@ -71,7 +73,7 @@ module CatarsePagarme
71
73
  end
72
74
 
73
75
  def document_number
74
- international? ? '00000000000' : contribution.payer_document.gsub(/[-.\/_\s]/,'')
76
+ international? ? '00000000000' : contribution.user.cpf.gsub(/[-.\/_\s]/,'')
75
77
  end
76
78
 
77
79
  def phone_matches
@@ -118,5 +120,136 @@ module CatarsePagarme
118
120
  collection.compact
119
121
  end
120
122
 
123
+ def address_hash
124
+ {
125
+ country: contribution.country.try(:name),
126
+ state: contribution.address_state,
127
+ city: contribution.address_city,
128
+ zipcode: contribution.address_zip_code.try(:gsub, /[-.\/_\s]/, ''),
129
+ neighborhood: contribution.address_neighbourhood,
130
+ street: contribution.address_street,
131
+ street_number: contribution.address_number,
132
+ complementary: contribution.address_complement,
133
+ latitude: '',
134
+ longitude: ''
135
+ }
136
+ end
137
+
138
+ def af_metadata
139
+ return {} unless CatarsePagarme.configuration.use_simility
140
+ project = contribution.project
141
+ project_account = project.account
142
+ user = contribution.user
143
+
144
+ {
145
+ session_id: contribution.id.to_s,
146
+ ip: user.current_sign_in_ip,
147
+ platform: "web",
148
+ register: {
149
+ id: contribution.user_id.to_s,
150
+ email: user.email,
151
+ registered_at: user.created_at.to_s,
152
+ login_source: "registered",
153
+ company_group: "",
154
+ classification_code: ""
155
+ },
156
+ billing: {
157
+ customer: {
158
+ name: "",
159
+ document_number: contribution.card_owner_document.try(:gsub, /[-.\/_\s]/, ''),
160
+ born_at: "",
161
+ gender: ""
162
+ },
163
+ address: address_hash,
164
+ phone_numbers: [{
165
+ ddi: "",
166
+ ddd: phone_matches.try(:[], 1),
167
+ number: phone_matches.try(:[], 2)
168
+ }]
169
+ },
170
+ buyer: {
171
+ name: user.name,
172
+ document_number: user.cpf.try(:gsub, /[-.\/_\s]/, ''),
173
+ born_at: "",
174
+ gender: ""
175
+ },
176
+ address: address_hash,
177
+ phone_numbers: [{
178
+ ddi: "",
179
+ ddd: phone_matches.try(:[], 1),
180
+ number: phone_matches.try(:[], 2)
181
+ }],
182
+ shipping: {
183
+ customer: {
184
+ name: contribution.user.name,
185
+ document_number: contribution.user.cpf.try(:gsub, /[-.\/_\s]/, ''),
186
+ born_at: "",
187
+ gender: ""
188
+ },
189
+ address: address_hash,
190
+ phone_numbers: [{
191
+ ddi: "00",
192
+ ddd: phone_matches.try(:[], 1),
193
+ number: phone_matches.try(:[], 2)
194
+ }],
195
+ shipping_method: "",
196
+ fee: 0,
197
+ favorite: false
198
+ },
199
+ shopping_cart: [{
200
+ name: "#{contribution.value.to_s} - #{contribution.project.name}",
201
+ type: "contribution",
202
+ quantity: "1",
203
+ unit_price: (contribution.value * 100).to_i.to_s,
204
+ totalAdditions: 0,
205
+ totalDiscounts: 0,
206
+ event_id: contribution.project_id.to_s,
207
+ ticket_type_id: "0",
208
+ ticket_owner_name: user.name,
209
+ ticket_owner_document_number: user.cpf.try(:gsub, /[-.\/_\s]/, '')
210
+ }],
211
+ discounts: [{
212
+ type: "other",
213
+ code: "",
214
+ amount: 0
215
+ }],
216
+ other_fees: [{
217
+ type: "",
218
+ amount: 0
219
+ }],
220
+ events: [{
221
+ id: contribution.project_id.to_s,
222
+ name: contribution.project.name,
223
+ type: contribution.project.mode == 'flex' ? 'flex' : 'full',
224
+ date: contribution.project.expires_at.to_s,
225
+ venue_name: project_account.try(:owner_name),
226
+ address: {
227
+ country: "Brasil",
228
+ state: project_account.address_state,
229
+ city: project_account.address_city,
230
+ zipcode: project_account.address_zip_code,
231
+ neighborhood: project_account.address_neighbourhood,
232
+ street: project_account.address_street,
233
+ street_number: project_account.address_number,
234
+ complementary: project_account.address_complement,
235
+ latitude: 0.0,
236
+ longitude: 0.0
237
+ },
238
+ ticket_types: [{
239
+ id: contribution.id,
240
+ name: "",
241
+ type: "",
242
+ batch: "",
243
+ price: (contribution.value * 100).to_i.to_s,
244
+ available_number: 0,
245
+ total_number: 0,
246
+ identity_verified: "",
247
+ assigned_seats: ""
248
+ }]
249
+ }]
250
+ }
251
+
252
+ end
253
+
121
254
  end
122
255
  end
@@ -1,10 +1,4 @@
1
1
  module CatarsePagarme
2
2
  class PagarmeController < CatarsePagarme::ApplicationController
3
-
4
- def review
5
- contribution
6
- current_user.build_bank_account unless current_user.bank_account
7
- end
8
-
9
3
  end
10
4
  end
data/config/routes.rb CHANGED
@@ -2,7 +2,6 @@ CatarsePagarme::Engine.routes.draw do
2
2
  resources :pagarme, only: [], path: "payment/pagarme" do
3
3
 
4
4
  member do
5
- get :review
6
5
  get :slip_data, to: 'slip#slip_data'
7
6
  get :second_slip, to: 'slip#update'
8
7
  get :get_installment, to: 'credit_cards#get_installment_json'
@@ -3,7 +3,7 @@ module CatarsePagarme
3
3
  attr_accessor :api_key, :slip_tax, :credit_card_tax, :interest_rate, :host, :subdomain, :protocol,
4
4
  :max_installments, :minimum_value_for_installment, :credit_card_cents_fee, :pagarme_tax, :stone_tax,
5
5
  :stone_installment_tax, :cielo_tax, :cielo_installment_diners_tax, :cielo_installment_not_diners_tax,
6
- :cielo_installment_amex_tax, :cielo_installment_not_amex_tax, :ecr_key, :slip_week_day_interval, :antifraud_tax
6
+ :cielo_installment_amex_tax, :cielo_installment_not_amex_tax, :ecr_key, :slip_week_day_interval, :antifraud_tax, :use_simility
7
7
 
8
8
  def initialize
9
9
  self.api_key = ''
@@ -27,6 +27,7 @@ module CatarsePagarme
27
27
  self.cielo_installment_amex_tax = 0
28
28
  self.cielo_installment_not_amex_tax = 0
29
29
  self.slip_week_day_interval = 2
30
+ self.use_simility = true
30
31
  end
31
32
  end
32
33
  end
@@ -5,7 +5,6 @@ module CatarsePagarme
5
5
  end
6
6
 
7
7
  def review_path contribution
8
- url_helpers.review_pagarme_path(contribution)
9
8
  end
10
9
 
11
10
  def locale
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.9.13"
2
+ VERSION = "2.10.0"
3
3
  end
@@ -21,6 +21,7 @@ FactoryGirl.define do
21
21
 
22
22
  factory :user do |f|
23
23
  f.name "Foo bar"
24
+ f.cpf "111.111.111-11"
24
25
  f.email { generate(:email) }
25
26
  end
26
27
 
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.9.13
4
+ version: 2.10.0
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: 2016-12-01 00:00:00.000000000 Z
12
+ date: 2017-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -140,11 +140,6 @@ files:
140
140
  - Rakefile
141
141
  - app/assets/images/catarse_pagarme/.keep
142
142
  - app/assets/javascripts/catarse_pagarme.js
143
- - app/assets/javascripts/catarse_pagarme/application.js
144
- - app/assets/javascripts/catarse_pagarme/credit_card.js
145
- - app/assets/javascripts/catarse_pagarme/payment_choice.js
146
- - app/assets/javascripts/catarse_pagarme/payment_slip.js
147
- - app/assets/stylesheets/catarse_pagarme/application.css
148
143
  - app/controllers/catarse_pagarme/application_controller.rb
149
144
  - app/controllers/catarse_pagarme/credit_cards_controller.rb
150
145
  - app/controllers/catarse_pagarme/notifications_controller.rb
@@ -163,8 +158,6 @@ files:
163
158
  - app/models/catarse_pagarme/payment_type.rb
164
159
  - app/models/catarse_pagarme/slip_transaction.rb
165
160
  - app/models/catarse_pagarme/transaction_base.rb
166
- - app/views/catarse_pagarme/pagarme/_terms.html.slim
167
- - app/views/catarse_pagarme/pagarme/review.html.slim
168
161
  - app/views/layouts/catarse_pagarme/application.html.erb
169
162
  - app/workers/catarse_pagarme/verify_pagarme_worker.rb
170
163
  - bin/rails
@@ -1,12 +0,0 @@
1
- App.addChild('Pagarme', {
2
- el: '#catarse_pagarme_form',
3
-
4
- activate: function() {
5
- this.message = this.$('.next_step_after_valid_document .alert-danger');
6
- this.loader = this.$('.loader img');
7
-
8
- this.contributionId = $('input#contribution_id').val();
9
- this.projectId = $('input#project_id').val();
10
- }
11
- });
12
-
@@ -1,185 +0,0 @@
1
- App.views.Pagarme.addChild('PaymentCard', _.extend({
2
- el: '#payment_type_credit_card_section form',
3
-
4
- events: {
5
- 'keyup input[type="text"]' : 'creditCardInputValidator',
6
- 'input #payment_card_number' : 'onKeyupPaymentCardNumber',
7
- 'click input#credit_card_submit' : 'onSubmit',
8
- 'change .creditcard-records' : 'onChangeCard',
9
- 'blur input' : 'checkInput'
10
- },
11
-
12
- onChangeCard: function(event){
13
- var $target = $(event.currentTarget);
14
- $target.siblings().removeClass('selected');
15
- $target.addClass('selected');
16
- if($(event.target).val() == 0){
17
- this.$('.type_card_data').slideDown('slow');
18
- }
19
- else{
20
- this.$('.type_card_data').slideUp('slow');
21
- }
22
- },
23
-
24
- activate: function(options){
25
- var that = this;
26
- this.setupForm();
27
- this.message = this.$('.payment-error-message');
28
- this.formatCreditCardInputs();
29
- window.app.maskAllElements();
30
- },
31
-
32
- formatCreditCardInputs: function(){
33
- this.$('#payment_card_number').payment('formatCardNumber');
34
- this.$('#payment_card_date').payment('formatCardExpiry');
35
- this.$('#payment_card_source').payment('formatCardCVC');
36
- },
37
-
38
- selectedCard: function() {
39
- return this.$('input:radio[data-stored][name=payment_subscription_card]:checked');
40
- },
41
-
42
- hasSelectedSomeCard: function() {
43
- return this.selectedCard().length > 0;
44
- },
45
-
46
- getInstallments: function() {
47
- if(this.hasSelectedSomeCard()) {
48
- return this.$('.my-credit-cards .selected select#payment_card_installments').val();
49
- } else {
50
- return this.$('.type_card_data select#payment_card_installments').val();
51
- }
52
- },
53
-
54
- onSubmit: function(e) {
55
- var that = this;
56
- e.preventDefault();
57
-
58
- if(!this.validate()){
59
- return false;
60
- }
61
-
62
- $(e.currentTarget).hide();
63
- that.parent.loader.show();
64
-
65
- if( that.hasSelectedSomeCard() ) {
66
- that.requestPayment({
67
- card_id: this.selectedCard().val(),
68
- payment_card_installments: that.getInstallments()
69
- });
70
- } else {
71
- PagarMe.encryption_key = this.$('.pagarme-e-key').data('key');
72
-
73
- var creditCard = this.newCreditCard();
74
- var fieldErrors = creditCard.fieldErrors();
75
-
76
- if(_.keys(fieldErrors).length > 0) {
77
- this.displayErrors(fieldErrors);
78
- } else {
79
- this.generateCardHash(creditCard);
80
- }
81
- }
82
-
83
- return false;
84
- },
85
-
86
- generateCardHash: function(creditCard){
87
- var that = this;
88
- creditCard.generateHash(function(cardHash) {
89
- that.requestPayment({
90
- card_hash: cardHash,
91
- payment_card_installments: that.getInstallments(),
92
- save_card: that.$('input#payment_save_card').is(':checked')
93
- });
94
- });
95
- },
96
-
97
- displayErrors: function(errors){
98
- var msg = [];
99
- this.parent.loader.hide();
100
-
101
- $.each(errors, function(i, value){
102
- msg.push(value)
103
- });
104
-
105
- this.message.find('.message-text').html(msg.join("<br/>"));
106
- this.message.slideDown('slow');
107
-
108
- $("#credit_card_submit").show();
109
- },
110
-
111
- newCreditCard: function(){
112
- var creditCard = new PagarMe.creditCard();
113
- creditCard.cardHolderName = this.$('input#payment_card_name').val();
114
- creditCard.cardExpirationMonth = $.trim(this.$('input#payment_card_date').val().split('/')[0]);
115
- creditCard.cardExpirationYear = $.trim(this.$('input#payment_card_date').val().split('/')[1]);
116
- creditCard.cardNumber = this.$('input#payment_card_number').val();
117
- creditCard.cardCVV = this.$('input#payment_card_source').val();
118
- return creditCard;
119
- },
120
-
121
- reUpdateContributionData: function(callback) {
122
- var contribution_data = {
123
- anonymous: $('#review_form #contribution_anonymous').is(':checked'),
124
- country_id: $('#review_form #contribution_country_id').val(),
125
- payer_name: $('#review_form #contribution_payer_name').val(),
126
- payer_email: $('#review_form #contribution_payer_email').val(),
127
- payer_document: $('#review_form #contribution_payer_document').val(),
128
- address_street: $('#review_form #contribution_address_street').val(),
129
- address_number: $('#review_form #contribution_address_number').val(),
130
- address_complement: $('#review_form #contribution_address_complement').val(),
131
- address_neighbourhood: $('#review_form #contribution_address_neighbourhood').val(),
132
- address_zip_code: $('#review_form #contribution_address_zip_code').val(),
133
- address_city: $('#review_form #contribution_address_city').val(),
134
- address_state: $('#review_form #contribution_address_state').val(),
135
- address_phone_number: $('#review_form #contribution_address_phone_number').val()
136
- };
137
- $.post($('#review_form').data('update-info-path'), {
138
- _method: 'put',
139
- contribution: contribution_data
140
- }).always(function(data) {
141
- callback();
142
- });
143
- },
144
-
145
- requestPayment: function(data){
146
- var that = this,
147
- doCreditCardAjax = function() {
148
- $.ajax({
149
- type: 'POST',
150
- url: '/payment/pagarme/'+that.parent.contributionId+'/pay_credit_card',
151
- data: data,
152
- success: function(response){
153
- that.parent.loader.hide();
154
-
155
- if(response.payment_status == 'failed'){
156
- that.message.find('.message-text').html(response.message);
157
- that.message.slideDown('slow');
158
-
159
- $("#credit_card_submit").show();
160
- } else {
161
- var thank_you = $('#project_review').data('thank-you-path');
162
-
163
- if(thank_you){
164
- location.href = thank_you;
165
- } else {
166
- location.href = '/';
167
- }
168
- }
169
- }
170
- });
171
- };
172
-
173
- this.reUpdateContributionData(doCreditCardAjax);
174
- },
175
-
176
- onKeyupPaymentCardNumber: function(e){
177
- var number = $(e.currentTarget).val();
178
- this.$('#payment_card_flag').html(this.getCardFlag(number));
179
- },
180
-
181
- getCardFlag: function(number) {
182
- var flag = $.payment.cardType(number);
183
- return flag && flag.toUpperCase();
184
- }
185
- }, Skull.Form));
@@ -1,21 +0,0 @@
1
- App.views.Pagarme.addChild('PaymentChoice', {
2
- el: '.list_payment',
3
-
4
- events: {
5
- 'change input[type="radio"]' : 'onListPaymentChange'
6
- },
7
-
8
- onListPaymentChange: function(e){
9
- var that = this.parent;
10
-
11
- $('.payment_section').fadeOut('fast', function(){
12
- var currentElementId = $(e.currentTarget).attr('id');
13
- that.$('#'+currentElementId+'_section').fadeIn('fast');
14
- });
15
- },
16
-
17
- activate: function(){
18
- var that = this.parent;
19
- that.$('input#payment_type_credit_card').click();
20
- }
21
- });
@@ -1,53 +0,0 @@
1
- App.views.Pagarme.addChild('PaymentSlip', _.extend({
2
- el: '#payment_type_slip_section form',
3
-
4
- events: {
5
- 'click input#build_boleto' : 'onBuildBoletoClick',
6
- 'blur input' : 'checkInput'
7
- },
8
-
9
- activate: function(options){
10
- app.userDocumentView.undelegateEvents();
11
- app._userDocumentView = null;
12
- app.userDocumentView;
13
- this.$('#user_bank_account_attributes_owner_name').data('custom-validation', this.validateName);
14
-
15
- this.setupForm();
16
- this.message = this.$('.payment-error-message');
17
- this.$('#user_bank_account_attributes_name').brbanks();
18
- },
19
-
20
- onBuildBoletoClick: function(e){
21
- var that = this;
22
-
23
- if(!this.validate()){
24
- return false;
25
- }
26
-
27
- var parent = this.parent;
28
-
29
- e.preventDefault();
30
- $(e.currentTarget).hide();
31
- this.$('#payment-slip-instructions').slideUp('slow');
32
- that.parent.loader.show();
33
-
34
- $.post('/payment/pagarme/'+that.parent.contributionId+'/pay_slip.json',null, 'json').success(function(response){
35
- parent.loader.hide();
36
- if(response.payment_status == 'failed'){
37
- that.message.find('.message-text').html(response.message);
38
- that.message.slideDown('slow')
39
-
40
- $(e.currentTarget).show();
41
- } else if(response.boleto_url) {
42
- var thank_you = $('#project_review').data('thank-you-path');
43
-
44
- if(thank_you){
45
- location.href = thank_you;
46
- } else {
47
- location.href = '/';
48
- }
49
- }
50
- });
51
- }
52
-
53
- }, Skull.Form));
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any styles
10
- * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
- * file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,7 +0,0 @@
1
- - project = @contribution.project
2
- .fontsize-smallest.u-text-center.u-marginbottom-30
3
- | Ao apoiar, você concorda com os
4
- = link_to 'Termos de Uso ', main_app.terms_of_use_path, class: 'alt-link'
5
- ' e
6
- = link_to 'Política de Privacidade', main_app.privacy_policy_path, class: 'alt-link'
7
-
@@ -1,113 +0,0 @@
1
- = javascript_include_tag 'catarse_pagarme', 'https://pagar.me/assets/pagarme-v2.min.js'
2
-
3
- #catarse_pagarme_form
4
- .next_step_after_valid_document
5
- .w-row.list_payment.w-form
6
- .w-col.w-col-7.w-col-small-7.back-payment-moip-options-column
7
- .w-radio.w-clearfix
8
- = radio_button_tag 'payment_type', "credit_card", false, class: 'w-radio-input back-payment-radio-button'
9
- = label_tag :payment_type_credit_card, nil, class: "cards w-form-label" do
10
- = image_tag 'catarse_bootstrap/payment_cards_pagarme.png'
11
- .w-col.w-col-5.w-col-small-5.back-payment-moip-options-column
12
- .w-radio.w-clearfix
13
- = radio_button_tag 'payment_type', "slip", false, class: 'w-radio-input back-payment-radio-button'
14
- = label_tag :payment_type_slip, class: "boleto w-form-label" do
15
- = image_tag 'catarse_bootstrap/payment_boleto.png'
16
-
17
- #payment_type_credit_card_section.payment_section
18
- = form_tag 'javascript:void(0);', :class => 'pagarme' do
19
- .pagarme-e-key data-key=CatarsePagarme.configuration.ecr_key
20
- div[class="my-credit-cards w-form back-payment-form-creditcard records-choice #{(current_user.credit_cards.present? ? '' : 'w-hidden')}"]
21
- - current_user.credit_cards.each_with_index do |credit_card, i|
22
- = label_tag "payment_subscription_card_#{credit_card.card_key}" do
23
- .w-row.creditcard-records
24
- .w-col.w-col-1.w-sub-col
25
- .w-radio.w-clearfix.back-payment-credit-card-radio-field
26
- = radio_button_tag :payment_subscription_card, credit_card.card_key, i == 0, {"data-stored" => true}
27
- .w-col.w-col-2.w-sub-col.w-sub-col-middle
28
- .fontsize-small.fontweight-semibold.text-success
29
- = credit_card.card_brand.upcase
30
- .w-col.w-col-5.w-sub-col.w-sub-col-middle
31
- .fontsize-small.fontweight-semibold.u-marginbottom-20
32
- = "XXXX.XXXX.XXXX.#{credit_card.last_digits}"
33
- .w-col.w-col-4
34
- - if @contribution.value.to_f >= CatarsePagarme.configuration.minimum_value_for_installment.to_f
35
- = select_tag :payment_card_installments, options_for_select(installments_for_select(payment)), class: 'w-select text-field text-field-creditcard'
36
- = label_tag :payment_subscription_card_0 do
37
- .w-row.creditcard-records
38
- .w-col.w-col-1.w-sub-col
39
- .w-radio.w-clearfix.back-payment-credit-card-radio-field
40
- = radio_button_tag :payment_subscription_card, 0
41
- .w-col.w-col-11
42
- .fontsize-small.fontweight-semibold.fontcolor-secondary
43
- = t('projects.contributions.edit.form_labels.user_another_card')
44
- div[class="w-form formwrapper type_card_data #{(current_user.credit_cards.present? ? 'w-hidden' : '')}"]
45
- .w-row
46
- .w-col.w-col-12
47
- .field-label.fontweight-semibold
48
- = label_tag :payment_card_name, t('projects.contributions.edit.form_labels.payment_card_name'), class: 'field-label fontweight-semibold'
49
- = text_field_tag :payment_card_name, nil, class: 'w-input text-field', required: true
50
- .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_name"]
51
- | Por favor digite o nome escrito no cartão
52
- .w-row
53
-
54
- .w-col.w-col-9.w-col-small-9.w-col-tiny-9.w-sub-col
55
- = label_tag :payment_card_number, t('projects.contributions.edit.form_labels.payment_card_number'), class: 'fontweight-semibold field-label'
56
- = phone_field_tag :payment_card_number, nil, class: 'w-input text-field', required: true
57
- .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_number"]
58
- | Por favor verifique o número do cartão de crédito
59
- .w-col.w-col-3.w-col-small-3.w-col-tiny-3
60
- = label_tag :payment_card_flag, t('projects.contributions.edit.form_labels.payment_card_flag'), class: 'fontweight-semibold field-label'
61
- #payment_card_flag.fontsize-smallest.fontcolor-secondary.u-text-center.w-input.text-field
62
- |&nbsp;
63
- .w-row
64
- .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col
65
- = label_tag :payment_card_source, t('projects.contributions.edit.form_labels.payment_card_source'), class: 'field-label fontweight-semibold w-hidden-medium'
66
- = label_tag :payment_card_source, t('projects.contributions.edit.form_labels.payment_card_source_short'), class: 'field-label fontweight-semibold w-hidden-main w-hidden-small w-hidden-tiny'
67
- = phone_field_tag :payment_card_source, nil, class: 'w-input text-field', required: true, autocomplete: 'off'
68
- .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_source"]
69
- | Veja o código de segurança do cartão abaixo da tarja magnética
70
- .w-col.w-col-6.w-col-small-6.w-col-tiny-6
71
- = label_tag :payment_card_date, t('projects.contributions.edit.form_labels.payment_card_date'), class: 'field-label fontweight-semibold'
72
- = phone_field_tag :payment_card_date, nil, class: 'w-input text-field', required: true
73
- .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="payment_card_date"]
74
- | Qual a data de expiração no cartão?
75
- - if @contribution.value.to_f >= CatarsePagarme.configuration.minimum_value_for_installment.to_f
76
- .w-row
77
- .w-col.w-col-6
78
- = label_tag :payment_card_installments, t('projects.contributions.edit.form_labels.payment_card_installments'), class: 'field-label fontweight-semibold'
79
- = select_tag :payment_card_installments, options_for_select(installments_for_select(payment)), class: 'w-select text-field'
80
- .w-checkbox.w-clearfix
81
- = check_box_tag :payment_save_card, 1, false, class: 'w-checkbox-input'
82
- = label_tag :payment_save_card, t('projects.contributions.edit.payment_save_card'), class: 'w-form-label'
83
- .w-row
84
- .w-col.w-col-12
85
- .payment-error-message.card.card-error.u-radius.zindex-10.u-marginbottom-30.w-hidden
86
- .fontsize-smaller.fontweight-bold.u-marginbottom-10= t('projects.contributions.edit.review_errors_title')
87
- .message-text.fontsize-smaller = t('.review_errors')
88
- .w-row
89
- .w-col.w-col-push-3.w-col-6
90
- #card-loading.loader.u-text-center.w-col.w-col-12.u-marginbottom-30 = image_tag "catarse_bootstrap/loader.gif"
91
- = submit_tag t('projects.contributions.edit.pay'), :class => 'btn btn-large u-marginbottom-20', :id => "credit_card_submit"
92
- = render partial: 'terms'
93
-
94
- #payment_type_slip_section.payment_section.w-hidden
95
- = simple_form_for current_user, url: 'javascript:void(0)' do |f|
96
- .w-row
97
- .w-col.w-col-12
98
- .payment-error-message.card.card-error.u-radius.zindex-10.u-marginbottom-30.w-hidden
99
- .fontsize-smaller.fontweight-bold.u-marginbottom-10= t('projects.contributions.edit.review_errors_title')
100
- .message-text.fontsize-smaller = t('.review_errors')
101
- .w-row
102
- .w-col.w-col-12
103
- .u-margintop-30.u-marginbottom-60.u-radius.card-big.card
104
- .fontsize-small.u-marginbottom-20= t('projects.contributions.edit.slip_expiration', date: l(payment.slip_expiration_date.to_date))
105
- .fontsize-small.u-marginbottom-40= t('projects.contributions.edit.slip_message')
106
-
107
- .w-row
108
- .w-col.w-col-2
109
- .w-col.w-col-8
110
- #card-loading.loader.u-text-center.w-col.w-col-12.u-marginbottom-30 = image_tag "catarse_bootstrap/loader.gif"
111
- = submit_tag t('projects.contributions.edit.print_slip'), :class => 'btn btn-large u-marginbottom-20', :id => "build_boleto"
112
- = render partial: 'terms'
113
- .w-col.w-col-2