spree_account_recurring 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/app/models/spree/user_decorator.rb +6 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Installation
|
|
11
11
|
Install `spree_account_recurring` by adding the following to your `Gemfile`:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'spree_account_recurring', '1.0.
|
14
|
+
gem 'spree_account_recurring', '1.0.6'
|
15
15
|
```
|
16
16
|
|
17
17
|
Bundle your dependencies and run the installation generator:
|
@@ -1,9 +1,13 @@
|
|
1
1
|
Spree::User.class_eval do
|
2
2
|
has_many :subscriptions
|
3
3
|
|
4
|
-
def find_or_create_stripe_customer(token)
|
4
|
+
def find_or_create_stripe_customer(token=nil)
|
5
5
|
return api_customer if stripe_customer_id?
|
6
|
-
customer =
|
6
|
+
customer = if token
|
7
|
+
Stripe::Customer.create(description: email, email: email, card: token)
|
8
|
+
else
|
9
|
+
Stripe::Customer.create(description: email, email: email)
|
10
|
+
end
|
7
11
|
update_column(:stripe_customer_id, customer.id)
|
8
12
|
customer
|
9
13
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_account_recurring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 6
|
10
|
+
version: 1.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Priyank Gupta
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-
|
18
|
+
date: 2014-08-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: spree_core
|