Skip to content

Surface object property on EventNotification - #2265

Merged
xavdid merged 1 commit into
masterfrom
DEVSDK-3101
Aug 7, 2026
Merged

Surface object property on EventNotification#2265
xavdid merged 1 commit into
masterfrom
DEVSDK-3101

Conversation

@xavdid

@xavdid xavdid commented Aug 7, 2026

Copy link
Copy Markdown
Member

Why?

object is present in the original payload, but we didn't surface it on the EventNotification class. Because ``v2.core.event"` is the only value that will ever be present, It didn't seem worth adding it to the interface.

I also wanted to better differentiate EventNotifications from all other StripeObjects (since they do behave differently).

But, that also means interacting with it along with other objects is unnecessarily complicated. From the original ruby issue:

def v1?(event)
  (event.try(:object) || event.try(:dig, "object")) == "event"
end

def v2?(event)
  event.is_a?(::Stripe::V2::Core::EventNotification) || # thin event notification
    (event.try(:object) || event.try(:dig, "object")) == "v2.core.event"
end

Because the value is present in the original response, it doesn't make sense to eat it.

What?

  • add public object property to EventNotification
  • add test

See Also

@xavdid
xavdid requested a review from a team as a code owner August 7, 2026 19:17
@xavdid
xavdid requested review from jar-stripe and removed request for a team August 7, 2026 19:17
@xavdid
xavdid enabled auto-merge (squash) August 7, 2026 19:17
@xavdid
xavdid merged commit 7bc55f1 into master Aug 7, 2026
17 checks passed
@xavdid
xavdid deleted the DEVSDK-3101 branch August 7, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants