Skip to content

Commit

Permalink
feat(marketing features): Adding Product Marketing Feature (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoven87 authored Aug 14, 2024
1 parent 1d9fbc3 commit 7d3452d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Sources/StripeKit/Products/Products/Product.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public struct Product: Codable {
public var updated: Date?
/// A URL of a publicly-accessible webpage for this product.
public var url: String?
/// The marketing feature name. Up to 80 characters long.
public var marketingFeatures: [MarketingFeature]?

public init(id: String,
active: Bool? = nil,
Expand All @@ -61,7 +63,8 @@ public struct Product: Codable {
taxCode: String? = nil,
unitLabel: String? = nil,
updated: Date? = nil,
url: String? = nil) {
url: String? = nil,
marketingFeatures: [MarketingFeature]? = []) {
self.id = id
self.active = active
self._defaultPrice = Expandable(id: defaultPrice)
Expand All @@ -79,6 +82,15 @@ public struct Product: Codable {
self.unitLabel = unitLabel
self.updated = updated
self.url = url
self.marketingFeatures = marketingFeatures
}
}

public struct MarketingFeature: Codable {
public var name: String?

public init(name: String? = nil) {
self.name = name
}
}

Expand Down

0 comments on commit 7d3452d

Please sign in to comment.