lib/pay/stripe/billable.rb
# Handles Billable#customer
#
# Returns Stripe::Customer
Handles Billable#customer
Returns Stripe::Customer
Handles Billable#customer Returns Stripe :: Customer
def create_stripe_customer
        customer = ::Stripe::Customer.create(email: email, source: card_token, description: customer_name)
        update(processor: 'stripe', processor_id: customer.id)
        source = customer.sources.data.first
        if source.present?
          update_stripe_card_on_file customer.sources.retrieve(source.id)
        end
        customer
      end
def create_stripe_customer customer = :: Stripe :: Customer . create ( email : email , source : card_token , description : customer_name ) update ( processor : 'stripe' , processor_id : customer . id ) source = customer . sources . data . first if source . present? update_stripe_card_on_file customer . sources . retrieve ( source . id ) end customer end
Handles Billable#customer
Returns Stripe::Customer
Handles Billable#customer Returns Stripe :: Customer
# Update the user's card on file if a token was passed in