moss_generator 0.5.2 → 0.6.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 +4 -4
- data/.rubocop.yml +4 -1
- data/Gemfile.lock +1 -1
- data/lib/moss_generator/stripe_charge_row.rb +31 -1
- data/lib/moss_generator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b22a165ad650e03060e839cd9ea483817eec530a42836fc8f5e9d935aa2cebd5
|
|
4
|
+
data.tar.gz: 3989024f80875480c50112e1360d6100e14d75cfceff9ab99a569a447de1becb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45da0e44d80d6f5f04f762c948af8e91127b2deedd6d67ea23b77a8f731797a98e5674272d8084e9bfbff391803d18cefcbe0716ef802d000dc15aac58420416
|
|
7
|
+
data.tar.gz: 3ab6c4be61713bf7032db78373d156c7a397a41d8ee1173097316d059229dfa7133e2416c01b1b60e29ad6fef43545cc3fe218e2553eda2ac42f6173a7da9eae
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -98,7 +98,37 @@ module MossGenerator
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def fetch_country_code
|
|
101
|
-
|
|
101
|
+
source_country || payment_method_country || fallback_country
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def source_country
|
|
105
|
+
return source_owner_country if source_type.nil?
|
|
106
|
+
|
|
107
|
+
charge.dig('source', source_type, 'country') ||
|
|
108
|
+
charge.dig('source', source_type, 'address_country')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def payment_method_country
|
|
112
|
+
return if payment_type.nil?
|
|
113
|
+
|
|
114
|
+
charge.dig('payment_method_details', payment_type, 'country') ||
|
|
115
|
+
charge.dig('payment_method_details', payment_type, 'address_country')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def source_type
|
|
119
|
+
charge.dig('source', 'type') || charge.dig('source', 'object')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def source_owner_country
|
|
123
|
+
charge.dig('source', 'owner', 'address', 'country')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def payment_type
|
|
127
|
+
charge.dig('payment_method_details', 'type')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def fallback_country
|
|
131
|
+
charge.dig('shipping', 'address', 'country')
|
|
102
132
|
end
|
|
103
133
|
|
|
104
134
|
def amount_with_vat
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moss_generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- frdrkolsson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-01-
|
|
11
|
+
date: 2022-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: countries
|