Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

StripeObject id attribute returns whole object #1516

Copy link
Copy link
Open
@suel2000

Description

@suel2000
Issue body actions

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

  1. Set up a webhook on a customer.subscription.created event

  2. 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

  1. Set up a webhook on a customer.subscription.created event

  2. 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.