colt 0.4.1 → 0.4.2
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/lib/colt/credential.rb +1 -1
- data/lib/colt/credit_card.rb +3 -0
- data/lib/colt/subscription_payment.rb +2 -1
- data/lib/colt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5538b127725452e8dcfeff0fdf7d11c59eefa988
|
4
|
+
data.tar.gz: 14e73505495494a5a5b51a42acf3532736095a1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bcd17dc2be6b15b69c13c1ccad2ff67ffb5d76128c4dde92abfadc629606c7a3291096958e3806362fe27742308b113eb37de780704b7caaffd7657e1548eaf
|
7
|
+
data.tar.gz: e302370cc23002fb92a9ec7b63eb5e7789b013a49bcadfd114d3d6baddf418ab5c9038478788818287a6af56280cbfa1810443fc842b0385911d636779bf648d
|
data/lib/colt/credential.rb
CHANGED
data/lib/colt/credit_card.rb
CHANGED
@@ -4,6 +4,7 @@ module Colt
|
|
4
4
|
#
|
5
5
|
# Adds a new credit card as the active default card for an existing customer
|
6
6
|
#
|
7
|
+
# Returns : ?
|
7
8
|
def self.add(stripe_customer_id, stripe_token)
|
8
9
|
customer = Stripe::Customer.retrieve(stripe_customer_id)
|
9
10
|
card = customer.sources.create(source: stripe_token)
|
@@ -15,6 +16,7 @@ module Colt
|
|
15
16
|
#
|
16
17
|
# Create a new credit card for a customer
|
17
18
|
#
|
19
|
+
# Returns : ?
|
18
20
|
def self.save(stripe_token, description)
|
19
21
|
Stripe::Customer.create(card: stripe_token, description: description)
|
20
22
|
end
|
@@ -22,6 +24,7 @@ module Colt
|
|
22
24
|
#
|
23
25
|
# Update expiration date of an existing credit card for a customer
|
24
26
|
#
|
27
|
+
# Returns ?
|
25
28
|
def self.update_expiration_date(stripe_customer_id, card_month, card_year)
|
26
29
|
customer = Stripe::Customer.retrieve(stripe_customer_id)
|
27
30
|
card = customer.sources.first
|
@@ -5,8 +5,9 @@ module Colt
|
|
5
5
|
class SubscriptionPayment
|
6
6
|
SUBSCRIPTION_PAYMENT_FAILED = "invoice.payment_failed"
|
7
7
|
|
8
|
+
# Retrieving the event from the Stripe API guarantees its authenticity
|
8
9
|
def initialize(id)
|
9
|
-
@event = Stripe::Event.retrieve(
|
10
|
+
@event = Stripe::Event.retrieve(id)
|
10
11
|
end
|
11
12
|
|
12
13
|
def failed?
|
data/lib/colt/version.rb
CHANGED