Open
Description
Describe the bug
The id
attribute on StripeObject
instances, like an instance of the Subscription
object, when accessed, doesn't return a str
containing the id, but instead a copy of the whole object.
To Reproduce
-
Set up a webhook on a
customer.subscription.created
event -
in webhook:
>>> event = stripe.Webhook.construct_event(request.body(), sig_header, <Secret>) >>> subscription = stripe.Subscription(event["data"]["object"]) >>> subscription.id <Subscription subscription id=sub_....>
Expected behavior
-
Set up a webhook on a
customer.subscription.created
event -
in webhook:
>>> event = stripe.Webhook.construct_event(request.body(), sig_header, <Secret>) >>> subscription = stripe.Subscription(event["data"]["object"]) >>> subscription.id "sub_..."
Code snippets
OS
Docker
Language version
Python 3.11
Library version
stripe-python 12.1.0
API version
2025-04-30
Additional context
No response