#andreyl - python delete card
1 messages · Page 1 of 1 (latest)
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
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.
What version of the python client are you using?
I'm using 1.30.0
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
Support was added for this in 1.50: https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#1500---2017-03-17
So you'll need to update to at least that version
I see. Thank you!
NP!
Is there any way to remove a source with the version I have?
I'm not sure, as our tags versions don't go back that far for me to review
You can always make API requests manually with HTTP requests, though:
https://stripe.com/docs/api/cards/create?lang=curl
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So you may wish to construct that request manually using an http library
Thank you. But nothing in the library that you know of?