Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(marketing features): Adding Product Marketing Feature #268

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
thoven87 marked this conversation as resolved.
Show resolved Hide resolved

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?

init(name: String? = nil) {
thoven87 marked this conversation as resolved.
Show resolved Hide resolved
self.name = name
}
}

Expand Down