stripe_invoice 1.1.8 → 1.1.9

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: 1d5bba50f373bff1c628010e194c88c9973a7427
4
- data.tar.gz: 63d64db6857c180bdfa1d6b36c5fb264cc426abb
3
+ metadata.gz: 616409311934824c8ede7f580156e2664912d91b
4
+ data.tar.gz: 07f34f1bd53246444d85163bf1c5ba19f93c8d5d
5
5
  SHA512:
6
- metadata.gz: a06644e8670b7905522c438198b2213bf08cb62d6bebe3dbab770b1822569925bd839cf4985f698bb7dde2e8cf9e1f0437bc3329f7864b669bc8d79d60fbe83b
7
- data.tar.gz: ca9bcab7fcaccdfdfb42c245de18b789b027a298bb1202338e8512cfb303159d5fac0382b9a2ca5eed40714f3649a4c1110782e97139891470939b5133139950
6
+ metadata.gz: c32185a9fc1ddc25c155504c138a3f3c6840e44b95c698fcca1db34d6d027c76450c86c2b937d4b57313f7a168ee790b443f819d132ac23e1f1a3ef17407e270
7
+ data.tar.gz: 960abd42e30e338ef6f5aa4481a505235291f3d36bc85b114c3530bfcfcd46f692a735e3683102428854a7154f6d86e0112c8bf4d532756b08feedecf33fb88a
@@ -20,10 +20,8 @@ module StripeInvoice
20
20
 
21
21
  next unless owner # skip if we don't have an owner
22
22
 
23
- country = Country[charge.country] ? charge.country : Country.find_by_name(charge.country)
24
- country = country.alpha2 if country.is_a? Country
25
- country ||= 'Unknown Country'
26
-
23
+ country = get_country charge
24
+
27
25
  data = {
28
26
  charge: charge,
29
27
  country: country,
@@ -59,7 +57,6 @@ module StripeInvoice
59
57
  InvoiceMailer.tax_report(res).deliver! #unless ::Rails.env.development?
60
58
  end
61
59
 
62
-
63
60
  private
64
61
  def date_to_epoch(date)
65
62
  Date.strptime(date,"%Y-%m-%d").to_datetime.utc.to_i
@@ -99,5 +96,10 @@ module StripeInvoice
99
96
 
100
97
  result.with_indifferent_access
101
98
  end
99
+
100
+ def get_country(charge)
101
+ Country[charge.country] ? charge.country :
102
+ ((country = Country.find_country_by_name(charge.country)) ? country.alpha2 : 'Unkown Country')
103
+ end
102
104
  end
103
105
  end
@@ -1,3 +1,3 @@
1
1
  module StripeInvoice
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe_invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Engelhardt