stripe_invoice 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/stripe_invoice/charge.rb +6 -5
- data/lib/stripe_invoice/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c305da2ef2b69b073b84bf050d0fc793494bae43
|
4
|
+
data.tar.gz: 6ff3e0fe43ecd54d2c19b13bf45f94c812dc3b6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 548fff04f67664a4c25e578a4272d25c56406aadffe69bcaa362129c77085bd603e0576ddf09e21d7bd1a293f6d342e1df144bc7535432bf910ff7527f4c3adb
|
7
|
+
data.tar.gz: 3e83e38bb47783b44dc62c9982f742e7d8c07a4022508244e9bb8f7c589eeb5a67e97bbff167717944026b1a52ebda6d61e9bd094b953b539a7b34ada23fe1d3
|
@@ -46,14 +46,14 @@ module StripeInvoice
|
|
46
46
|
def self.create_from_stripe(stripe_charge)
|
47
47
|
|
48
48
|
unless stripe_charge.paid
|
49
|
-
puts "ignoring unpaid
|
50
|
-
return
|
49
|
+
return puts "[#{self.class.name}##{__method__.to_s}] ignoring unpaid charge #{stripe_charge.id}"
|
51
50
|
end
|
52
51
|
|
53
52
|
charge = Charge.find_by_stripe_id(stripe_charge[:id])
|
54
53
|
|
55
54
|
# for existing invoices just update and be done
|
56
55
|
if charge.present?
|
56
|
+
puts "[#{self.class.name}##{__method__.to_s}] updating data for #{stripe_charge.id}"
|
57
57
|
charge.update_attribute(:json, stripe_charge)
|
58
58
|
return charge
|
59
59
|
end
|
@@ -93,18 +93,19 @@ module StripeInvoice
|
|
93
93
|
|
94
94
|
# we found them directly, go for it.
|
95
95
|
unless subscription.nil?
|
96
|
+
puts "[#{self.class.name}##{__method__.to_s}] found owner directly for #{stripe_charge.id} - #{subscription.subscription_owner_email}"
|
96
97
|
return subscription.subscription_owner
|
97
98
|
end
|
98
99
|
|
99
100
|
# koudoku does have a nasty feature/bug in that it deletes the subscription
|
100
101
|
# from the database when it is cancelled. This makes it impossible to
|
101
102
|
# match past charges to customers based solely on the subscription's stripe_id
|
102
|
-
# instead we also try to match the email address
|
103
|
+
# instead we also try to match the email address that was send to stripe
|
103
104
|
# when the account was created
|
104
105
|
stripe_customer = Stripe::Customer.retrieve stripe_charge.customer
|
105
106
|
return nil if stripe_customer[:deleted] # yes, that can happen :-(
|
106
|
-
|
107
|
-
Koudoku.owner_class.
|
107
|
+
puts "[#{self.class.name}##{__method__.to_s}] found owner via email for #{stripe_charge.id} - #{stripe_customer.email}"
|
108
|
+
Koudoku.owner_class.try(:find_by_email, stripe_customer.email)
|
108
109
|
|
109
110
|
end
|
110
111
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe_invoice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Engelhardt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|