Skip to content

Conversation

xavdid-stripe
Copy link
Member

Why?

As part of the Next-Gen Event Handling project, we're adding fully typed classes to represent all the thin events Event Notifications a user could receive. There are also helper methods that help with the event handling experience.

What?

  • (see changelog below for user-facing changes)
  • add tests
  • fix doc typos
  • TKTK

See Also

DEVSDK-2662

Changelog

We've overhauled how V2 Events are handled in the SDK! This approach should provide a lot more information at authoring and compile time, leading to more robust integrations. As part of this process, there are a number of changes to be aware of.

  • ⚠️ Renamed Stripe::ThinEvent to Stripe::EventNotification
  • ⚠️ Renamed StripeClient.parse_thin_event to StripeClient.parse_event_notification and changed its method signature accordingly
  • Added matching EventNotification classes to every v2 Event. For example, there's now a V1BillingMeterErrorReportTriggeredEventNotification to match the existing V1BillingMeterErrorReportTriggeredEvent. Each notification class defines a fetch_event() method to retrieve its corresponding event. For events with related objects, there's a fetch_related_object() method that performs the API call and casts the response to the correct type.
  • Added UnknownEventNotification to help with handling unknown event types

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.

1 participant