lib/pay/stripe/billable.rb
# Handles Billable#update_card
#
# Returns true if successful
Handles Billable#update_card
Returns true if successful
Handles Billable#update_card Returns true if successful
def update_stripe_card(token)
        customer = stripe_customer
        token = ::Stripe::Token.retrieve(token)
        return if token.card.id == customer.default_source
        card = customer.sources.create(source: token.id)
        customer.default_source = card.id
        customer.save
        update_stripe_card_on_file(card)
        true
      rescue ::Stripe::StripeError => e
        raise Error, e.message
      end
def update_stripe_card ( token ) customer = stripe_customer token = :: Stripe :: Token . retrieve ( token ) return if token . card . id == customer . default_source card = customer . sources . create ( source : token . id ) customer . default_source = card . id customer . save update_stripe_card_on_file ( card ) true rescue :: Stripe :: StripeError => e raise Error , e . message end
Handles Billable#update_card
Returns true if successful
Handles Billable#update_card Returns true if successful
token