FoundersAS/dj-stripe — pull request #8 by eLysgaard (2014-09-26 10:14:03+00:00)
Title: Hotfix/customer.update card

Added small method called findfirst(f, seq) (added to djstripe.models for now), which returns first item in sequence where f(item) == True.

In djstripe.models.Customer.update_card I call findfirst with f=(lambda card: card['id'] == Customer.stripe_customer.default_card) and seq=Customer.stripe_customer.cards.data. I then use the card returned by findfirst to set self.card_fingerprint etc.