lib/colt/credit_card.rb in colt-0.4.1 vs lib/colt/credit_card.rb in colt-0.4.2
- old
+ new
@@ -2,10 +2,11 @@
class CreditCard
#
# Adds a new credit card as the active default card for an existing customer
#
+ # Returns : ?
def self.add(stripe_customer_id, stripe_token)
customer = Stripe::Customer.retrieve(stripe_customer_id)
card = customer.sources.create(source: stripe_token)
customer.default_card = card.id
customer.save
@@ -13,16 +14,18 @@
end
#
# Create a new credit card for a customer
#
+ # Returns : ?
def self.save(stripe_token, description)
Stripe::Customer.create(card: stripe_token, description: description)
end
#
# Update expiration date of an existing credit card for a customer
#
+ # Returns ?
def self.update_expiration_date(stripe_customer_id, card_month, card_year)
customer = Stripe::Customer.retrieve(stripe_customer_id)
card = customer.sources.first
card.exp_month = card_month
card.exp_year = card_year
\ No newline at end of file