smartkiosk-client 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.max >= amount && amount >= x.min }.
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['static_fee'] || 0
71
- percent = ((commission['percent_fee'] || 0)/100*amount).round(2)
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
@@ -2,6 +2,6 @@ require 'sinatra/base'
2
2
 
3
3
  module Smartkiosk
4
4
  class Client < Sinatra::Base
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
  end
7
7
  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.6
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: -2826995325778955365
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: -2826995325778955365
622
+ hash: -48018568023470807
623
623
  requirements: []
624
624
  rubyforge_project:
625
- rubygems_version: 1.8.24
625
+ rubygems_version: 1.8.23
626
626
  signing_key:
627
627
  specification_version: 3
628
628
  summary: Smartkiosk client application