smartkiosk-client 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/payment.rb +3 -3
- data/lib/smartkiosk/client/version.rb +1 -1
- metadata +4 -4
data/app/models/payment.rb
CHANGED
@@ -62,13 +62,13 @@ class Payment < ActiveRecord::Base
|
|
62
62
|
def commission_for(amount)
|
63
63
|
return 0 if commissions.blank?
|
64
64
|
|
65
|
-
commission = commissions.select{|x| x.
|
65
|
+
commission = commissions.select{|x| x[:max].to_f >= amount && amount >= x[:min].to_f }.
|
66
66
|
sort_by{|x| x[:weight]}.first
|
67
67
|
|
68
68
|
return 0 if commission.blank?
|
69
69
|
|
70
|
-
static = commission[
|
71
|
-
percent = ((commission[
|
70
|
+
static = commission[:static_fee].try(:to_f) || 0
|
71
|
+
percent = ((commission[:percent_fee].try(:to_f) || 0)/100*amount).round(2)
|
72
72
|
|
73
73
|
static+percent
|
74
74
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartkiosk-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -610,7 +610,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
610
610
|
version: '0'
|
611
611
|
segments:
|
612
612
|
- 0
|
613
|
-
hash: -
|
613
|
+
hash: -48018568023470807
|
614
614
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
615
615
|
none: false
|
616
616
|
requirements:
|
@@ -619,10 +619,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
619
619
|
version: '0'
|
620
620
|
segments:
|
621
621
|
- 0
|
622
|
-
hash: -
|
622
|
+
hash: -48018568023470807
|
623
623
|
requirements: []
|
624
624
|
rubyforge_project:
|
625
|
-
rubygems_version: 1.8.
|
625
|
+
rubygems_version: 1.8.23
|
626
626
|
signing_key:
|
627
627
|
specification_version: 3
|
628
628
|
summary: Smartkiosk client application
|