stripe_invoice 1.1.9 → 1.2.0
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c6dfe686b7a97782882f7c40fb6417fd8204059
|
|
4
|
+
data.tar.gz: 7a8d2c46029a2feac984008368a74ebd189d9093
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
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.
|
|
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 (
|
|
119
|
-
pdf-core (~> 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
|
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.
|
|
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-
|
|
11
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|