Skip to content

Commit

Permalink
Add livemode to ThinEvent (#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe authored Oct 3, 2024
1 parent 668f1d4 commit e65fcaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stripe/v2/_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ class ThinEvent:
"""
created: str
"""
Livemode indicates if the event is from a production(true) or test(false) account.
"""
livemode: bool
"""
Time at which the object was created.
"""
context: Optional[str] = None
Expand All @@ -132,6 +136,7 @@ def __init__(self, payload: str) -> None:
self.id = parsed["id"]
self.type = parsed["type"]
self.created = parsed["created"]
self.livemode = parsed.get("livemode")
self.context = parsed.get("context")
if parsed.get("related_object"):
self.related_object = RelatedObject(parsed["related_object"])
Expand Down
2 changes: 2 additions & 0 deletions tests/test_v2_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def v2_payload_no_data(self):
"id": "evt_234",
"object": "v2.core.event",
"type": "financial_account.balance.opened",
"livemode": True,
"created": "2022-02-15T00:27:45.330Z",
"related_object": {
"id": "fa_123",
Expand All @@ -39,6 +40,7 @@ def v2_payload_with_data(self):
"id": "evt_234",
"object": "v2.core.event",
"type": "financial_account.balance.opened",
"livemode": False,
"created": "2022-02-15T00:27:45.330Z",
"related_object": {
"id": "fa_123",
Expand Down

0 comments on commit e65fcaa

Please sign in to comment.