ish_models 0.0.33.224 → 0.0.33.225
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ish/payment.rb +5 -1
- data/lib/ish/user_profile.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: dcf6779d3d2bafd20719969eb3a2c13681784ce9a6486e444fd8407299b68b10
|
4
|
+
data.tar.gz: 5a0de640fd761b5af8709aae17be40572284c3462fb214849b26dfb440595d7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb445008b52c1d966e8b190241ff6621e3799d0a242221c0b618d1cbd24a75a6f8ddfac7f3f3f39e0815b0dbc849c02d8f107bb16ce915786afd18f3adbaa129
|
7
|
+
data.tar.gz: a6d9882e974666522ec2358b443f0c4deac2fda3b20ac0a8b68f9adabf606fcc02264b5876003f803129a69a609c1cd758d644dfb83e2050eca6f959a8d13014
|
data/lib/ish/payment.rb
CHANGED
@@ -14,7 +14,11 @@ class Ish::Payment
|
|
14
14
|
field :client_secret
|
15
15
|
field :payment_intent_id
|
16
16
|
|
17
|
-
|
17
|
+
STATUS_CONFIRMED = 'confirmed'
|
18
|
+
STATUS_PENDING = 'pending'
|
19
|
+
STATUSES = %w| active pending |
|
20
|
+
field :status, type: Symbol, default: STATUS_PENDING
|
21
|
+
scope :confirmed, ->{ where( status: STATUS_CONFIRMED ) }
|
18
22
|
|
19
23
|
after_create :compute_paid_invoice_amount
|
20
24
|
def compute_paid_invoice_amount
|
data/lib/ish/user_profile.rb
CHANGED
@@ -69,7 +69,7 @@ class Ish::UserProfile
|
|
69
69
|
has_many :payments, :class_name => '::Ish::Payment'
|
70
70
|
|
71
71
|
def has_premium_purchase item
|
72
|
-
payments.where( item: item ).exists?
|
72
|
+
payments.confirmed.where( item: item ).exists?
|
73
73
|
end
|
74
74
|
|
75
75
|
field :is_purchasing, type: Boolean, default: false
|