localstripe icon indicating copy to clipboard operation
localstripe copied to clipboard

This is one step in fixing issue #88

Open meatherly opened this issue 5 years ago • 4 comments

It implements the GET '/v1/customers/{id}/sources' endpoint for a customer as described here: https://stripe.com/docs/api/cards/list

Also I've never written python before 😬

Things I still need to implement is supporting the object param but I'm not really sure where to start with that one. Please feel free to give me some feedback on this one.

meatherly avatar Aug 07 '20 19:08 meatherly

What would you suggest for filtering out sources on their type for the object type param? Would I just initialize a new List then filter out the obj.sources based on their prefix?

something like: (pseudo code)

returnList = List('/v1/customers/' + self.id + '/sources')
returnList._list = obj.sources.filter source.startswith(object)

meatherly avatar Aug 13 '20 16:08 meatherly

Looking at their docs it looks like object param can only be card or bank_account

meatherly avatar Aug 13 '20 16:08 meatherly

Man can I just say you're awesome for creating this and for being patient with me as I'm working on this!!

meatherly avatar Aug 13 '20 17:08 meatherly

Alright went off the beaten path did an override on Card._api_list_all to allow filtering of customer cards. If you're not a fan of this I can move that logic into the Customer._api_list_sources.

Let me know what you think

Also not sure why the build keeps failing 😬

meatherly avatar Aug 13 '20 19:08 meatherly