stripe_invoice 1.3.1 → 1.3.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df644f3ed96fa4252f80eed1698a5d5281cc484a
|
4
|
+
data.tar.gz: 90a0dd31292726cd2c018fcd893f8a418fd0af17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75e3bc64405cf840b164b385a4cad26ebd2164c7120d42e65862960a4af6d00d302b97103c64e846802d24db17437f80e12013c0453f857ba939b995d69d04cf
|
7
|
+
data.tar.gz: cde4bd6bf66f8490b7f9048e1e124524de4f2f729a4191548c0f3e0eaf059902ac54c56c6f169a293cc9d766c7ebd5c34ea03f031330dd19ffe01e966036c9d7
|
@@ -84,8 +84,8 @@ module StripeInvoice
|
|
84
84
|
next if key.blank?
|
85
85
|
|
86
86
|
result << {
|
87
|
-
amount: charges[key].sum{|char| char.total_less_refunds},
|
88
|
-
currency: charges[key].first[:currency
|
87
|
+
amount: charges[key].sum{|char| char[:charge].total_less_refunds},
|
88
|
+
currency: charges[key].first[:charge].currency,
|
89
89
|
tax_number: key
|
90
90
|
}
|
91
91
|
end
|
@@ -130,5 +130,10 @@ module StripeInvoice
|
|
130
130
|
Country[charge.country] ? charge.country :
|
131
131
|
((country = Country.find_country_by_name(charge.country)) ? country.alpha2 : 'Unkown Country')
|
132
132
|
end
|
133
|
+
|
134
|
+
def total_less_refunds(hash_sic)
|
135
|
+
total = hash_sic[:charge].total
|
136
|
+
total -= hash_sic[:refunds].sum {|refund| refund[:refund][:amount]} unless hash_sic[:refunds].blank?
|
137
|
+
end
|
133
138
|
end
|
134
139
|
end
|