catarse_pagarme 2.15.0 → 3.0.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
- SHA256:
3
- metadata.gz: 33de3fd1e6afdac8723405f945acc3d89d97be9420eace3c44f354e01113de6f
4
- data.tar.gz: b25b6ad732704f9faf108861a844936ba21722b7ab41be1fb06f155510413d9e
2
+ SHA1:
3
+ metadata.gz: 2332f6cfdac072a251e551bf613d418bc78b6d3e
4
+ data.tar.gz: 69a48d1f6d34d6687fa517e412c2b366a68d1a8b
5
5
  SHA512:
6
- metadata.gz: 73b17f419b5ef6ab87886c5642dd83fccb1189737a3398e5698d6aaf5cb60457846816fc547185c5fbbcafd9c8092b78f55d0a3c26648e9de03643c1c9343007
7
- data.tar.gz: 8740a9e7f9ce6296534ea70ba43d183788b850bc100dcf82a8bdf8631dcc3b53f519b27912e5ecdea0fd479e042da3534e6d1a819f4bf48042cabc8658e00d4f
6
+ metadata.gz: 9f3b834d363373059b2be3b0ded2a6fd7853e84f329ad76af15bb705e84209bc79542adcdad44aed2d74b76e442d3e25f3a523b7581bedae13b72844774ea0ed
7
+ data.tar.gz: 0f63789a591afc297019d4b3145504a9f93e500fd79ad422af60e618fce79fef278af7f0cf13f812529f8885e1374615c9ec610128fa047737debf834cef8f99
@@ -1,11 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- catarse_pagarme (2.15.0)
5
- countries (= 3.0.0)
4
+ catarse_pagarme (3.0.0)
6
5
  konduto-ruby (= 2.1.0)
7
6
  pagarme (= 2.1.4)
8
- rails (~> 4.0)
7
+ rails
9
8
  sentry-raven
10
9
  sidekiq
11
10
  weekdays (>= 1.0.2)
@@ -13,171 +12,180 @@ PATH
13
12
  GEM
14
13
  remote: https://rubygems.org/
15
14
  specs:
16
- actionmailer (4.2.10)
17
- actionpack (= 4.2.10)
18
- actionview (= 4.2.10)
19
- activejob (= 4.2.10)
15
+ actioncable (5.2.4.3)
16
+ actionpack (= 5.2.4.3)
17
+ nio4r (~> 2.0)
18
+ websocket-driver (>= 0.6.1)
19
+ actionmailer (5.2.4.3)
20
+ actionpack (= 5.2.4.3)
21
+ actionview (= 5.2.4.3)
22
+ activejob (= 5.2.4.3)
20
23
  mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 1.0, >= 1.0.5)
22
- actionpack (4.2.10)
23
- actionview (= 4.2.10)
24
- activesupport (= 4.2.10)
25
- rack (~> 1.6)
26
- rack-test (~> 0.6.2)
27
- rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-dom-testing (~> 2.0)
25
+ actionpack (5.2.4.3)
26
+ actionview (= 5.2.4.3)
27
+ activesupport (= 5.2.4.3)
28
+ rack (~> 2.0, >= 2.0.8)
29
+ rack-test (>= 0.6.3)
30
+ rails-dom-testing (~> 2.0)
28
31
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (4.2.10)
30
- activesupport (= 4.2.10)
32
+ actionview (5.2.4.3)
33
+ activesupport (= 5.2.4.3)
31
34
  builder (~> 3.1)
32
- erubis (~> 2.7.0)
33
- rails-dom-testing (~> 1.0, >= 1.0.5)
35
+ erubi (~> 1.4)
36
+ rails-dom-testing (~> 2.0)
34
37
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (4.2.10)
36
- activesupport (= 4.2.10)
37
- globalid (>= 0.3.0)
38
- activemodel (4.2.10)
39
- activesupport (= 4.2.10)
40
- builder (~> 3.1)
41
- activerecord (4.2.10)
42
- activemodel (= 4.2.10)
43
- activesupport (= 4.2.10)
44
- arel (~> 6.0)
45
- activesupport (4.2.10)
46
- i18n (~> 0.7)
38
+ activejob (5.2.4.3)
39
+ activesupport (= 5.2.4.3)
40
+ globalid (>= 0.3.6)
41
+ activemodel (5.2.4.3)
42
+ activesupport (= 5.2.4.3)
43
+ activerecord (5.2.4.3)
44
+ activemodel (= 5.2.4.3)
45
+ activesupport (= 5.2.4.3)
46
+ arel (>= 9.0)
47
+ activestorage (5.2.4.3)
48
+ actionpack (= 5.2.4.3)
49
+ activerecord (= 5.2.4.3)
50
+ marcel (~> 0.3.1)
51
+ activesupport (5.2.4.3)
52
+ concurrent-ruby (~> 1.0, >= 1.0.2)
53
+ i18n (>= 0.7, < 2)
47
54
  minitest (~> 5.1)
48
- thread_safe (~> 0.3, >= 0.3.4)
49
55
  tzinfo (~> 1.1)
50
- arel (6.0.4)
51
- builder (3.2.3)
52
- coderay (1.1.2)
53
- concurrent-ruby (1.0.5)
54
- connection_pool (2.2.2)
55
- countries (3.0.0)
56
- i18n_data (~> 0.8.0)
57
- sixarm_ruby_unaccent (~> 1.1)
58
- unicode_utils (~> 1.4)
59
- crass (1.0.4)
60
- database_cleaner (1.7.0)
61
- diff-lcs (1.3)
56
+ arel (9.0.0)
57
+ builder (3.2.4)
58
+ coderay (1.1.3)
59
+ concurrent-ruby (1.1.6)
60
+ connection_pool (2.2.3)
61
+ crass (1.0.6)
62
+ database_cleaner (1.8.5)
63
+ diff-lcs (1.4.4)
62
64
  domain_name (0.5.20190701)
63
65
  unf (>= 0.0.5, < 1.0.0)
64
- erubis (2.7.0)
66
+ erubi (1.9.0)
65
67
  factory_girl (4.9.0)
66
68
  activesupport (>= 3.0.0)
67
69
  factory_girl_rails (4.9.0)
68
70
  factory_girl (~> 4.9.0)
69
71
  railties (>= 3.0.0)
70
- faraday (1.0.1)
72
+ faraday (1.1.0)
71
73
  multipart-post (>= 1.2, < 3)
74
+ ruby2_keywords
72
75
  globalid (0.4.2)
73
76
  activesupport (>= 4.2.0)
74
77
  http-accept (1.7.0)
75
78
  http-cookie (1.0.3)
76
79
  domain_name (~> 0.5)
77
- i18n (0.9.5)
80
+ i18n (1.8.3)
78
81
  concurrent-ruby (~> 1.0)
79
- i18n_data (0.8.0)
80
82
  konduto-ruby (2.1.0)
81
- loofah (2.2.2)
83
+ loofah (2.6.0)
82
84
  crass (~> 1.0.2)
83
85
  nokogiri (>= 1.5.9)
84
86
  mail (2.7.1)
85
87
  mini_mime (>= 0.1.1)
86
- method_source (0.9.0)
88
+ marcel (0.3.3)
89
+ mimemagic (~> 0.3.2)
90
+ method_source (1.0.0)
87
91
  mime-types (3.3.1)
88
92
  mime-types-data (~> 3.2015)
89
- mime-types-data (3.2019.1009)
93
+ mime-types-data (3.2020.0512)
94
+ mimemagic (0.3.5)
90
95
  mini_mime (1.0.2)
91
- mini_portile2 (2.3.0)
92
- minitest (5.11.3)
93
- multi_json (1.14.1)
96
+ mini_portile2 (2.4.0)
97
+ minitest (5.14.1)
98
+ multi_json (1.15.0)
94
99
  multipart-post (2.1.1)
95
100
  netrc (0.11.0)
96
- nokogiri (1.8.4)
97
- mini_portile2 (~> 2.3.0)
101
+ nio4r (2.5.4)
102
+ nokogiri (1.10.9)
103
+ mini_portile2 (~> 2.4.0)
98
104
  pagarme (2.1.4)
99
105
  multi_json
100
106
  rest-client
101
- pg (0.15.0)
102
- pry (0.11.3)
103
- coderay (~> 1.1.0)
104
- method_source (~> 0.9.0)
105
- rack (1.6.10)
106
- rack-protection (2.0.8.1)
107
+ pg (1.2.3)
108
+ pry (0.13.1)
109
+ coderay (~> 1.1)
110
+ method_source (~> 1.0)
111
+ rack (2.2.3)
112
+ rack-protection (2.1.0)
107
113
  rack
108
- rack-test (0.6.3)
109
- rack (>= 1.0)
110
- rails (4.2.10)
111
- actionmailer (= 4.2.10)
112
- actionpack (= 4.2.10)
113
- actionview (= 4.2.10)
114
- activejob (= 4.2.10)
115
- activemodel (= 4.2.10)
116
- activerecord (= 4.2.10)
117
- activesupport (= 4.2.10)
118
- bundler (>= 1.3.0, < 2.0)
119
- railties (= 4.2.10)
120
- sprockets-rails
121
- rails-deprecated_sanitizer (1.0.3)
122
- activesupport (>= 4.2.0.alpha)
123
- rails-dom-testing (1.0.9)
124
- activesupport (>= 4.2.0, < 5.0)
125
- nokogiri (~> 1.6)
126
- rails-deprecated_sanitizer (>= 1.0.1)
127
- rails-html-sanitizer (1.0.4)
128
- loofah (~> 2.2, >= 2.2.2)
129
- railties (4.2.10)
130
- actionpack (= 4.2.10)
131
- activesupport (= 4.2.10)
114
+ rack-test (1.1.0)
115
+ rack (>= 1.0, < 3)
116
+ rails (5.2.4.3)
117
+ actioncable (= 5.2.4.3)
118
+ actionmailer (= 5.2.4.3)
119
+ actionpack (= 5.2.4.3)
120
+ actionview (= 5.2.4.3)
121
+ activejob (= 5.2.4.3)
122
+ activemodel (= 5.2.4.3)
123
+ activerecord (= 5.2.4.3)
124
+ activestorage (= 5.2.4.3)
125
+ activesupport (= 5.2.4.3)
126
+ bundler (>= 1.3.0)
127
+ railties (= 5.2.4.3)
128
+ sprockets-rails (>= 2.0.0)
129
+ rails-dom-testing (2.0.3)
130
+ activesupport (>= 4.2.0)
131
+ nokogiri (>= 1.6)
132
+ rails-html-sanitizer (1.3.0)
133
+ loofah (~> 2.3)
134
+ railties (5.2.4.3)
135
+ actionpack (= 5.2.4.3)
136
+ activesupport (= 5.2.4.3)
137
+ method_source
132
138
  rake (>= 0.8.7)
133
- thor (>= 0.18.1, < 2.0)
134
- rake (12.3.1)
135
- redis (4.1.3)
139
+ thor (>= 0.19.0, < 2.0)
140
+ rake (13.0.1)
141
+ redis (4.1.4)
136
142
  rest-client (2.1.0)
137
143
  http-accept (>= 1.7.0, < 2.0)
138
144
  http-cookie (>= 1.0.2, < 2.0)
139
145
  mime-types (>= 1.16, < 4.0)
140
146
  netrc (~> 0.8)
141
- rspec-core (3.8.0)
142
- rspec-support (~> 3.8.0)
143
- rspec-expectations (3.8.1)
147
+ rspec-core (3.9.2)
148
+ rspec-support (~> 3.9.3)
149
+ rspec-expectations (3.9.2)
144
150
  diff-lcs (>= 1.2.0, < 2.0)
145
- rspec-support (~> 3.8.0)
146
- rspec-mocks (3.8.0)
151
+ rspec-support (~> 3.9.0)
152
+ rspec-mocks (3.9.1)
147
153
  diff-lcs (>= 1.2.0, < 2.0)
148
- rspec-support (~> 3.8.0)
149
- rspec-rails (3.8.0)
154
+ rspec-support (~> 3.9.0)
155
+ rspec-rails (3.9.1)
150
156
  actionpack (>= 3.0)
151
157
  activesupport (>= 3.0)
152
158
  railties (>= 3.0)
153
- rspec-core (~> 3.8.0)
154
- rspec-expectations (~> 3.8.0)
155
- rspec-mocks (~> 3.8.0)
156
- rspec-support (~> 3.8.0)
157
- rspec-support (3.8.0)
158
- sentry-raven (3.0.0)
159
+ rspec-core (~> 3.9.0)
160
+ rspec-expectations (~> 3.9.0)
161
+ rspec-mocks (~> 3.9.0)
162
+ rspec-support (~> 3.9.0)
163
+ rspec-support (3.9.3)
164
+ ruby2_keywords (0.0.2)
165
+ sentry-raven (3.1.1)
159
166
  faraday (>= 1.0)
160
- sidekiq (5.2.8)
167
+ sidekiq (5.2.9)
161
168
  connection_pool (~> 2.2, >= 2.2.2)
162
- rack (< 2.1.0)
169
+ rack (~> 2.0)
163
170
  rack-protection (>= 1.5.0)
164
- redis (>= 3.3.5, < 5)
165
- sixarm_ruby_unaccent (1.2.0)
171
+ redis (>= 3.3.5, < 4.2)
166
172
  sprockets (3.7.2)
167
173
  concurrent-ruby (~> 1.0)
168
174
  rack (> 1, < 3)
169
- sprockets-rails (3.2.1)
175
+ sprockets-rails (3.2.2)
170
176
  actionpack (>= 4.0)
171
177
  activesupport (>= 4.0)
172
178
  sprockets (>= 3.0.0)
173
- thor (0.20.0)
179
+ thor (1.0.1)
174
180
  thread_safe (0.3.6)
175
- tzinfo (1.2.5)
181
+ tzinfo (1.2.7)
176
182
  thread_safe (~> 0.1)
177
183
  unf (0.1.4)
178
184
  unf_ext
179
185
  unf_ext (0.0.7.7)
180
- unicode_utils (1.4.0)
186
+ websocket-driver (0.7.3)
187
+ websocket-extensions (>= 0.1.0)
188
+ websocket-extensions (0.1.5)
181
189
  weekdays (1.0.2)
182
190
 
183
191
  PLATFORMS
@@ -3,8 +3,8 @@ require "pagarme"
3
3
  module CatarsePagarme
4
4
  class ApplicationController < ActionController::Base
5
5
 
6
- before_filter :authenticate_user!
7
- before_filter :configure_pagarme
6
+ before_action :authenticate_user!
7
+ before_action :configure_pagarme
8
8
  helper_method :payment
9
9
  layout :false
10
10
 
@@ -1,6 +1,6 @@
1
1
  module CatarsePagarme
2
2
  class NotificationsController < CatarsePagarme::ApplicationController
3
- skip_before_filter :authenticate_user!
3
+ skip_before_action :authenticate_user!
4
4
 
5
5
  def create
6
6
  if payment
@@ -59,9 +59,9 @@ module CatarsePagarme
59
59
 
60
60
  def order_attributes
61
61
  {
62
- id: self.transaction.id.to_s,
62
+ id: self.transaction.id.to_s[0..99],
63
63
  total_amount: self.attributes[:amount] / 100.0,
64
- visitor: self.attributes.dig(:metadata, :contribution_id).to_s,
64
+ visitor: self.attributes.dig(:metadata, :contribution_id).to_s[0..40],
65
65
  currency: 'BRL',
66
66
  installments: self.attributes[:installments],
67
67
  purchased_at: self.transaction.date_created,
@@ -74,10 +74,10 @@ module CatarsePagarme
74
74
  tax_id = customer[:document_number].present? ? { tax_id: customer[:document_number] } : {}
75
75
 
76
76
  {
77
- id: customer[:id].to_s,
78
- name: customer[:name],
79
- email: customer[:email],
80
- phone1: customer[:phone].to_h.values.join,
77
+ id: customer[:id].to_s[0..99],
78
+ name: customer[:name].to_s[0..99],
79
+ email: customer[:email].to_s[0..99],
80
+ phone1: customer[:phone].to_h.values.join.to_s[0..99],
81
81
  created_at: self.attributes.dig(:antifraud_metadata, :register, :registered_at)
82
82
  }.merge(tax_id)
83
83
  end
@@ -95,33 +95,33 @@ module CatarsePagarme
95
95
  def billing_address_attributes
96
96
  billing_data = self.attributes.dig(:antifraud_metadata, :billing)
97
97
  {
98
- name: self.transaction.card.holder_name,
99
- address1: billing_data.dig(:address, :street),
100
- city: billing_data.dig(:address, :city),
101
- state: billing_data.dig(:address, :state),
102
- zip: billing_data.dig(:address, :zipcode),
103
- country: billing_data.dig(:address, :country_code),
98
+ name: self.transaction.card.holder_name.to_s[0..99],
99
+ address1: billing_data.dig(:address, :street).to_s[0..254],
100
+ city: billing_data.dig(:address, :city).to_s[0..99],
101
+ state: billing_data.dig(:address, :state).to_s[0..99],
102
+ zip: billing_data.dig(:address, :zipcode).to_s[0..99],
103
+ country: billing_data.dig(:address, :country_code).to_s[0..1],
104
104
  }
105
105
  end
106
106
 
107
107
  def shipping_address_attributes
108
108
  shipping_data = self.attributes.dig(:antifraud_metadata, :shipping)
109
109
  {
110
- name: shipping_data.dig(:customer, :name),
111
- address1: shipping_data.dig(:address, :street),
112
- city: shipping_data.dig(:address, :city),
113
- state: shipping_data.dig(:address, :state),
114
- zip: shipping_data.dig(:address, :zipcode)
110
+ name: shipping_data.dig(:customer, :name).to_s[0..99],
111
+ address1: shipping_data.dig(:address, :street).to_s[0..254],
112
+ city: shipping_data.dig(:address, :city).to_s[0..99],
113
+ state: shipping_data.dig(:address, :state).to_s[0..99],
114
+ zip: shipping_data.dig(:address, :zipcode).to_s[0..99]
115
115
  }
116
116
  end
117
117
 
118
118
  def item_attributes
119
119
  shopping_cart_data = self.attributes.dig(:antifraud_metadata, :shopping_cart).first
120
120
  {
121
- sku: self.attributes.dig(:metadata, :contribution_id).to_s,
122
- product_code: self.attributes.dig(:metadata, :contribution_id).to_s,
121
+ sku: self.attributes.dig(:metadata, :contribution_id).to_s[0..99],
122
+ product_code: self.attributes.dig(:metadata, :contribution_id).to_s[0..99],
123
123
  category: 9999,
124
- name: shopping_cart_data[:name],
124
+ name: shopping_cart_data[:name].to_s[0..99],
125
125
  unit_cost: self.attributes[:amount] / 100.0,
126
126
  quantity: 1,
127
127
  created_at: self.attributes.dig(:metadata, :project_online).to_s[0..9]
@@ -131,8 +131,8 @@ module CatarsePagarme
131
131
  def seller_attributes
132
132
  event_data = self.attributes.dig(:antifraud_metadata, :events).first
133
133
  {
134
- id: event_data[:id],
135
- name: event_data[:venue_name],
134
+ id: event_data[:id].to_s[0..99],
135
+ name: event_data[:venue_name].to_s[0..99],
136
136
  created_at: event_data[:date]
137
137
  }
138
138
  end
@@ -1,14 +1,13 @@
1
1
  module CatarsePagarme
2
2
  class PaymentDelegator
3
3
  attr_accessor :payment, :transaction
4
- include FeeCalculatorConcern
5
4
 
6
5
  def initialize(payment)
7
6
  configure_pagarme
8
7
  self.payment = payment
9
8
  end
10
9
 
11
- def change_status_by_transaction(transaction_status)
10
+ def change_status_by_transaction(transaction_status)
12
11
  case transaction_status
13
12
  when 'pending_review' then
14
13
  self.payment.try(:notify_about_pending_review)
@@ -32,7 +31,7 @@ module CatarsePagarme
32
31
  def update_transaction
33
32
  fill_acquirer_data
34
33
  payment.installment_value = (value_for_installment / 100.0).to_f
35
- payment.gateway_fee = get_fee
34
+ PaymentEngines.import_payables(payment)
36
35
  payment.save!
37
36
  end
38
37
 
@@ -17,8 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.files = `git ls-files`.split($\)
18
18
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
19
 
20
- s.add_dependency "countries", "3.0.0"
21
- s.add_dependency "rails", "~> 4.0"
20
+ s.add_dependency "rails"
22
21
  s.add_dependency "pagarme", "2.1.4"
23
22
  s.add_dependency "konduto-ruby", "2.1.0"
24
23
  s.add_dependency "weekdays", ">= 1.0.2"
@@ -1,6 +1,5 @@
1
1
  require "pagarme"
2
2
  require "konduto-ruby"
3
- require "countries"
4
3
  require "catarse_pagarme/engine"
5
4
  require "catarse_pagarme/configuration"
6
5
  require "catarse_pagarme/payment_engine"
@@ -1,3 +1,3 @@
1
1
  module CatarsePagarme
2
- VERSION = "2.15.0"
2
+ VERSION = "3.0.0"
3
3
  end
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.15.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
@@ -9,36 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-26 00:00:00.000000000 Z
12
+ date: 2020-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: countries
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '='
19
- - !ruby/object:Gem::Version
20
- version: 3.0.0
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '='
26
- - !ruby/object:Gem::Version
27
- version: 3.0.0
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: rails
30
16
  requirement: !ruby/object:Gem::Requirement
31
17
  requirements:
32
- - - "~>"
18
+ - - ">="
33
19
  - !ruby/object:Gem::Version
34
- version: '4.0'
20
+ version: '0'
35
21
  type: :runtime
36
22
  prerelease: false
37
23
  version_requirements: !ruby/object:Gem::Requirement
38
24
  requirements:
39
- - - "~>"
25
+ - - ">="
40
26
  - !ruby/object:Gem::Version
41
- version: '4.0'
27
+ version: '0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: pagarme
44
30
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +180,6 @@ files:
194
180
  - app/models/catarse_pagarme/balance_transfer_delegator.rb
195
181
  - app/models/catarse_pagarme/bank_account_concern.rb
196
182
  - app/models/catarse_pagarme/credit_card_transaction.rb
197
- - app/models/catarse_pagarme/fee_calculator_concern.rb
198
183
  - app/models/catarse_pagarme/payment_concern.rb
199
184
  - app/models/catarse_pagarme/payment_delegator.rb
200
185
  - app/models/catarse_pagarme/payment_type.rb
@@ -305,7 +290,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
290
  - !ruby/object:Gem::Version
306
291
  version: '0'
307
292
  requirements: []
308
- rubygems_version: 3.0.4
293
+ rubyforge_project:
294
+ rubygems_version: 2.6.14.1
309
295
  signing_key:
310
296
  specification_version: 4
311
297
  summary: Integration with Pagar.me
@@ -1,21 +0,0 @@
1
- module CatarsePagarme::FeeCalculatorConcern
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
-
6
- def get_fee
7
- return nil if self.payment.payment_method.blank? # We always depend on the payment_choice
8
-
9
- transaction = PagarMe::Transaction.find(self.payment.gateway_id)
10
- payables = transaction.payables
11
- cost = transaction.cost.to_f / 100.00
12
- payables_fee = payables_fee.to_a.sum(&:fee).to_f / 100.00
13
-
14
- if self.payment.payment_method == ::CatarsePagarme::PaymentType::SLIP
15
- cost + payables_fee
16
- else
17
- payables_fee == 0 ? cost : payables_fee
18
- end
19
- end
20
- end
21
- end