lib/pay/braintree/billable.rb
# Handles Billable#customer
#
# Returns Braintree::Customer
Handles Billable#customer
Returns Braintree::Customer
Handles Billable#customer Returns Braintree :: Customer
def update_braintree_card_on_file(payment_method)
        case payment_method
        when ::Braintree::CreditCard
          update!(
            card_type: payment_method.card_type,
            card_last4: payment_method.last_4,
            card_exp_month: payment_method.expiration_month,
            card_exp_year: payment_method.expiration_year
          )
        when ::Braintree::PayPalAccount
          update!(
            card_type: "PayPal",
            card_last4: payment_method.email
          )
        end
        self.card_token = nil
      end
def update_braintree_card_on_file ( payment_method ) case payment_method when :: Braintree :: CreditCard update! ( card_type : payment_method . card_type , card_last4 : payment_method . last_4 , card_exp_month : payment_method . expiration_month , card_exp_year : payment_method . expiration_year ) when :: Braintree :: PayPalAccount update! ( card_type : "PayPal" , card_last4 : payment_method . email ) end self . card_token = nil end
Handles Billable#customer
Returns Braintree::Customer
Handles Billable#customer Returns Braintree :: Customer
# Clear the card token so we don't accidentally update twice
payment_method