Skip to content

Commit e65fcaa

Browse files
Add livemode to ThinEvent (#1409)
1 parent 668f1d4 commit e65fcaa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

stripe/v2/_event.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class ThinEvent:
111111
"""
112112
created: str
113113
"""
114+
Livemode indicates if the event is from a production(true) or test(false) account.
115+
"""
116+
livemode: bool
117+
"""
114118
Time at which the object was created.
115119
"""
116120
context: Optional[str] = None
@@ -132,6 +136,7 @@ def __init__(self, payload: str) -> None:
132136
self.id = parsed["id"]
133137
self.type = parsed["type"]
134138
self.created = parsed["created"]
139+
self.livemode = parsed.get("livemode")
135140
self.context = parsed.get("context")
136141
if parsed.get("related_object"):
137142
self.related_object = RelatedObject(parsed["related_object"])

tests/test_v2_event.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def v2_payload_no_data(self):
1818
"id": "evt_234",
1919
"object": "v2.core.event",
2020
"type": "financial_account.balance.opened",
21+
"livemode": True,
2122
"created": "2022-02-15T00:27:45.330Z",
2223
"related_object": {
2324
"id": "fa_123",
@@ -39,6 +40,7 @@ def v2_payload_with_data(self):
3940
"id": "evt_234",
4041
"object": "v2.core.event",
4142
"type": "financial_account.balance.opened",
43+
"livemode": False,
4244
"created": "2022-02-15T00:27:45.330Z",
4345
"related_object": {
4446
"id": "fa_123",

0 commit comments

Comments
 (0)