stripe_local 0.2.0 → 0.2.1
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: 55f370059b40792516290f4b28d8c9958e610409
|
4
|
+
data.tar.gz: 7953ce49e32bc62d4658e95e506f5ba7726b13d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b662e677a6d5295b946406af5dabfaab07514e808144d73c3fc4be9479742a182026acd6f1dd89ef0dac6f02d3288a95ed647557a20715ca619a48f13c468d23
|
7
|
+
data.tar.gz: c7cf4471090035205e95633181dd0b82385d635c1574283cafda930ac3a60a1dad56e102f91ef0ddd8ff5002007c8d5cb5574e6c24194439810c60b0f0008f57
|
data/README.md
CHANGED
@@ -5,9 +5,9 @@ A rails engine that maintains a local store of all your Stripe resources, keepin
|
|
5
5
|
Manages the complexities of keeping two data sources in sync while providing the speed and simplicity of dealing with purely local data in a purely synchronous fashion.
|
6
6
|
|
7
7
|
## <b style="color:red;">[</b>UNDER CONSTRUCTION<b style="color:red;">]</b>
|
8
|
-
### Not
|
8
|
+
### Not considered "Production Ready"
|
9
9
|
|
10
|
-
I had considered waiting to open source this project untill it was something
|
10
|
+
I had considered waiting to open source this project untill it was something really sturdy. However, my free time is limited and there is no telling how long it might have taken me.
|
11
11
|
|
12
12
|
My hope is that some of you will see some potential and dig in to help me get it working. Please don't be shy, I don't claim to be an expert and I am open to your ideas for improvement.
|
13
13
|
|
@@ -11,8 +11,8 @@ module StripeLocal
|
|
11
11
|
|
12
12
|
time_writer :created
|
13
13
|
|
14
|
-
def metadata=
|
15
|
-
MultiJson.dump
|
14
|
+
def metadata= so
|
15
|
+
MultiJson.dump so.to_hash
|
16
16
|
end
|
17
17
|
|
18
18
|
def metadata
|
@@ -32,6 +32,7 @@ module StripeLocal
|
|
32
32
|
when :balance_transaction then :transaction_id
|
33
33
|
when :card then h[:card_id] = v.id and next
|
34
34
|
when :created then h[:created] = Time.at(v) and next
|
35
|
+
when :metadata then h[:metadata] = MultiJson.dump( v.to_hash ) and next
|
35
36
|
when ->(x){attribute_method? x} then k.to_sym
|
36
37
|
else next
|
37
38
|
end
|
@@ -36,6 +36,7 @@ module StripeLocal
|
|
36
36
|
key = case k.to_sym
|
37
37
|
when :cards then create_each_card( v.data ) and next
|
38
38
|
when :subscription then create_subscription( v ) and next
|
39
|
+
when :metadata then h[:metadata] = MultiJson.dump( v.to_hash ) and next
|
39
40
|
when ->(x){attribute_method? x} then k.to_sym
|
40
41
|
else next
|
41
42
|
end
|
@@ -54,6 +55,14 @@ module StripeLocal
|
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
def metadata= so
|
59
|
+
MultiJson.dump so.to_hash
|
60
|
+
end
|
61
|
+
|
62
|
+
def metadata
|
63
|
+
MultiJson.load read_attribute( :metadata ), symbolize_keys: true
|
64
|
+
end
|
65
|
+
|
57
66
|
#=!=>>>
|
58
67
|
# ~<Schema>~
|
59
68
|
# t.string :id
|
@@ -10,8 +10,8 @@ module StripeLocal
|
|
10
10
|
|
11
11
|
time_writer :period_start, :period_end
|
12
12
|
|
13
|
-
def metadata=
|
14
|
-
MultiJson.dump
|
13
|
+
def metadata= so
|
14
|
+
MultiJson.dump so.to_hash
|
15
15
|
end
|
16
16
|
|
17
17
|
def metadata
|
@@ -28,6 +28,7 @@ module StripeLocal
|
|
28
28
|
key = case k.to_sym
|
29
29
|
when :invoice then :invoice_id
|
30
30
|
when :plan then h[:plan_id] = v.id and next
|
31
|
+
when :metadata then h[:metadata] = MultiJson.dump( v.to_hash ) and next
|
31
32
|
when :type then h[:subscription] = (v == "subscription" ? true : false) and next
|
32
33
|
when :period then h[:period_start] = Time.at(v.start) and h[:period_end] = Time.at(v.end) and next
|
33
34
|
when ->(x){attribute_method? x} then k.to_sym
|
@@ -8,8 +8,8 @@ module StripeLocal
|
|
8
8
|
|
9
9
|
time_writer :date
|
10
10
|
|
11
|
-
def metadata=
|
12
|
-
MultiJson.dump
|
11
|
+
def metadata= so
|
12
|
+
MultiJson.dump so.to_hash
|
13
13
|
end
|
14
14
|
|
15
15
|
def metadata
|
@@ -26,6 +26,7 @@ module StripeLocal
|
|
26
26
|
key = case k.to_sym
|
27
27
|
when :balance_transaction then :transaction_id
|
28
28
|
when :date then h[:date] = Time.at(v) and next
|
29
|
+
when :metadata then h[:metadata] = MultiJson.dump( v.to_hash ) and next
|
29
30
|
when ->(x){attribute_method? x} then k.to_sym
|
30
31
|
else next
|
31
32
|
end
|
data/lib/stripe_local/version.rb
CHANGED