Add Danbooru Winter Sale.
This commit is contained in:
@@ -437,7 +437,9 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def tag_query_limit(level)
|
||||
if level >= User::Levels::BUILDER
|
||||
if level >= User::Levels::MEMBER && Danbooru.config.is_promotion?
|
||||
Float::INFINITY
|
||||
elsif level >= User::Levels::BUILDER
|
||||
Float::INFINITY
|
||||
elsif level == User::Levels::PLATINUM
|
||||
12
|
||||
|
||||
@@ -37,7 +37,11 @@ class UserUpgrade < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.gold_price
|
||||
2000
|
||||
if Danbooru.config.is_promotion?
|
||||
1500
|
||||
else
|
||||
2000
|
||||
end
|
||||
end
|
||||
|
||||
def self.platinum_price
|
||||
@@ -161,6 +165,9 @@ class UserUpgrade < ApplicationRecord
|
||||
price: price_id,
|
||||
quantity: 1,
|
||||
}],
|
||||
discounts: [{
|
||||
coupon: promotion_discount_id,
|
||||
}],
|
||||
metadata: {
|
||||
user_upgrade_id: id,
|
||||
purchaser_id: purchaser.id,
|
||||
@@ -218,6 +225,12 @@ class UserUpgrade < ApplicationRecord
|
||||
!pending?
|
||||
end
|
||||
|
||||
def promotion_discount_id
|
||||
if Danbooru.config.is_promotion?
|
||||
Danbooru.config.stripe_promotion_discount_id
|
||||
end
|
||||
end
|
||||
|
||||
def upgrade_price_id(currency)
|
||||
case [upgrade_type, currency]
|
||||
when ["gold", "usd"]
|
||||
|
||||
Reference in New Issue
Block a user