Skip to content

Commit

Permalink
refactor: update Stripe webhook decoder to use Event type instead of …
Browse files Browse the repository at this point in the history
…StripeEvent

Updates the type declaration in the Stripe webhook handler from StripeEvent to Event,
maintaining consistent type naming throughout the codebase.
  • Loading branch information
bwdmr committed Feb 14, 2025
1 parent 5c579be commit e3701c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func handleStripeWebhooks(req: Request) async throws -> HTTPResponse {
decoder.dateDecodingStrategy = .secondsSince1970
decoder.keyDecodingStrategy = .convertFromSnakeCase

let event = try decoder.decode(StripeEvent.self, from: req.bodyData)
let event = try decoder.decode(Event.self, from: req.bodyData)

switch (event.type, event.data?.object) {
case (.paymentIntentSucceeded, .paymentIntent(let paymentIntent)):
Expand Down

0 comments on commit e3701c4

Please sign in to comment.