From 5c579beaf2d7a31aa1427ad0a7584eb71dbbc728 Mon Sep 17 00:00:00 2001 From: Stevenson Michel <130018170+thoven87@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:17:56 -0400 Subject: [PATCH] Billing Portal session (#271) --- Sources/StripeKit/Core Resources/Events/Event.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Sources/StripeKit/Core Resources/Events/Event.swift b/Sources/StripeKit/Core Resources/Events/Event.swift index 4929440..088cfa7 100644 --- a/Sources/StripeKit/Core Resources/Events/Event.swift +++ b/Sources/StripeKit/Core Resources/Events/Event.swift @@ -74,6 +74,7 @@ public enum EventObject: Codable { case applicationFee(ApplicationFee) case applicationFeeRefund(ApplicationFeeRefund) case balance(Balance) + case billingPortalSession(PortalSession) case capability(Capability) case charge(Charge) case dispute(Dispute) @@ -104,7 +105,7 @@ public enum EventObject: Codable { case price(Price) case product(Product) case promotionCode(PromotionCode) - case earlyFraudWarniing(EarlyFraudWarning) + case earlyFraudWarning(EarlyFraudWarning) case quote(Quote) case reportRun(ReportRun) case reportType(ReportType) @@ -138,6 +139,8 @@ public enum EventObject: Codable { self = try .bankAccount(BankAccount(from: decoder)) case "billing_portal.configuration": self = try .configuration(PortalConfiguration(from: decoder)) + case "billing_portal.session": + self = try .billingPortalSession(PortalSession(from: decoder)) case "fee_refund": self = try .applicationFeeRefund(ApplicationFeeRefund(from: decoder)) case "balance": @@ -203,7 +206,7 @@ public enum EventObject: Codable { case "promotion_code": self = try .promotionCode(PromotionCode(from: decoder)) case "radar.early_fraud_warning": - self = try .earlyFraudWarniing(EarlyFraudWarning(from: decoder)) + self = try .earlyFraudWarning(EarlyFraudWarning(from: decoder)) case "quote": self = try .quote(Quote(from: decoder)) case "reporting.report_run": @@ -247,6 +250,8 @@ public enum EventObject: Codable { try cashBalance.encode(to: encoder) case .bankAccount(let bankAccount): try bankAccount.encode(to: encoder) + case .billingPortalSession(let portalSession): + try portalSession.encode(to: encoder) case .applicationFee(let applicationFee): try applicationFee.encode(to: encoder) case .applicationFeeRefund(let applicationFeeRefund): @@ -313,7 +318,7 @@ public enum EventObject: Codable { try product.encode(to: encoder) case .promotionCode(let promotionCode): try promotionCode.encode(to: encoder) - case .earlyFraudWarniing(let earlyFraudWarning): + case .earlyFraudWarning(let earlyFraudWarning): try earlyFraudWarning.encode(to: encoder) case .quote(let quote): try quote.encode(to: encoder)