added custom label
This commit is contained in:
@@ -53,6 +53,8 @@ YOOKASSA_AUTOPAYMENTS_REQUIRE_CARD_BINDING=True #
|
|||||||
# Nalogo (self-employed receipts)
|
# Nalogo (self-employed receipts)
|
||||||
NALOGO_INN=your_inn # INN for nalog.ru
|
NALOGO_INN=your_inn # INN for nalog.ru
|
||||||
NALOGO_PASSWORD=your_nalogo_password # Password for nalog.ru
|
NALOGO_PASSWORD=your_nalogo_password # Password for nalog.ru
|
||||||
|
NALOGO_RECEIPT_NAME_SUBSCRIPTION=subscription {months} months # Receipt name for time-based subscriptions ({months} = duration)
|
||||||
|
NALOGO_RECEIPT_NAME_TRAFFIC=traffic package {gb} GB # Receipt name for traffic packages ({gb} = traffic amount)
|
||||||
|
|
||||||
# FreeKassa Payment Gateway Configuration
|
# FreeKassa Payment Gateway Configuration
|
||||||
FREEKASSA_MERCHANT_ID=your_shop_id # Your shop ID in FreeKassa
|
FREEKASSA_MERCHANT_ID=your_shop_id # Your shop ID in FreeKassa
|
||||||
|
|||||||
@@ -282,9 +282,9 @@ async def process_successful_payment(session: AsyncSession, bot: Bot,
|
|||||||
receipt_item_name = payment_info_from_webhook.get("description")
|
receipt_item_name = payment_info_from_webhook.get("description")
|
||||||
if not receipt_item_name:
|
if not receipt_item_name:
|
||||||
if sale_mode == "traffic":
|
if sale_mode == "traffic":
|
||||||
receipt_item_name = f"Remnawave traffic package {traffic_label} GB"
|
receipt_item_name = settings.NALOGO_RECEIPT_NAME_TRAFFIC.format(gb=traffic_label)
|
||||||
else:
|
else:
|
||||||
receipt_item_name = f"Remnawave subscription {int(subscription_months)} months"
|
receipt_item_name = settings.NALOGO_RECEIPT_NAME_SUBSCRIPTION.format(months=int(subscription_months))
|
||||||
try:
|
try:
|
||||||
await nalogo_service.create_income_receipt(
|
await nalogo_service.create_income_receipt(
|
||||||
item_name=receipt_item_name,
|
item_name=receipt_item_name,
|
||||||
|
|||||||
@@ -54,6 +54,14 @@ class Settings(BaseSettings):
|
|||||||
default=None,
|
default=None,
|
||||||
description="Password for nalog.ru (self-employed) authentication"
|
description="Password for nalog.ru (self-employed) authentication"
|
||||||
)
|
)
|
||||||
|
NALOGO_RECEIPT_NAME_SUBSCRIPTION: str = Field(
|
||||||
|
default="subscription {months} months",
|
||||||
|
description="Receipt item name for time-based subscriptions. Use {months} placeholder for duration."
|
||||||
|
)
|
||||||
|
NALOGO_RECEIPT_NAME_TRAFFIC: str = Field(
|
||||||
|
default="traffic package {gb} GB",
|
||||||
|
description="Receipt item name for traffic packages. Use {gb} placeholder for traffic amount."
|
||||||
|
)
|
||||||
|
|
||||||
WEBHOOK_BASE_URL: Optional[str] = None
|
WEBHOOK_BASE_URL: Optional[str] = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user