leanweb 0.4.0 → 0.4.1
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/contrib/lib/hawese.rb +15 -5
- data/lib/leanweb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f77b8182d574da9b7ca9116e48a655320dc3810a557051dab732d0b780a73aa
|
|
4
|
+
data.tar.gz: e1719ccbb68a186a6f5110d8f5ee5473b6ddd7179dc73d98fe9484018c9e0343
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b8719d4dac4027e67885eba698eef6283f7e1882c932ee5a5901ed239aa002d7d26162230c61fe6baf156385dc7e33decf0d0113522ab5ddd1777162aa1509e
|
|
7
|
+
data.tar.gz: 3fe7948a0bcc47c04f97288617b23ae20538a6670c362e7d393c6b8fcae02fa04b0c0fc47e3bb5d03bb3766572861fad1b2130270dbceb96b1834a8d337f9e7e
|
data/contrib/lib/hawese.rb
CHANGED
|
@@ -56,11 +56,7 @@ class Hawese
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def purchase_from_schema(gateway, schema)
|
|
59
|
-
|
|
60
|
-
schema[:properties].each do |property, contents|
|
|
61
|
-
fields[property] = contents[:default] if contents.include?(:default)
|
|
62
|
-
end
|
|
63
|
-
purchase(gateway, fields)
|
|
59
|
+
purchase(gateway, fields_to_schema_defaults(schema))
|
|
64
60
|
end
|
|
65
61
|
|
|
66
62
|
def payment(uuid)
|
|
@@ -72,5 +68,19 @@ class Hawese
|
|
|
72
68
|
JSON.parse(response.body, symbolize_names: true)
|
|
73
69
|
end
|
|
74
70
|
end
|
|
71
|
+
|
|
72
|
+
protected
|
|
73
|
+
|
|
74
|
+
def fields_to_schema_defaults(schema)
|
|
75
|
+
fields = {}
|
|
76
|
+
schema[:properties].each do |property, contents|
|
|
77
|
+
if contents.include?(:properties)
|
|
78
|
+
fields[property] = fields_to_schema_defaults(contents)
|
|
79
|
+
elsif contents.include?(:default)
|
|
80
|
+
fields[property] = contents[:default]
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
fields
|
|
84
|
+
end
|
|
75
85
|
end
|
|
76
86
|
end
|
data/lib/leanweb/version.rb
CHANGED