-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sergey Korney
committed
Sep 3, 2024
1 parent
2b561f6
commit 5f80306
Showing
40 changed files
with
661 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Foundation | ||
|
||
internal struct BuildConfig { | ||
static let AFFISE_VERSION = "1.6.39" | ||
static let AFFISE_VERSION = "1.6.40" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
AffiseAttributionLib/Classes/modules/subscription/AffiseProductPrice.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Foundation | ||
|
||
@objc | ||
public class AffiseProductPrice: NSObject { | ||
public internal(set) var value: Decimal | ||
public internal(set) var currencyCode: String | ||
public internal(set) var formattedPrice: String | ||
|
||
public internal(set) var locale: Locale = Locale.current | ||
|
||
public init( | ||
value: Decimal, | ||
currencyCode: String, | ||
formattedPrice: String | ||
) { | ||
self.value = value | ||
self.currencyCode = currencyCode | ||
self.formattedPrice = formattedPrice | ||
} | ||
|
||
public convenience init( | ||
value: Decimal, | ||
priceLocale: Locale? = Locale.current | ||
) { | ||
let locale = priceLocale ?? Locale.current | ||
|
||
let formatter = NumberFormatter() | ||
formatter.locale = locale | ||
formatter.numberStyle = .currency | ||
|
||
let currencyCode = locale.currencyCode ?? "" | ||
|
||
// if #available(iOS 16, *) { | ||
// currencyCode = locale.currency?.identifier ?? "" // TODO | ||
// } | ||
|
||
self.init( | ||
value: value, | ||
currencyCode: currencyCode, | ||
formattedPrice: formatter.string(from: NSDecimalNumber(decimal: value)) ?? "\(value) \(currencyCode)" | ||
) | ||
} | ||
|
||
public override var description: String { | ||
"AffiseProductPrice(value=\"\(value)\", currencyCode=\"\(currencyCode)\", formattedPrice=\"\(formattedPrice)\")" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
AffiseAttributionLib/Classes/modules/subscription/AffiseProductSubscriptionDetail.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Foundation | ||
|
||
|
||
@objc | ||
public class AffiseProductSubscriptionDetail: NSObject { | ||
// public internal(set) var offerToken: String | ||
public internal(set) var offerId: String? | ||
public internal(set) var timeUnit: TimeUnitType | ||
public internal(set) var numberOfUnits: Int | ||
|
||
public init( | ||
offerId: String? = nil, | ||
timeUnit: TimeUnitType, | ||
numberOfUnits: Int | ||
) { | ||
self.offerId = offerId | ||
self.timeUnit = timeUnit | ||
self.numberOfUnits = numberOfUnits | ||
} | ||
|
||
public override var description: String { | ||
"AffiseProductSubscriptionDetail(offerId=\"\(offerId ?? "")\", timeUnit=\"\(timeUnit)\", numberOfUnits=\"\(numberOfUnits)\")" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 13 additions & 12 deletions
25
AffiseAttributionLib/Classes/modules/subscription/AffisePurchasedInfo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
import Foundation | ||
|
||
|
||
@objc | ||
public class AffisePurchasedInfo: NSObject { | ||
|
||
public internal(set) var product: AffiseProduct? | ||
|
||
public internal(set) var operationDate: Date? | ||
|
||
public internal(set) var orderId: String? | ||
|
||
public internal(set) var originalOrderId: String? | ||
public internal(set) var purchase: Any? = nil | ||
|
||
public internal(set) var skData: Any? = nil | ||
|
||
public convenience init(_ transaction: Any?, _ product: AffiseProduct?, orderId: String? = nil, originalOrderId: String?, operationDate: Date?) { | ||
public internal(set) var operationDate: Date? | ||
|
||
public convenience init( | ||
_ transaction: Any?, | ||
_ product: AffiseProduct?, | ||
orderId: String? = nil, | ||
originalOrderId: String?, | ||
operationDate: Date? | ||
) { | ||
self.init() | ||
self.skData = transaction | ||
self.product = product | ||
self.orderId = orderId | ||
self.originalOrderId = originalOrderId | ||
self.purchase = transaction | ||
self.operationDate = operationDate | ||
} | ||
public override var description: String { | ||
|
||
override public var description: String { | ||
"AffisePurchasedInfo(productId=\"\(product?.productId ?? "")\", orderId=\"\(orderId ?? "")\", originalOrderId=\"\(originalOrderId ?? "")\")" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.