diff --git a/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionSchedule.swift b/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionSchedule.swift index 68d81338..9a68bf29 100644 --- a/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionSchedule.swift +++ b/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionSchedule.swift @@ -99,7 +99,7 @@ public struct SubscriptionScheduleCurrentPhase: Codable { public struct SubscriptionScheduleDefaultSettings: Codable { /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account during this phase of the schedule. - public var applicationFeePercent: String? + public var applicationFeePercent: Float? /// Default settings for automatic tax computation. public var automaticTax: SubscriptionScheduleDefaultSettingsAutomaticTax? /// Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle documentation. @@ -119,7 +119,7 @@ public struct SubscriptionScheduleDefaultSettings: Codable { /// The account (if any) the subscription’s payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription’s invoices. public var transferData: SubscriptionScheduleTransferData? - public init(applicationFeePercent: String? = nil, + public init(applicationFeePercent: Float? = nil, automaticTax: SubscriptionScheduleDefaultSettingsAutomaticTax? = nil, billingCycleAnchor: SubscriptionScheduleBillingCycleAnchor? = nil, billingThresholds: SubscriptionScheduleDefaultSettingsBillingThresholds? = nil, @@ -198,7 +198,7 @@ public struct SubscriptionSchedulePhase: Codable { /// A list of prices and quantities that will generate invoice items appended to the first invoice for this phase. public var addInvoiceItems: [SubscriptionSchedulePhaseAddInvoiceItem]? /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account during this phase of the schedule. - public var applicationFeePercent: String? + public var applicationFeePercent: Float? /// Automatic tax settings for this phase. public var automaticTax: SubscriptionSchedulePhaseAutomaticTax? /// Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If automatic then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle documentation. @@ -237,7 +237,7 @@ public struct SubscriptionSchedulePhase: Codable { public var trialEnd: Date? public init(addInvoiceItems: [SubscriptionSchedulePhaseAddInvoiceItem]? = nil, - applicationFeePercent: String? = nil, + applicationFeePercent: Float? = nil, automaticTax: SubscriptionSchedulePhaseAutomaticTax? = nil, billingCycleAnchor: SubscriptionScheduleBillingCycleAnchor? = nil, billingThresholds: SubscriptionScheduleDefaultSettingsBillingThresholds? = nil, @@ -366,6 +366,7 @@ public enum SubscriptionScheduleStatus: String, Codable { public enum SubscriptionSchedulePhaseProrationBehavior: String, Codable { case createProrations = "create_prorations" + case alwaysInvoice = "always_invoice" case none } diff --git a/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionScheduleRoutes.swift b/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionScheduleRoutes.swift index f95867af..51ca0677 100644 --- a/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionScheduleRoutes.swift +++ b/Sources/StripeKit/Billing/Subscription Schedule/SubscriptionScheduleRoutes.swift @@ -27,7 +27,7 @@ public protocol SubscriptionScheduleRoutes: StripeAPIRoute { startDate: Date?, defaultSettings: [String: Any]?, endBehavior: SubscriptionScheduleEndBehavior?, - fromSubscription: Bool?, + fromSubscription: String?, expand: [String]?) async throws -> SubscriptionSchedule /// Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. @@ -97,7 +97,7 @@ public struct StripeSubscriptionScheduleRoutes: SubscriptionScheduleRoutes { startDate: Date? = nil, defaultSettings: [String: Any]? = nil, endBehavior: SubscriptionScheduleEndBehavior? = nil, - fromSubscription: Bool? = nil, + fromSubscription: String? = nil, expand: [String]? = nil) async throws -> SubscriptionSchedule { var body: [String: Any] = [:]