stripe_invoice 1.1.9 → 1.2.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: 616409311934824c8ede7f580156e2664912d91b
4
- data.tar.gz: 07f34f1bd53246444d85163bf1c5ba19f93c8d5d
3
+ metadata.gz: 6c6dfe686b7a97782882f7c40fb6417fd8204059
4
+ data.tar.gz: 7a8d2c46029a2feac984008368a74ebd189d9093
5
5
  SHA512:
6
- metadata.gz: c32185a9fc1ddc25c155504c138a3f3c6840e44b95c698fcca1db34d6d027c76450c86c2b937d4b57313f7a168ee790b443f819d132ac23e1f1a3ef17407e270
7
- data.tar.gz: 960abd42e30e338ef6f5aa4481a505235291f3d36bc85b114c3530bfcfcd46f692a735e3683102428854a7154f6d86e0112c8bf4d532756b08feedecf33fb88a
6
+ metadata.gz: 18db738a95d002fb29994f0334d7facf8fb26707578a03d24f95315c0295a7b21f4062a65eb64a8f383218ab4be726317e8742ccaa30a6bf82f54d26f95e68b8
7
+ data.tar.gz: b7e3840dcd02bf295113d009e9b94abd72ae7eb87175dcb0bd0603a36fb240629b9eb6d61466d78c575e13e4b1969ac72a46d2201682764fc4c58f51a9a3f826
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stripe_invoice (1.1.3)
4
+ stripe_invoice (1.2.0)
5
5
  delayed_job_active_record
6
6
  haml-rails
7
7
  koudoku
@@ -101,11 +101,11 @@ GEM
101
101
  mime-types (1.25.1)
102
102
  mini_portile (0.6.1)
103
103
  multi_json (1.10.1)
104
- netrc (0.10.2)
104
+ netrc (0.10.3)
105
105
  nokogiri (1.6.4)
106
106
  mini_portile (~> 0.6.0)
107
107
  orm_adapter (0.5.0)
108
- pdf-core (0.4.0)
108
+ pdf-core (0.5.1)
109
109
  pdf-inspector (1.2.0)
110
110
  pdf-reader (~> 1.0)
111
111
  pdf-reader (1.3.3)
@@ -115,8 +115,8 @@ GEM
115
115
  ruby-rc4
116
116
  ttfunk
117
117
  polyglot (0.3.5)
118
- prawn (1.3.0)
119
- pdf-core (~> 0.4.0)
118
+ prawn (2.0.0)
119
+ pdf-core (~> 0.5.0)
120
120
  ttfunk (~> 1.4.0)
121
121
  prawn-rails (0.1.1)
122
122
  prawn
@@ -66,6 +66,7 @@ module StripeInvoice
66
66
  result = {
67
67
  transaction_volume: total_transaction_volume(sicharges),
68
68
  transaction_volume_by_country: transaction_volume_by_country(sicharges),
69
+ fees: total_fee_volume(sicharges),
69
70
  }
70
71
  end
71
72
 
@@ -75,6 +76,11 @@ module StripeInvoice
75
76
  unit: "#{sicharges.first[:bt][:currency].upcase} ")
76
77
  end
77
78
 
79
+ def total_fee_volume(sicharges)
80
+ number_to_currency(sicharges.inject(0) {|sum, hash_ch| sum + hash_ch[:bt][:fee]} / 100.0,
81
+ unit: "#{sicharges.first[:bt][:currency].upcase} ")
82
+ end
83
+
78
84
  def transaction_volume_by_country(sicharges)
79
85
  result = {}
80
86
 
@@ -11,6 +11,7 @@ prawn_document(:page_layout => :portrait) do |pdf|
11
11
  pdf.move_down 10
12
12
  pdf.text "Total charges in #{year}: #{sicharges.size}"
13
13
  pdf.text "Total transactions: #{totals[:transaction_volume]}"
14
+ pdf.text "Total Fees: #{totals[:fees]}"
14
15
 
15
16
  rows = [["Country", "Transaction volume"]]
16
17
  bt_unit = sicharges.first[:bt][:currency].upcase
@@ -1,3 +1,3 @@
1
1
  module StripeInvoice
2
- VERSION = "1.1.9"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Engelhardt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails