fix(order): prevent duplicate subscriptions and repair invite gifts
Build docker and publish / build (20.15.1) (push) Successful in 5m6s
Build docker and publish / build (20.15.1) (push) Successful in 5m6s
This commit is contained in:
@@ -12,6 +12,9 @@ func getDiscount(discounts []types.SubscribeDiscount, inputMonths int64, isNewUs
|
||||
if d.Quantity != inputMonths || d.Discount <= 0 || d.Discount >= 100 {
|
||||
continue
|
||||
}
|
||||
if d.NewUserOnly && !isNewUser {
|
||||
continue
|
||||
}
|
||||
if isNewUser {
|
||||
// lowest discount value = biggest saving
|
||||
if best < 0 || d.Discount < best {
|
||||
@@ -50,4 +53,3 @@ func isNewUserOnlyForQuantity(discounts []types.SubscribeDiscount, inputQuantity
|
||||
}
|
||||
return hasNewUserOnly && !hasFallback
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user