Skip to content

Subscription schedule phase prorationBehavior missing case #263

@andrew804

Description

@andrew804

Environment:
Xcode 15.3
Swift 5.10.0
vapor 4.55.4
stripe-kit 24.0.0
Stripe API 2023-08-16


I have an issue creating / updating a subscription schedule with a phase with a prorationBehavior of case always_invoice. This is because the SubscriptionSchedulePhase.prorationBehavior enum is missing the always_invoice case.

From the docs:
"enum. always_invoice / create_prorations / none"

https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-phases-proration_behavior

Here's an example updating a subscription schedule's phases:

let _ = try await req.stripe.subscriptionSchedules
.update(
  schedule: schedule.id,
  metadata: nil,
  phases: [
    [ 
      "items": [["price": priceID]],
      "proration_behavior": SubscriptionProrationBehavior.alwaysInvoice.rawValue,  // MISSING CASE
      "start_date": Int(nextBillDate.timeIntervalSince1970),
      ],
    ],
  prorationBehavior: nil,
  defaultSettings: nil,
  endBehavior: .release,
  expand: nil
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions