mirror of
https://github.com/mas-cli/mas
synced 2025-02-16 12:38:30 +00:00
Satisfy linter
The linter complained that the line with the URL parameters was too long. I transformed the parameters into a dictionary. This has the additional value of differences in parameters between installing and purchasing can be spotted more easily.
This commit is contained in:
parent
50b438011a
commit
3364a34784
1 changed files with 17 additions and 4 deletions
|
@ -16,14 +16,27 @@ extension SSPurchase {
|
|||
convenience init(adamId: UInt64, account: ISStoreAccount, isPurchase: Bool) {
|
||||
self.init()
|
||||
|
||||
var parameters: [String: Any] = [
|
||||
"productType": "C",
|
||||
"price": 0,
|
||||
"salableAdamId": adamId,
|
||||
"pg": "default",
|
||||
"appExtVrsId": 0
|
||||
]
|
||||
|
||||
if isPurchase {
|
||||
buyParameters =
|
||||
"productType=C&price=0&salableAdamId=\(adamId)&pricingParameters=STDQ&pg=default&appExtVrsId=0&macappinstalledconfirmed=1"
|
||||
parameters["macappinstalledconfirmed"] = 1
|
||||
parameters["pricingParameters"] = "STDQ"
|
||||
|
||||
} else {
|
||||
// is redownload, use existing functionality
|
||||
buyParameters =
|
||||
"productType=C&price=0&salableAdamId=\(adamId)&pricingParameters=STDRDL&pg=default&appExtVrsId=0"
|
||||
parameters["pricingParameters"] = "STDRDL"
|
||||
}
|
||||
|
||||
buyParameters = parameters.map { key, value in
|
||||
return "\(key)=\(value)"
|
||||
}.joined(separator: "&")
|
||||
|
||||
itemIdentifier = adamId
|
||||
accountIdentifier = account.dsID
|
||||
appleID = account.identifier
|
||||
|
|
Loading…
Add table
Reference in a new issue