fix: apply telegram group member monthly price
This commit is contained in:
@@ -98,7 +98,7 @@ class TelegramGroupPricing:
|
||||
os.getenv("TELEGRAM_CHAT_ID"),
|
||||
)
|
||||
self.group_chat_ids = dedicated_group_chat_ids or fallback_group_chat_ids
|
||||
self.member_price = _decimal_env("POLYWEATHER_GROUP_MEMBER_PRICE_USDC", "10")
|
||||
self.member_price = _decimal_env("POLYWEATHER_GROUP_MEMBER_PRICE_USDC", "5")
|
||||
self.public_price = _decimal_env("POLYWEATHER_PUBLIC_PRICE_USDC", "10")
|
||||
self.timeout_sec = max(
|
||||
2,
|
||||
|
||||
@@ -396,7 +396,7 @@ class PaymentContractCheckoutService:
|
||||
)
|
||||
self.telegram_payment_pricing_enabled = _env_bool(
|
||||
"POLYWEATHER_PAYMENT_TELEGRAM_PRICING_ENABLED",
|
||||
False,
|
||||
True,
|
||||
)
|
||||
self.points_enabled = _env_bool("POLYWEATHER_PAYMENT_POINTS_ENABLED", True)
|
||||
self.points_per_usdc = max(
|
||||
@@ -1696,6 +1696,8 @@ class PaymentContractCheckoutService:
|
||||
except Exception:
|
||||
telegram_id = None
|
||||
price_payload = pricing.resolve_price_for_telegram_id(telegram_id)
|
||||
if not bool(price_payload.get("is_group_member")):
|
||||
return out
|
||||
amount_dec = _parse_decimal(
|
||||
price_payload.get("amount_usdc"), out["amount_usdc_decimal"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user