#andreyl - python delete card

1 messages · Page 1 of 1 (latest)

ionic coral
#

Are you having trouble when you actually call this?

#

Our tests do show the same, so I'd expect it to be working as documented

neat remnant
#

stripe.Custumer.delete_source does not exist for me, so I can't call it ...

#

Sorry if I wasn't clear in my original message. You can see it missing from the attached screenshot.

#

Screenshot attached to the original message that is.

ionic coral
#

What version of the python client are you using?

neat remnant
#

I'm using 1.30.0

ionic coral
#

This code runs fine for me:

#
cust = stripe.Customer.create(
    description="My test cust",
    metadata=dict(key="val")
)
print(cust)

stripe.Customer.create_source(
  cust.id,
  source="tok_visa",
)

cards = stripe.Customer.list_sources(
  cust.id,
  object="card",
  limit=3,
)

print(cards)

stripe.Customer.delete_source(
  cust.id,
  cards.data[0].id,
)

#

Ah, that version of stripe-python is extremely old and may not support that request

#

So you'll need to update to at least that version

neat remnant
#

I see. Thank you!

ionic coral
#

NP!

neat remnant
#

Is there any way to remove a source with the version I have?

ionic coral
#

I'm not sure, as our tags versions don't go back that far for me to review

#

So you may wish to construct that request manually using an http library

neat remnant
#

Thank you. But nothing in the library that you know of?